Reports & votes
Live road events and "still there / gone" votes.
/v1/reportsДоступноReport a road event
- Хост
https://api.atasumaps.com·createEventReport- Доступ
- API-ключ с областью: contribute + вошедший пользователь (Atasuai)
- Учёт
- Не учитывается
- Idempotency-Key
- Обязателен: один ключ на команду, повтор возвращает первый результат
A nearby same-type,
same-direction live event absorbs the report as an "up" vote (merged: true, 200); otherwise a
new event is created (201). Concurrent first reports of one event create one event. Trusted
users publish directly only where the event policy allows (never road_closed). Retrying with the
same Idempotency-Key returns the first result even if that event has expired since; the same key
with another body is 409 idempotency_key_reused (reports carry no version). details and
accuracy_m are stored with the report for moderators and never published. Event types not
accepted yet (ugc.event_policy.accepting: police, awaiting legal approval) return
422 event_type_disabled and store nothing; a retry of a report accepted before still replays.
status and version describe the report as accepted from the caller; whether and when other users
see it is decided separately (confidence, confirmations, moderation).
Параметры
| Имя | Где | Тип | Обязательно | Описание |
|---|---|---|---|---|
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. |
Тело запроса EventReportCreate
| Имя | Тип | Обязательно | Описание |
|---|---|---|---|
type | EventType | да | police is not accepted until legal approval (422 event_type_disabled). |
lnglat | LngLat | да | WGS84 [longitude, latitude] — always this order. |
heading_deg | integer | Direction of travel; used for dedupe | |
accuracy_m | number | ||
observation_id | string (uuid) | да | Client observation ID; used as the vote's observation when merged |
device_id | string (uuid) | From registerDevice | |
details | object |
Ответы
| Статус | Описание | Тип |
|---|---|---|
200 | Merged into an existing event as a confirmation | EventReportResult |
201 | New event created | EventReportResult |
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 |
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 |
422 | Understood but cannot be done (outside_coverage, no_route, unresolvable_waypoint, too_far_from_report, event_type_disabled, no_evidence, target_not_editable) | 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 |
/v1/reports/{report_id}/votesДоступноVote "still there" / "gone" on an event
- Хост
https://api.atasumaps.com·voteOnReport- Доступ
- API-ключ с областью: contribute + вошедший пользователь (Atasuai)
- Учёт
- Не учитывается
- Idempotency-Key
- Обязателен: один ключ на команду, повтор возвращает первый результат
Each observation is archived once
per observation_id; a retry with the same Idempotency-Key is a no-op, the same key with another
body is 409 idempotency_key_reused (votes carry no version). Votes never extend an event's
lifetime when they are zero-weight (shadow-banned voters), replayed, flipped within 10 minutes,
older than the event's half-life (max 30 min — archived only), or on one's own report; a banned
user gets 403 user_banned; observed_at more than 2 minutes in the future →
400 observation_in_future; more than 1 km away → 422 too_far_from_report; an unknown report →
404. The response does not reveal whether the vote counted: an expired, hidden or own event is
answered 204 like any other.
Параметры
| Имя | Где | Тип | Обязательно | Описание |
|---|---|---|---|---|
report_id | path | string (uuid) | да | |
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. |
Тело запроса VoteCreate
| Имя | Тип | Обязательно | Описание |
|---|---|---|---|
vote | "up" | "down" | да | up = still there 👍, down = gone 👎 |
lnglat | LngLat | да | WGS84 [longitude, latitude] — always this order. |
observed_at | string (date-time) | да | |
observation_id | string (uuid) | да |
Ответы
| Статус | Описание | Тип |
|---|---|---|
204 | Observation recorded (or already recorded) | |
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 |
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 |
422 | Understood but cannot be done (outside_coverage, no_route, unresolvable_waypoint, too_far_from_report, event_type_disabled, no_evidence, target_not_editable) | 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 |