Documentation Index
Fetch the complete documentation index at: https://docs.fyatu.com/llms.txt
Use this file to discover all available pages before exploring further.
Authentication
FYATU API v3.20 uses JWT (JSON Web Tokens) for secure, stateless authentication. Exchange your API credentials for a scoped access token, then use that token to authenticate all V3.20 requests.Overview
Getting Your Credentials
Login to FYATU
Go to FYATU Dashboard and login to your account
Token Details
| Property | Value |
|---|---|
| Algorithm | HS256 |
| Expiry | 24 hours (86400 seconds) |
| Refresh window | Up to 5 minutes after expiry |
| Format | Bearer token |
Step 1: Obtain Access Token
Exchange your API credentials for a JWT access token. Request only the scopes your integration needs.Response
Step 2: Use Token in Requests
Include the access token in theAuthorization header for all V3.20 API requests:
Step 3: Refresh Token
Before your token expires, refresh it to get a new one. Refresh is allowed up to 5 minutes after expiry.Available Scopes
| Scope | Grants Access To |
|---|---|
cards:read | GET /cards, GET /cards/{id}, GET /cards/{id}/transactions |
cards:write | POST /cards, POST /cards/{id}/fund, POST /cards/{id}/freeze, etc. |
cardholders:read | GET /cardholders, GET /cardholders/{id} |
cardholders:write | POST /cardholders, PATCH /cardholders/{id}, DELETE /cardholders/{id}, KYC session |
programs:read | GET /programs, GET /programs/{id}, GET /programs/{id}/products |
account:read | GET /account/pricing, GET /account/wallet, GET /account/transactions, GET /account/statement |
webhooks:read | GET /webhooks, GET /webhooks/events |
webhooks:write | PUT /webhooks, POST /webhooks/secret/regenerate, POST /webhooks/test |
JWT Payload Structure
When decoded, the V3.20 JWT token contains:| Claim | Description |
|---|---|
sub | Business ID (subject) |
ver | API version — always "3.20" for V3.20 tokens |
scopes | Array of granted permissions |
iat | Issued at (Unix timestamp) |
exp | Expiration (Unix timestamp) |
jti | Unique token identifier |
Error Responses
Invalid Credentials
Business Not Active
Invalid Scope Requested
Insufficient Scope (on protected endpoint)
Best Practices
Token Storage
Token Storage
- Store tokens securely in memory or server-side encrypted storage
- Never expose tokens in client-side code, logs, or public repositories
- Implement automatic token refresh before expiry
Least-Privilege Scopes
Least-Privilege Scopes
- Request only the scopes your integration actually needs
- Use separate tokens for separate microservices (each with its own scope set)
- A compromised minimal-scope token limits the blast radius
Token Refresh Strategy
Token Refresh Strategy
- Track
expiresAtfrom the token response - Refresh when less than 5 minutes remain
- Handle refresh failures by re-authenticating with your
businessId+secretKey
Error Handling
Error Handling
- On
401 AUTH_TOKEN_INVALID: refresh or re-authenticate - On
403 AUTH_SCOPE_DENIED: your token lacks the required scope — request a new token with the correct scopes - Always log
requestIdfor debugging with FYATU support
Rate Limits
| Endpoint | Rate Limit |
|---|---|
POST /v3.20/auth/token | 10 requests per minute |
POST /v3.20/auth/refresh | 30 requests per minute |

