Sign in

Errors

One shape, stable codes.

Every error has the same shape. Branch on code; show message to people if you like (it's written for them).

JSON
{
  "error": {
    "code": "invalid_request",
    "message": "Check subject: Too small: expected string to have >=1 characters.",
    "details": {
      "fields": [
        {
          "path": "subject",
          "message": "Too small: expected string to have >=1 characters"
        }
      ]
    }
  },
  "requestId": "req_3kPq0d1nV2a8sLmG"
}
StatuscodeMeans
400invalid_requestA parameter or field is missing or wrong. `details.fields` says which.
400invalid_jsonThe body isn't a JSON object.
401unauthorizedNo token, or the token isn't valid (signed out, revoked or mistyped).
401token_expiredThe access token is past its hour: get a new one with the refresh token.
403insufficient_scopeThe token doesn't carry the permission this needs (`details.scope`).
403forbiddenThe person's own access doesn't allow it (role, branch, territory).
403api_disabledThe organisation turned the API off (Control › API access).
403app_not_allowedThe organisation doesn't allow this app, or the app is turned off.
403ip_not_allowedThe key only works from its listed addresses.
404not_foundNothing with that id that this person can see.
405method_not_allowedThe path exists but not with this method.
409conflictIt clashes with what's there (a duplicate, or a request with the same Idempotency-Key still running).
410cursor_expiredA changes-feed position older than 30 days: list again and start the feed afresh.
412precondition_failedIf-Match didn't match: someone changed it since you read it. Read it again.
413payload_too_largeThe body is over the limit for this endpoint.
415unsupported_media_typeSend `Content-Type: application/json` (or the type the endpoint says).
422unprocessableUnderstood, but it can't be done (`message` says why), e.g. an Idempotency-Key reused with a different body.
429rate_limitedToo many requests: wait `Retry-After` seconds.
500internal_errorOur fault. Retry with the same Idempotency-Key; quote `requestId` to support.
503unavailableA service behind the API is busy or restarting: retry shortly.

What to retry#

  • 429: after Retry-After seconds.
  • 500, 502, 503, network errors: with backoff (1 s, 2 s, 4 s…), and the same Idempotency-Key on POSTs.
  • 401 token_expired: refresh, then retry once.
  • Anything else in the 400s: fix the request; retrying won't help.