/api/v1/oauth/token
Get an access token
Exchanges a client id and secret for a bearer token (default lifetime 24 hours). Accepts a JSON or form body with grant_type=client_credentials, client_id, client_secret and an optional space-separated scope; HTTP Basic client authentication; or, for Insurance Cloud migrations, the body {"key": "...", "passkey": "..."}. When scope is omitted the token carries every scope the client is allowed.
- Scope
- None
- Authentication
- None (client credentials in the body)
- Rate limit
- 10 requests per minute per IP address
- Idempotency
- Not keyed. Check before retrying.
Headers
| Header | Meaning |
|---|---|
| Content-Type | application/json or application/x-www-form-urlencoded |
Body fields
| Field | Type | Required | Description |
|---|---|---|---|
| grant_type | string | No |
Must be client_credentials (default).
Example: client_credentials |
| client_id | string | Yes |
Public client id from Settings → API keys (fx_live_…).
Example: fx_live_3fK9aQ2bX8mN1pL4rS6tU0vW |
| client_secret | string | Yes | The secret shown once when the key was created or rotated. |
| scope | string | No |
Space-separated subset of the client's scopes.
Example: read quote bind |
| key | string | No | Insurance Cloud alias for client_id. |
| passkey | string | No | Insurance Cloud alias for client_secret. |
Example
curl -X POST 'https://flexysure.intrepidprojects.co.ke/api/v1/oauth/token' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"grant_type": "client_credentials",
"client_id": "fx_live_3fK9aQ2bX8mN1pL4rS6tU0vW",
"client_secret": "fxs_…",
"scope": "read quote bind"
}'
Request body (JSON)
{
"grant_type": "client_credentials",
"client_id": "fx_live_3fK9aQ2bX8mN1pL4rS6tU0vW",
"client_secret": "fxs_…",
"scope": "read quote bind"
}
{
"access_token": "e3mT…48 characters…",
"token_type": "Bearer",
"expires_in": 86400,
"scope": "read quote bind"
}
Responses
| Status | Meaning |
|---|---|
| 200 | Token issued |
| 400 | invalid_request, invalid_scope or unsupported_grant_type |
| 401 | invalid_client: unknown client id, wrong secret, or revoked client |
| 403 | tenant_inactive: the organisation is suspended or still in KYC review |
| 429 | rate_limited: more than 10 attempts a minute from one IP |
Errors are problem documents; the common codes (401, 403 insufficient_scope, 422, 429) apply to every endpoint.