Skip to content
Documentation menu
docs / api / post-v1-incidents-along
Routing

POST/v1/incidents/along

Access and price

AuthAn API key, as Authorization: Bearer snk_… or ?api_key=snk_…. Metered. Needs a full key; a browser (maps) key is refused.
Price1 call per request. Class: standard, or premium for truck and ADR work. Published as unit_rules.default in /pricing.json.
PremiumWhen the body asks for truck routing: "costing": "truck", a top-level adr object or "hazmat": true

What it does

Traffic incidents and closures along a route shape.

An API key, as Authorization: Bearer snk_… or ?api_key=snk_…. Metered. Price: 1 call per request.

Call it

bash
curl -fsS -X POST "https://api.mapmap.ai/v1/incidents/along" \
  -H "Authorization: Bearer $MAPMAP_KEY" \
  -H "Content-Type: application/json" \
  -d '{"shape":"string"}'

Request body

application/json · IncidentsAlongRequest

Route shape as polyline6 plus an optional corridor buffer (buffer_m, default 60 m, max 500 m)

FieldTypeRequiredDescription
buffer_mnumbernoCorridor half-width in metres; default 60, clamped to at most 500.
shapestringyesThe route shape as a polyline6 string.

Example: A request assembled from this schema's own field examples, enums, defaults and types; not a recorded call

json
{
  "shape": "string"
}

Responses

200Incidents along the route (arc-ordered) and every configured source's coverage metadata. Rows from drivers' traffic reports (source_kind: "driver", source: "mapmap-drivers") appear only once two distinct drivers report the same thing nearby in the same direction, only for a route travelling that direction, always with severity: "other" and never with a delay; they add driver_kind, reports, reported_at and expires_at
FieldTypeRequiredDescription
attributionstring[]noAttribution notices for the sources actually configured, to display verbatim.
incidentsIncidentAlong[]yesIncidents within the corridor, arc_m ascending.
sourcesIncidentSourceMetaOut[]yesEvery configured source's coverage metadata, present even when incidents is empty.

Example: A response assembled from this schema's own field examples, enums, defaults and types; not a recorded call

json
{
  "incidents": [
    {
      "arc_m": 0,
      "cause": "string",
      "from_arc_m": 0,
      "id": "string",
      "offset_m": 0,
      "planned": false,
      "probable": false,
      "severity": "string",
      "side": "string",
      "source": "string",
      "source_kind": "string",
      "status": "string",
      "to_arc_m": 0
    }
  ],
  "sources": [
    {
      "coverage_note": "string",
      "licence": "string",
      "network": "string",
      "source_id": "string"
    }
  ]
}
400Invalid request

application/problem+json · Problem

401Missing or invalid API key. Also: No key, or a missing, malformed, unknown, revoked or expired one (unauthorized); the body carries signup, docs and a one-call hint for a free key

application/problem+json · Problem

402Beyond the included volume with no way to pay this call: an x402 body naming how to pay (provisional key past its allowance, prepaid balance below the price, or a rejected X-PAYMENT). Not problem+json

application/json · X402PaymentRequired

403The key may not call this: a browser key outside its scope (scope-insufficient), a request from an origin the key does not allow (origin-not-allowed), or an account restriction (forbidden)

application/problem+json · Problem

413The request declares a body larger than 1048576 bytes (plain text, not problem+json)

text/plain

429Quota or rate limit exceeded. Also: Per-key rate limit (rate-limited, with Retry-After), or monthly quota exhausted with no payment path (quota-exceeded)

application/problem+json · Problem

501Incident data is not enabled (SN_INCIDENTS_DIR unset)

application/problem+json · Problem

504The request did not finish within the gateway's request deadline (request-timeout)

application/problem+json · Problem

Error bodies follow the shared problem model documented on API conventions.

Also under Routing

Generated from https://api.mapmap.ai/openapi.json on 2026-11-12 · operationId post_incidents_along