Skip to main content
When a request fails, read error.code for the type of failure and error.reason for its specific cause. Use error.param to find an invalid input, and keep meta.request_id when asking for support. Retry only when another request can succeed. Invalid inputs need a correction, inactive subscriptions need reactivation, and expired cursors need a new first page.

Read an error response

New reasons can be added. If you do not recognize a reason, handle its code rather than assuming success.

Choose an action by code

Correct an input or credential

Restart or change the requested work

For freshness_ceiling_unsatisfied, error.freshness includes max_age_s and data_quality_status. It also includes actual_age_s and as_of when the server has a clock to measure; no immediate retry time is promised.

Wait or schedule a later request

A 503 without a reason means the rate limiter is unavailable. Back off authenticated calls for the specified delay.

Retry timing

These responses include both Retry-After in seconds and a future error.retry_at:
  • Every 429 and 503.
  • 404 with reason pick_not_released.
  • 408 on a GET or HEAD.
Use Retry-After for a delay because it avoids client clock differences. Use retry_at when scheduling a job for an absolute time; long quota and pick-release delays belong in a scheduler.
A timed-out POST, PATCH, or DELETE may have completed on the server. It has no retry header. Check its state before repeating it, and reuse its idempotency key where the endpoint supports one.

Example: bounded retries for a read

This Python example makes at most 3 attempts. It schedules neither pick release nor monthly reset, and leaves delays over 60 seconds to the caller:
Use a separate flow for writes so a timeout does not cause a duplicate action.

Check batch items too

A batch can return HTTP 200 while individual items fail. Inspect every data[i].status; an item with status: error has its own error.code and error.message.

Limits

HTTP success proves the batch request was handled, rather than proving every lookup succeeded.