Errors

How the API reports errors and how to handle them.

The API returns JSON error responses with a consistent shape. The HTTP status code is the primary signal; the body provides a machine-readable code and a human-readable message.

Response shape

{
  "code": "validation_error",
  "message": "redirect_uri must be one of the URIs registered for this client",
  "field": "redirect_uri"
}
FieldTypeNotes
codestringStable machine-readable identifier (snake_case)
messagestringHuman-readable explanation, may change between versions
fieldstring?Set on 400 validation errors; identifies the offending field

Always switch on code, not message.

Common status codes

HTTPMeaningWhat to do
400Validation / bad requestFix the request and retry
401Missing / invalid authRefresh the token, or re-authorize
403Authenticated but no permissionDon't retry; user needs the right scope or role
404Resource not foundConfirm the ID; don't retry
409Conflict (e.g., duplicate)Inspect the error and adapt
429Rate limitedBack off; check Retry-After
500Server errorRetry with exponential backoff; if persistent, report it

Retry guidance

  • Idempotent verbs (GET, PUT, DELETE) — retry safely on 5xx and network errors.
  • POST — retry only if you set Idempotency-Key (see the API reference) or you can otherwise guarantee the operation is idempotent.
  • Rate limits — honour Retry-After (seconds). Don't retry faster than the server tells you to.

Reporting bugs

If the response looks like a server-side bug (5xx without a clear cause, unexpected 400), include the code, the request ID from the X-Request-Id response header, and a minimal repro in your report.