تخطَّ إلى المحتوى
توثيق المطورين

الأخطاء ورموزها

One envelope, a stable code enum, and the exact set of statuses each operation can return.

الأخطاء ورموزها

One envelope, a stable code enum, and the exact set of statuses each operation can return.

Every failure returns the same JSON envelope, including validation failures. Parse the envelope rather than relying on the status code alone, and log request_id: it is the join key with support.

json
{
  "error": {
    "code": "quota_exceeded",
    "message": "The organization has no funded credit left.",
    "details": {},
    "request_id": "req_01HX9Z6Q3M"
  }
}

Status codes

StatusMeaningRetry?
400Malformed request or out-of-range valueNo: fix the request
401Credential missing, malformed or revokedNo
403Credential valid but lacks the scope, or the origin is not allowedNo
404Resource not found, or not visible to your organizationNo
409Conflict: idempotency key reused with a different payload, or a replay of an in-flight requestReuse the original key
413Payload or batch above the documented boundNo: split the request
422A field failed validationNo
429Rate or quota guard firedYes, after Retry-After
500Unexpected server errorYes with backoff, then report request_id
503A dependency is temporarily unavailableYes, after Retry-After
504An upstream provider timed outYes with backoff

Error codes

Codes are stable identifiers. Branch on code, never on message text, which may be localised or reworded.

CodeTypical statusWhat it means
invalid_request400 / 422A parameter or body field failed validation. details may name the field.
invalid_coordinates422A coordinate is outside the valid range, or latitude and longitude were swapped.
quota_exceeded429The organization has no funded credit, or the Free Sandbox allowance is exhausted.
rate_limited429An infrastructure protection ceiling was hit. Honour Retry-After.
idempotency_key_reuse409The same Idempotency-Key was sent with a different request.
idempotency_in_progress409An identical request with the same key is still running. Retry later; it will not be charged twice.
event_too_old422A tracking event's recorded_at is outside the accepted replay window.
event_too_far_future422A tracking event's recorded_at is ahead of server time beyond tolerance.
database_unavailable503A transient storage failure. Retry after the Retry-After header.
database_timeout504A storage operation timed out.
upstream_timeout504Routing or geocoding took too long. Retry, and consider a smaller request.

Reading details

details is an object and its content depends on the code. For validation failures it may name the offending field. For quota failures it may report the balance state. Never assume a fixed shape: treat it as diagnostics, not as a contract you code against.

Retry policy

  • Retry only 429, 500, 503 and 504, and only for idempotent requests or requests carrying an Idempotency-Key.
  • Honour Retry-After when present. When absent, use exponential backoff with jitter, starting at 250 ms.
  • Cap retries at two or three. A request that fails four times is a signal, not a transient.
  • Never retry 401, 403, 404, 409, 413 or 422: the second attempt is guaranteed to fail the same way.
  • Log request_id and the status code for every failed attempt so support can reconstruct the sequence.