Skip to main content

Error format

Every error response is JSON with an error code and a message:
  • error is a stable snake_case code you can switch on.
  • message is a human-readable explanation.
  • 400 validation errors also include details with per-field messages.
A 401 Unauthorized means the request was not authenticated. A 403 Forbidden means the token was accepted, but the client is not allowed to access the resource.

Authentication Errors

Protected endpoints require a valid OAuth 2.0 access token.

Missing Token

If the Authorization header is missing, protected endpoints return 401 Unauthorized:
Include the token on every request except POST /auth/token and GET /health:

Invalid or Expired Token

If the access token is invalid, expired, or revoked, protected endpoints return:
If your access token has expired, request a new one. See Create Access Token. If you receive the same error with a token you expect to be valid, verify that:
  • The header uses the Bearer scheme and the token value is complete.
  • The token has not been revoked or replaced.

Invalid Client Credentials

POST /auth/token does not use a Bearer token. If the client ID or client secret is wrong, the API returns:
Confirm the credentials from your company page on goLance under OAuth Applications.

Unauthorized Token

In rare cases, a token is accepted but is not associated with a user. Protected endpoints then return:
If this persists after requesting a new token, contact goLance Support.

Validation Errors

If the request body or query parameters fail validation, the API returns 400 Bad Request:

Rate Limits

The API limits how many requests a client can send in a 1-minute window. Limits are counted per IP address, and POST /auth/token also counts per clientId. GET /health is not rate limited. POST /auth/token is subject to both the global IP limit and the stricter auth limits. The lowest remaining limit is the one that applies. When a limit is exceeded, the API returns 429 Too Many Requests:
Successful and rejected responses include rate-limit headers:
A 429 response also includes Retry-After with the number of seconds to wait before retrying. Recommended handling:
  • Do not retry immediately. Wait for Retry-After, or until RateLimit-Reset seconds have passed.
  • Cache the access token and reuse it until it expires (typically 1 hour). Do not call POST /auth/token on every request.

Server Errors (5xx)

If the API returns a 5xx status code (for example 500 Internal Server Error), it means that an unexpected error occurred on the goLance servers.
These errors are usually temporary. Recommended handling:
  • Retry the request after a short delay (for example, 5–10 seconds).
  • If the error persists, contact goLance Support and provide the request details (endpoint, timestamp, and response body if available).