Documentation menu
POST/centroid
API key required, sent as Authorization: Bearer snk_… or ?api_key=snk_….
Call it
curl -fsS -X POST "https://api.mapmap.ai/centroid" \
-H "Authorization: Bearer $MAPMAP_KEY" \
-H "Content-Type: application/json" \
-d @request.jsonRequest body
application/json
Valhalla centroid request JSON: the same shape as POST /route; locations (at least two), costing, optional costing_options. "Meet in the middle": finds the point in the road graph where paths from every location converge for the least total cost, and returns one path per location to that shared point. Not available from Google, Mapbox, HERE, TomTom or NextBillion
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
trip is the path from locations[0] to the centroid, and each alternates[i] is the path from locations[i+1] to the SAME centroid; every path's last location shares an identical lat/lon, which is the meeting point. costing (e.g. truck) applies identically to every participant's pathError 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_centroid