Skip to main content
The API uses standard HTTP status codes. Errors return a JSON body.

Error format

  • detail is usually a stable code in lowercase with underscores, such as agent_not_found or contact_list_not_found. Match on the code, not on the HTTP reason phrase.
  • A few authentication errors carry a short text in detail, such as Invalid or expired API key.
  • Errors raised before a request reaches the API can add a human-readable message.
  • For 422, detail is usually a list of field errors, each with loc (where the problem is), msg and type. Some refusals return a string code instead, and a few return an object with a code. Handle all three shapes.

Status codes

Each operation in the reference lists the 404, 409 and 5xx responses it can return.

Permanent document deletion

404, 412 and 428 from the permanent document deletion do not use detail. They return {"error_code": "...", "preview": {...}}, where error_code is resource_not_found, deletion_preview_changed (412) or if_match_required (428). A 412 returns the fresh preview and its ETag header, so you can show the change and retry with the new ETag without requesting another preview.

Credential errors

These 401 codes come with a message: An unknown or deleted key answers 401 with detail set to Invalid or expired API key. The text is literal: keys do not expire.

Rate limit and availability codes

  • 429 with detail rate_limited: slow down and retry after the number of seconds in the Retry-After header.
  • 503: a dependency the request needs is temporarily unavailable, and detail names it, for example rate_limit_unavailable (the API could not count your request) or contacts_unavailable. Retry with backoff.

Retrying

  • Retry 429 and 503 (and other 5xx on read operations) with exponential backoff and jitter, honoring Retry-After when present.
  • Do not retry other 4xx errors without changing the request. They will fail again.
  • Creating operations are not idempotent: a retried POST can create a second resource. After a timeout, list the resource to check whether the first request succeeded.