Map sessions & styles
Map session, tile token and style JSON. Tile token format is in the `TileToken` security scheme.
← Все операции
POST/v1/map-sessionsДоступно
- Хост
https://api.atasumaps.com · createMapSession- Доступ
- API-ключ с областью: basemap
- Учёт
- map_session (за session)
- Idempotency-Key
- Обязателен: один ключ на команду, повтор возвращает первый результат
Called by the SDK before the map is created. Creates a server-generated session_id
(ends after 30 minutes without a token refresh or style request) and a 1-hour tile token whose
scp is the intersection of the key's effective scopes (key ∩ plan) and the tile products
(basemap, overlay, traffic). A free key's token never carries traffic. Counted as one map
session; style requests and token refreshes in the same session are not counted again.
The SDK refreshes the token at refresh_after (20 minutes after issue) while the map is in use,
which also keeps the session alive; a map left alone for 30 minutes ends its session and the next
refresh answers 410 session_expired. The token carries the session id (sid).
A replay with the same Idempotency-Key from the same key returns the same session (not counted
again) with a freshly minted token. Key restrictions (Origin / package / egress IP) apply.
Параметры
| Имя | Где | Тип | Обязательно | Описание |
|---|
Idempotency-Key | header | string | да | Client-generated unique key per logical command (UUID v4/v7 recommended). Scope: caller + endpoint + key. Same key + same body → first result (Idempotent-Replayed: true); same key + different body → 409 idempotency_key_reused. Missing → 400 idempotency_key_required. Keys are kept at least 24 hours. |
Тело запроса MapSessionCreate
| Имя | Тип | Обязательно | Описание |
|---|
style | StyleId | | |
platform | "web" | "android" | "ios" | "flutter" | "react-native" | | |
sdk_version | string | | |
Ответы
| Статус | Описание | Тип |
|---|
201 | Session started | MapSession |
400 | Invalid request (invalid_request, idempotency_key_required, limit_exceeded, future_departure_not_supported, observation_in_future) | Problem |
401 | Missing or invalid credentials (unauthenticated, key_invalid, key_revoked, token_expired, token_invalid) | Problem |
402 | A budget cap is reached and no degraded answer exists (budget_exhausted; context.level is organization or product, context.product the product) | Problem |
403 | Authenticated but not allowed (scope_denied, key_restriction_failed, forbidden, user_banned, mfa_required, self_moderation_forbidden, feature_disabled) | Problem |
409 | Conflict — never a silent overwrite. Codes: idempotency_key_reused (same key, different body), version_conflict (stale expected_version; body has current_version), invalid_state (transition not allowed from the current status), appeal_already_used, base_version_stale (place changed since the edit's baseline; rebase first), later_edits_exist (revert needs compensation), already_claimed, last_owner, already_member, deletion_pending. A retry with the original Idempotency-Key still returns the original result, never a 409. | Problem |
429 | Rate limit (rate_limited) or monthly plan quota (quota_exceeded: reject plans only; Retry-After = seconds until the next Asia/Almaty month; context = product, included, used, period_end) | Problem |
503 | Dependency down (routing_unavailable, search_unavailable, budget_unavailable, traffic_unavailable, auth_unavailable, db_unavailable, tiles_unavailable) | Problem |
POST/v1/map-sessions/{session_id}/tokensДоступно
- Хост
https://api.atasumaps.com · refreshTileToken- Доступ
- API-ключ с областью: basemap
- Учёт
- Не учитывается
- Idempotency-Key
- Обязателен: один ключ на команду, повтор возвращает первый результат
The SDK calls this at refresh_after (and before expires_at). Keeps the session alive.
Returns 410 session_expired after 30 minutes of inactivity (or for an unknown session id); the SDK
then starts a new session. A session belongs to the API key that created it: any other key gets
404. Tokens are signed with the current kid; old tokens stay valid until their own exp
unless the key is revoked or its scopes / restrictions change (the tile edge then answers
401 key_revoked / 401 token_expired within 1 minute). A refresh changes nothing but the
session's last activity, so a replay with the same Idempotency-Key simply mints another token.
Параметры
| Имя | Где | Тип | Обязательно | Описание |
|---|
session_id | path | string | да | |
Idempotency-Key | header | string | да | Client-generated unique key per logical command (UUID v4/v7 recommended). Scope: caller + endpoint + key. Same key + same body → first result (Idempotent-Replayed: true); same key + different body → 409 idempotency_key_reused. Missing → 400 idempotency_key_required. Keys are kept at least 24 hours. |
Ответы
| Статус | Описание | Тип |
|---|
200 | New token | TileTokenGrant |
401 | Missing or invalid credentials (unauthenticated, key_invalid, key_revoked, token_expired, token_invalid) | Problem |
403 | Authenticated but not allowed (scope_denied, key_restriction_failed, forbidden, user_banned, mfa_required, self_moderation_forbidden, feature_disabled) | Problem |
404 | No such resource, or not visible to the caller (not_found) | Problem |
409 | Conflict — never a silent overwrite. Codes: idempotency_key_reused (same key, different body), version_conflict (stale expected_version; body has current_version), invalid_state (transition not allowed from the current status), appeal_already_used, base_version_stale (place changed since the edit's baseline; rebase first), later_edits_exist (revert needs compensation), already_claimed, last_owner, already_member, deletion_pending. A retry with the original Idempotency-Key still returns the original result, never a 409. | Problem |
410 | No longer available (place_removed, session_expired, invitation_expired) | Problem |
429 | Rate limit (rate_limited) or monthly plan quota (quota_exceeded: reject plans only; Retry-After = seconds until the next Asia/Almaty month; context = product, included, used, period_end) | Problem |
503 | Dependency down (routing_unavailable, search_unavailable, budget_unavailable, traffic_unavailable, auth_unavailable, db_unavailable, tiles_unavailable) | Problem |
GET/v1/styles/{style_id}.jsonДоступно
- Хост
https://api.atasumaps.com · getStyle- Доступ
- API-ключ с областью: basemap
- Учёт
- Не учитывается
P2's generated style. Language and theme are root-level state (lang, theme) switched on the
client without reloading, so they are not parameters here. Tile URLs inside the style
carry no token: the Web SDK adds t= in transformRequest, native SDKs add X-Atasu-Token only
for exact atasumaps.com hosts. The key may be passed as ?key= because MapLibre fetches the
style itself (web keys are public and origin-restricted).
Served from the built P2 styles (standard; standard-3d and navigation answer 404 until they
are built). session must be a live session of the same key (410 session_expired otherwise); the
request counts as activity in that session.
Параметры
| Имя | Где | Тип | Обязательно | Описание |
|---|
style_id | path | StyleId | да | |
session | query | string | да | session_id from createMapSession. The style request counts within that session, not as a new one. |
Ответы
| Статус | Описание | Тип |
|---|
200 | Style document (MapLibre style spec v8) | StyleDocument |
400 | Invalid request (invalid_request, idempotency_key_required, limit_exceeded, future_departure_not_supported, observation_in_future) | Problem |
401 | Missing or invalid credentials (unauthenticated, key_invalid, key_revoked, token_expired, token_invalid) | Problem |
403 | Authenticated but not allowed (scope_denied, key_restriction_failed, forbidden, user_banned, mfa_required, self_moderation_forbidden, feature_disabled) | Problem |
404 | No such resource, or not visible to the caller (not_found) | Problem |
410 | No longer available (place_removed, session_expired, invitation_expired) | Problem |
429 | Rate limit (rate_limited) or monthly plan quota (quota_exceeded: reject plans only; Retry-After = seconds until the next Asia/Almaty month; context = product, included, used, period_end) | Problem |
503 | Dependency down (routing_unavailable, search_unavailable, budget_unavailable, traffic_unavailable, auth_unavailable, db_unavailable, tiles_unavailable) | Problem |