Documentation menu
POST/matrix
API key required, sent as Authorization: Bearer snk_… or ?api_key=snk_….
Call it
curl -fsS -X POST "https://api.mapmap.ai/matrix" \
-H "Authorization: Bearer $MAPMAP_KEY" \
-H "Content-Type: application/json" \
-d @request.jsonRequest body
application/json
Valhalla matrix request JSON: sources, targets, costing, optional units and costing_options. Scenario analysis: optional exclude_polygons; areas whose intersecting roads are avoided, as a JSON array of rings of [lon, lat] pairs (note the lon-first order), e.g. [[[-0.1,51.5],[-0.11,51.5],[-0.11,51.52]]], and exclude_locations, {lat, lon} objects each mapped to its nearest road(s), which are then excluded, so "close this bridge and recompute the matrix" is one request. Valhalla engine only: a GraphHopper-backed deployment ignores both fields
The OpenAPI document declares this body as a free-form JSON object with no field list, so there is nothing here to generate a table from. The prose above is what the gateway states about it; the raw document is the authority.
Responses
{durations, distances}: row-major seconds and metres, null when unreachablemax_matrix_distance (SN_ENGINE_MAX_MATRIX_DISTANCE_M; 400 km by default, 1,500 km on the hosted gateway; not chunkable around). The span refusal names the offending pair as furthest_pair: {source_index, target_index} and carries max_span_km, span_km, limit_env, engine_setting and self_host_docsError bodies follow the shared problem model documented on API conventions.
Also under routing
Generated from https://api.mapmap.ai/openapi.json on 2026-09-17 · operationId post_matrix