Errors

How the API reports failures
View as MarkdownOpen in Claude

When a request fails, the API returns a non-2xx HTTP status and a JSON body. Most failures share a common shape; a few return a reduced shape. The Error envelope reference describes every variation. This page covers how to handle errors in a client.

The standard shape

1{
2 "statusCode": 401,
3 "message": "Invalid or expired token",
4 "error": "Unauthorized",
5 "meta": {
6 "requestId": "4a3b2c1d-5e6f-4890-9abc-def0fedcba98",
7 "timestamp": "2026-05-15T10:30:45.000Z"
8 }
9}
FieldTypeNotes
statusCodeintegerThe HTTP status, mirrored into the body.
messagestring or array of stringsA human-readable description. An array for validation failures.
errorstringA short label for the status class. Not always present.
codestringA machine-readable label. Present on some failures only.
metaobjectCarries requestId and timestamp. Not always present.

Branch on the HTTP status code

Field availability is not uniform: error, code, and meta may be absent, and some errors omit statusCode from the body entirely. The one signal always available is the HTTP status code of the response itself. Branch on that first. Use code when it is present for a more precise decision, but never require it.

Handle message as a string or an array

message is always present, but its type varies. For a validation failure it is an array of individual messages:

1{
2 "statusCode": 400,
3 "message": [
4 "latitude must not be less than -90",
5 "latitude must not be greater than 90"
6 ],
7 "error": "Bad Request",
8 "meta": {
9 "requestId": "5e6f7a8b-9c0d-4123-a4b5-c6d7e8f9a0b1",
10 "timestamp": "2026-05-15T10:30:45.000Z"
11 }
12}

Normalise it in your client, for example by joining an array into a single string before display.

Handling by status

StatusMeaningWhat to do
400The request was malformed or failed validation.Fix the request from message. Do not retry it unchanged.
401The token is missing, invalid, or expired.Obtain a fresh token and retry once. See Authentication.
403The token is valid but not permitted this action.Do not retry. The same token will keep failing.
404The resource does not exist or is not visible.Do not retry. Check the identifier.
409The request conflicts with current state.Refetch the current state, then retry.
429Too many requests in a short window.Back off, then retry.
5xxA server-side fault.Retry with backoff rather than immediately.

Support traceability

When the response includes meta.requestId, log it. Including it in a support request lets the team locate the exact request and its server-side context.