Skip to documentation content

Errors and retries

Handle transient and permanent failures predictably.

In this guide
  1. 1Classify errors
  2. 2Retry transient failures
  3. 3Log request IDs
In this guide
  1. 1Classify errors
  2. 2Retry transient failures
  3. 3Log request IDs

Error response

JSON
{
  "error": {
    "code": "rate_limited",
    "message": "Too many requests",
    "request_id": "req_01J4N7"
  }
}

When to retry

StatusAction
400 / 422Fix the request; do not retry unchanged
401 / 403Fix credentials or permissions
429Retry after the indicated delay
5xxRetry with exponential backoff and jitter

Keep request IDs

Record the request ID, job ID, status code, and attempt count. This is the fastest route to resolving production incidents.

Was this page helpful?