Documentation menu
POST/v1/cluster
API key required, sent as Authorization: Bearer snk_… or ?api_key=snk_….
Call it
curl -fsS -X POST "https://api.mapmap.ai/v1/cluster" \
-H "Authorization: Bearer $MAPMAP_KEY" \
-H "Content-Type: application/json" \
-d @request.jsonRequest body
application/json
locations ([{id, lat, lon, load?}], ids unique, at most 5,000), plus EXACTLY ONE of clusters (how many groups to produce, balanced by stop count) or max_cluster_size ({"locations": n} or {"load": x}, a per-cluster ceiling from which the count is derived). Optional territories ([{id, polygon}], GeoJSON [lon, lat] rings, same shape as on POST /optimise) keeps clusters from straddling a round: each territory is clustered on its own, and so are the stops inside none of them. Optional seed (default 42) drives the k-means++ seeding; the same request with the same seed always returns the same clusters
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
clusters[] with id, member locations (your ids), count, summed load, centroid and the territory each belongs to; parameters echoing the seed, the cluster count, the iterations run and whether it converged; balance naming the constraint applied and whether it had to be relaxed; and a basis stating that this is straight-line clustering, with the pointer to POST /optimise for road-network orderlocations x clusters assignment larger than 500,000Error 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_cluster