Authentication
The FYATU CaaS API v3.20 uses API key authentication — no tokens to exchange, no JWTs to decode. Every request must include a valid API key, and the key’s scopes determine what the request is allowed to do.How It Works
Getting Your API Key
Open the CaaS portal
Go to platform.fyatu.com and log in to your CaaS account.
Create an API key
Click Create API Key. Name the key, choose its environment (
LIVE or SANDBOX), and select the scopes it needs.Sending the API Key
Pass your key in theAuthorization header as a Bearer token. This is the only supported method.
Authentication Failure Response
When authentication fails, the API returns an error using the standard response envelope:401 — Invalid API key
403 — Insufficient scope
Environment Isolation
Each API key is bound to a single environment. Keys issued forSANDBOX only work against sandbox data; LIVE keys only against live data. The environment is enforced server-side — you cannot mix data between environments and attempting to do so returns API_KEY_INVALID.
| Environment | Purpose |
|---|---|
SANDBOX | Development and testing. No real card issuance. KYC completes in seconds. |
LIVE | Production. Real cardholders, real cards, real transactions. |
Scopes
API keys are scoped to specific resource permissions. A key without a scope cannot call endpoints that require it — it receives a403 INSUFFICIENT_SCOPE response. Assign only the scopes your integration actually needs.
| Scope | What It Grants |
|---|---|
cardholders:read | GET /cardholders, GET /cardholders/{id} |
cardholders:write | POST /cardholders, PATCH /cardholders/{id}, POST /cardholders/{id}/suspend, POST /cardholders/{id}/reactivate |
cards:read | GET /cards, GET /cards/{id} |
cards:write | POST /cards, POST /cards/{id}/freeze, POST /cards/{id}/unfreeze, POST /cards/{id}/terminate, POST /cards/{id}/fund, POST /cards/{id}/unload |
transactions:read | GET /transactions, GET /transactions/{id} |
webhooks:read | GET /webhooks, GET /webhooks/{id} |
webhooks:write | POST /webhooks, PATCH /webhooks/{id}, DELETE /webhooks/{id} |
Idempotency-Key Header
For write operations (POST), you can supply an Idempotency-Key header to safely retry requests without risking duplicate operations.
- If a request with the same
Idempotency-Keyis received within 24 hours, the API replays the original response without re-executing the operation. - Replayed responses include the header
Idempotency-Replayed: true. - Keys must be unique strings of up to 255 characters. A UUID or a deterministic hash of your operation parameters works well.
- After 24 hours, the key expires and a request with the same key is treated as a new operation.
Rate Limits
The CaaS API enforces a sliding-window rate limit of 1,000 requests per minute per API key. Every response includes rate-limit headers:| Header | Description |
|---|---|
X-RateLimit-Limit | Your key’s request cap per minute |
X-RateLimit-Remaining | Requests remaining in the current window |
X-RateLimit-Reset | Unix timestamp when the window resets |
429 RATE_LIMITED. Implement exponential backoff:
IP Allowlisting
API keys can optionally restrict which IP addresses may use them. If you configure an IP allowlist in the portal and a request arrives from an unlisted IP, the API returns403 IP_NOT_ALLOWED.
This is strongly recommended for server-to-server LIVE integrations. Leave the allowlist empty during development or when your server IPs are dynamic.
Authentication Error Reference
| Code | HTTP | Cause |
|---|---|---|
API_KEY_INVALID | 401 | Key does not exist in this environment or is malformed |
API_KEY_REVOKED | 401 | Key was explicitly revoked in the portal |
API_KEY_EXPIRED | 401 | Key passed its expiry date |
IP_NOT_ALLOWED | 403 | Client IP is not in the key’s allowlist |
BUSINESS_SUSPENDED | 403 | Business account is suspended |
BUSINESS_CLOSED | 403 | Business account is permanently closed |
INSUFFICIENT_SCOPE | 403 | Key does not have the required scope |
RATE_LIMITED | 429 | Request rate exceeded |
Best Practices
Store keys in secrets managers
Store keys in secrets managers
Never hard-code API keys in source files. Use environment variables or a secrets manager (AWS Secrets Manager, HashiCorp Vault, Doppler, etc.). Rotate keys at least every 90 days.
Use separate keys per service
Use separate keys per service
Issue one key per microservice or integration, each with the minimal required scopes. This lets you revoke a single key without disrupting other services.
Configure IP allowlisting for LIVE
Configure IP allowlisting for LIVE
For production workloads, set an IP allowlist on your LIVE API keys. This adds a layer of defense even if a key is leaked — the attacker cannot use it from an unlisted IP.
Use Idempotency-Key on all write operations
Use Idempotency-Key on all write operations
Network failures happen. Always supply
Idempotency-Key on fund, issue, and create requests so a retry never double-charges your program balance.Monitor your rate limit headers
Monitor your rate limit headers
Log
X-RateLimit-Remaining on every response. If it consistently approaches zero, batch requests, cache reads, or contact support to request a higher rate limit.
