Overview
Errors & Rate Limits
Error codes, rate limits, and how to handle API errors
HTTP Status Codes#
| Status | Meaning | Common Cause |
|---|---|---|
200 | Success | Request completed successfully |
400 | Bad Request | The operation refused a value, such as an amount out of range |
401 | Unauthorized | Missing, invalid, revoked or expired API token, or no seat with the x-role-type role |
403 | Forbidden | Valid token, but the role can't run this operation or reach this record |
404 | Not Found | Operation name is unknown, or a record the request names doesn't exist |
405 | Method Not Allowed | The HTTP method isn't used by any operation (only GET, POST, PUT and DELETE are) |
409 | Conflict | The record already exists or is in a state that blocks the change |
429 | Too Many Requests | Rate limit exceeded |
500 | Internal Server Error | A request body that fails schema validation, other refusals without their own status, or an unexpected server error |
Response Format#
A successful call returns 200 with the result in data:
Errors come in two shapes, so check for both.
Errors from the operation itself (validation, permissions, missing records) put the message in error.message, with the status from the table above:
Errors before the operation runs (token, unknown operation, wrong method, rate limit) return error as a plain string:
There is no details field.
Common Errors#
Authentication Errors (401)#
Authorization Errors (403)#
Validation Errors (400 and 500)#
A value the operation checks itself returns 400:
A body that fails the operation's schema (a missing required field, a wrong type, an unknown field) currently returns 500. The message is the list of problems as JSON text:
Not Found (404)#
Wrong Method (405)#
An operation called with a method it isn't registered for (for example GET listGrants sent as POST) returns 404, not 405.
Rate Limiting#
By default, the API allows:
- 300 requests a minute for the seat your token acts as
- 600 requests a minute for your IP address
- 200 requests a second from one IP address to one server
When rate limited, you'll receive a 429 with a Retry-After header (in seconds):
Handling Rate Limits#
- Wait for the
Retry-Afterseconds, then retry with exponential backoff - Batch operations where possible (e.g., use
terminateEmployeeGrantsinstead of multiple individual calls) - Cache responses that don't change frequently (e.g.,
listGrantConfigurations,getTokenTypes)
Best Practices#
- Always check the status code before parsing the response body
- Read both error shapes —
error.messagefor operation errors,erroras a string for the rest - Retry
429after theRetry-Afterseconds, with exponential backoff - Retry a
500carefully. A500can be either shape: an unexpected server failure usually comes back as{"error": {"message"}}, the same shape as a request that failed validation. Retry aGETa few times with backoff. Before retrying a write, check whether it already took effect (for example withlistGrants), and stop retrying when the sameerror.messagecomes back, because the request itself needs fixing - Don't retry
400,401,403,404or409errors — fix the request first - Refresh tokens before they expire — a
401doesn't say why it was refused, so trackexpiresAtand callrefreshUserApiTokenin time