Errors
Errors come back as JSON with a stable code and a readable message. Branch on code, never on message.
{ "error": { "code": "INVALID_REQUEST", "message": "Invalid query parameter 'from': Required." }}Error codes
Section titled “Error codes”| Code | HTTP | Meaning | What to do |
|---|---|---|---|
INVALID_QUERY |
400 | A report query parameter is invalid. | Fix the parameter named in the message. |
INVALID_CURSOR |
400 | The report cursor is invalid or does not match the query. | Resend the cursor with the same query, or start again without it. |
DATE_RANGE_TOO_LARGE |
422 | The report date range exceeds the supported window. | Shorten the range. |
EXPORT_TOO_LARGE |
422 | The CSV exceeds 10,000 rows; narrow the filters or date range. | Narrow the dates or filters, or use JSON pages. |
INCOMPATIBLE_OFFICE_WEEKDAYS |
422 | Selected offices must have identical operating weekdays. | Request offices with the same working days separately. |
INVALID_REQUEST |
400 | A query parameter or the cursor is invalid. The message says which. | Fix the parameter named in the message. |
UNAUTHORIZED |
401 | The API token is missing, invalid, or revoked. | Check the header and token. |
FORBIDDEN |
403 | The request is not allowed, for example from a browser origin without CORS access. | Call from a server, not a browser. |
NOT_FOUND |
404 | The endpoint does not exist. | Check the path and IDs. |
METHOD_NOT_ALLOWED |
405 | The endpoint only supports GET. | Use GET. |
RATE_LIMITED |
429 | Too many requests. Wait for the number of seconds in Retry-After. | Wait for Retry-After seconds. |
INTERNAL_ERROR |
500 | An unexpected error. Retry later, and quote X-Request-Id if it persists. | Retry later. Quote X-Request-Id if it persists. |
BAD_GATEWAY |
502 | The API could not reach its backend. Retry later. | Retry later. |
SERVICE_UNAVAILABLE |
503 | The API is temporarily disabled. Retry later. | Retry later. |
New codes may be added. For a code you don’t recognise, fall back on the HTTP status. The preview /v1/work-statuses uses INVALID_REQUEST for bad parameters; the other endpoints use INVALID_QUERY and INVALID_CURSOR.
X-Request-Id
Section titled “X-Request-Id”Every response has an X-Request-Id header. Log it, and include it when you contact support: it lets us find the request.
X-Request-Id: 62685d9b-fc09-419b-b254-7710a652d66fDid this answer your question?Thanks for letting us know.
Related
Still need help? Chat to our support team.
Contact support