No Authorization or X-API-Key: the credentials go in the body.
Issues an OAuth2 access token (client_credentials grant) from the client credentials. Requires neither X-API-Key nor Authorization.
The token is a JWT signed with RS256, sent as Authorization: Bearer <access_token> on every other endpoint together with your X-API-Key. It expires in expires_in seconds (one hour): reuse it until it expires and only then request another; do not request a token per call.
Authentication
Request
Body
- Client identifier. In the sandbox, the one of your dashboard credentials; in production, the one zulu hands over through a secure channel.
client_idstringrequiredmin. 1 charactersExample: "YOUR_CLIENT_ID" - Client secret. Treat it like a password: never in a frontend or a repository.
client_secretstringrequiredmin. 1 charactersExample: "********"
Responses
200Token issued.
Body
- JWT signed with RS256. Send it as
access_tokenstringrequiredAuthorization: Bearer <access_token>.Example: "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9..." - Always
token_typestringrequiredBearer.Always "Bearer"Example: "Bearer" - Seconds the token is valid (3600). Reuse it until it expires; do not request a token per call.
expires_inintegerrequiredExample: 3600 - Granted scopes. May be absent.
scopestringoptional
400`client_id` or `client_secret` is missing, or the body is not valid JSON.
401Invalid credentials.
403The client is not enabled to use the API.
429Too many token requests. Reuse the current token until it expires.
500Internal error.
Errors
The exact causes this operation can answer, from the error catalog. Compare error and the HTTP status; the cause text is stable but meant for people.
| HTTP | error | cause | Description |
|---|---|---|---|
| 400 | BadRequestApiError | error in struct validation | One or more fields fail their validation. values carries one message per field, keyed by its JSON path, naming the Go validator that failed. |
| 400 | BadRequestApiError | invalid json body: %s | The body is not valid JSON, or a field has the wrong type (a string where a number goes, for example). Answered before the fields are validated. |
| 401 | access_denied | Unauthorized | The client_id or the client_secret is not valid. |
| 403 | access_denied | Client is not authorized to access this API | The credentials are valid but the client is not enabled to use the API (revoked credential or suspended workspace). |
| 429 | too_many_requests | Too many requests | Too many token requests. Reuse the current token until it expires (expires_in). |
| 500 | InternalServerApiError | [code:1] unexpected error | Internal error. On operations that move money, check the state before retrying so the operation is not duplicated. |
Examples
Valid credentials200
Request
curl https://sandbox.zulu.com.co/v1/auth/token \
-H "Content-Type: application/json" \
-d '{
"client_id": "YOUR_CLIENT_ID",
"client_secret": "YOUR_CLIENT_SECRET"
}'Response 200
{
"access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
"token_type": "Bearer",
"expires_in": 3600
}Body without credentials400
Request
curl https://sandbox.zulu.com.co/v1/auth/token \
-H "Content-Type: application/json" \
-d '{}'Response 400
{
"error": "BadRequestApiError",
"cause": "error in struct validation",
"values": {
"client_id": "failed validation on the \"required\" tag",
"client_secret": "failed validation on the \"required\" tag"
}
}Wrong secret401
Request
curl https://sandbox.zulu.com.co/v1/auth/token \
-H "Content-Type: application/json" \
-d '{
"client_id": "YOUR_CLIENT_ID",
"client_secret": "not-the-secret"
}'Response 401
{
"error": "access_denied",
"error_description": "Unauthorized"
}