Atasu Maps

Коды ошибок

Ответы об ошибках по RFC 9457 со стабильным кодом и как их обрабатывать.

Любая ошибка — это application/problem+json (RFC 9457) со стабильным машиночитаемым code. Поле type ведёт на эту страницу (https://atasumaps.com/docs/errors#<code>).

JSON — нәтиже
{
  "type": "https://atasumaps.com/docs/errors#outside_coverage",
  "title": "Waypoint outside the served area",
  "status": 422,
  "code": "outside_coverage",
  "request_id": "351604bb-ba75-4856-b71c-81cbb187dbae",
  "detail": "waypoint 1 is outside the served area (Kazakhstan)",
  "errors": [{ "pointer": "/waypoints/1", "code": "outside_coverage" }]
}

Как обрабатывать ошибки

  • Решайте по code, а не по title или detail (это английский текст для разработчиков, он может меняться). В новых версиях могут появиться новые коды: для неизвестного кода ориентируйтесь на HTTP-статус.
  • Пользователю показывайте свой текст на казахском / русском / английском по code.
  • Обращаясь в поддержку, указывайте request_id.
  • errors[].pointer указывает на поле, не прошедшее проверку (JSON Pointer в вашем запросе).
  • 401 token_expired от хоста тайлов: SDK обновляют токен тайлов сами.
  • 429 rate_limited: подождите Retry-After секунд — см. лимиты.
  • 503 …_unavailable: повторите позже с паузой; ничего не изменилось.
  • Повтор команды (любой POST / PUT / PATCH / DELETE, кроме расчёта маршрутов) с тем же Idempotency-Key всегда безопасен: API вернёт первый результат.

Все коды

КодHTTPМағынасы (ағылшынша, спецификациядан)
invalid_request400Body / query failed validation; see errors
idempotency_key_required400Mutating command without Idempotency-Key
limit_exceeded400Too many waypoints / points / matrix elements / batch items (context.max)
future_departure_not_supported400/v1/eta departure not "now" (± 5 min)
observation_in_future400Vote / report observed_at > 2 min in the future
unauthenticated401No credentials
key_invalid401Unknown or malformed API key
key_revoked401Key revoked or expired
token_invalid401Bad tile token / bearer signature, audience or issuer
token_expired401Tile token or bearer token expired — refresh
budget_exhausted402Hard budget cap reached for a product with no degraded answer
scope_denied403Key lacks the scope, or the plan does not include the product
key_restriction_failed403Origin / package / bundle / egress IP not allowed for this key
forbidden403Role or organization membership missing
user_banned403Caller is banned from contributing
mfa_required403Admin API needs a two-factor session
self_moderation_forbidden403Moderators cannot decide their own reports
feature_disabled403Feature switched off (e.g. jarmaq rewards before their tests pass)
not_found404No such resource, or not visible to the caller
idempotency_key_reused409Same Idempotency-Key with a different request body
version_conflict409expected_version / base_version is stale; see current_version
invalid_state409Not allowed from the current status (e.g. reopen a non-rejected report)
appeal_already_used409The reporter already appealed this submission once
base_version_stale409Place changed since the edit's baseline; a moderator must rebase
later_edits_exist409Revert of an edit that later edits depend on; use compensate
already_claimed409Another moderator holds the claim (context.claimed_by, context.claimed_until)
last_owner409Would leave the organization without an owner
already_member409Invitation for an organization the caller already belongs to
deletion_pending409A deletion request is already in progress
place_removed410Place was reverted or hidden
session_expired410Map session idle for more than 30 minutes — start a new one
invitation_expired410Invitation used, revoked or expired
payload_too_large413Upload or body too large
unsupported_media_type415Upload type not accepted
outside_coverage422Coordinates outside the served area (Kazakhstan)
no_route422No route between the waypoints for this costing
no_evidence422No evidence-backed point for the request (e.g. pickup points for an unknown building)
unresolvable_waypoint422A place_id / entrance_id waypoint is unknown or cannot be routed to; errors[].pointer names it
target_not_editable422A place edit targets an object outside our crowdsourced layer (OSM)
too_far_from_report422Voter more than 1 km from the event
event_type_disabled422Event type not enabled (e.g. police awaiting legal approval)
upgrade_required426/v1/stream called without a WebSocket upgrade
rate_limited429Per-key or per-user rate limit; see Retry-After
quota_exceeded429Monthly plan quota of a product used up on a reject plan (free); Retry-After until the next Asia/Almaty month
internal_error500Unexpected error; quote request_id
routing_unavailable503Routing engine down; see Retry-After
routing_busy503Routing engine overloaded right now (request not computed, not metered); retry after Retry-After
search_unavailable503Search index down
budget_unavailable503Budget service down — paid calls refused by default
traffic_unavailable503Traffic proxy's cache / coalescing store down — upstream calls refused (uncoalesced fetches would burn the budget)
auth_unavailable503Sign-in keys (Atasuai JWKS) cannot be fetched and none are cached, or sign-in is not configured — retry, do not sign the user out. On the tile and traffic edges: the key revocation list is stale (overlay, reports, traffic tiles; never basemap)
db_unavailable503Database (or the map-session / rate-limit store) unreachable
tiles_unavailable503Tile edge cannot reach the tile server (Martin)