---
title: "Matrix endpoint (see module docs)."
method: POST
path: "/matrix"
tags: ["routing"]
---

# Matrix endpoint (see module docs).

`POST /matrix`

## Request

- Base URL: `https://api.mapmap.ai`
- URL: `https://api.mapmap.ai/matrix`
- Auth: one of:
  - HTTP bearer
  - API key in query parameter `api_key`

## Request body

- object

## Response `200`

`{durations, distances}`: row-major seconds and metres, null when unreachable. Car (`auto`) durations on local roads in Great Britain include typical junction and congestion delay, as on `POST /route`; then an `eta_calibration` block names the method, the period, the cell counts and the engine's own `engine_durations`

- object

## Other responses

- `400`: Invalid request
- `401`: Missing or invalid API key
- `422`: More than 10,000 source×target elements, or a source/target pair further apart than the deployment's configured `max_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_docs`
- `429`: Quota or rate limit exceeded
- `502`: Upstream routing engine failed

---

[API](https://skmtc.dev/mapmap/apis/sn-gateway.md) · [All operations](https://skmtc.dev/mapmap/apis/sn-gateway/llms.txt) · [OpenAPI document](https://skmtc.dev/mapmap/apis/sn-gateway/revisions/2293be8b4c38?raw)
