Skip to content
developers

Authentication

Get an access token

POST/v1/auth/tokenProduction

Base URL
Sandboxhttps://sandbox.zulu.com.co/v1
Productionhttps://api.zulutransfer.com/v1

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

No Authorization or X-API-Key: the credentials go in the body.

Request

Body

  • client_idstringrequired
    Client identifier. In the sandbox, the one of your dashboard credentials; in production, the one zulu hands over through a secure channel.
    min. 1 charactersExample: "YOUR_CLIENT_ID"
  • client_secretstringrequired
    Client secret. Treat it like a password: never in a frontend or a repository.
    min. 1 charactersExample: "********"

Responses

  • 200Token issued.

    Body
    • access_tokenstringrequired
      JWT signed with RS256. Send it as Authorization: Bearer <access_token>.
      Example: "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9..."
    • token_typestringrequired
      Always Bearer.
      Always "Bearer"Example: "Bearer"
    • expires_inintegerrequired
      Seconds the token is valid (3600). Reuse it until it expires; do not request a token per call.
      Example: 3600
    • scopestringoptional
      Granted scopes. May be absent.
  • 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.

HTTPerrorcauseDescription
400BadRequestApiErrorerror in struct validationOne or more fields fail their validation. values carries one message per field, keyed by its JSON path, naming the Go validator that failed.
400BadRequestApiErrorinvalid json body: %sThe 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.
401access_deniedUnauthorizedThe client_id or the client_secret is not valid.
403access_deniedClient is not authorized to access this APIThe credentials are valid but the client is not enabled to use the API (revoked credential or suspended workspace).
429too_many_requestsToo many requestsToo many token requests. Reuse the current token until it expires (expires_in).
500InternalServerApiError[code:1] unexpected errorInternal 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"
}