Documentation menu
POST/v1/jobs/territory
Access and price
| Auth | An API key, as Authorization: Bearer snk_… or ?api_key=snk_…. Metered. Needs a full key; a browser (maps) key is refused. |
|---|---|
| Price | 1 call per request. Class: standard, or premium for truck and ADR work. Published as unit_rules.default in /pricing.json. |
| Premium | When the body asks for truck routing: "costing": "truck", a top-level adr object or "hazmat": true |
What it does
Submit a custom-region cut to the asynchronous lane.
An API key, as Authorization: Bearer snk_… or ?api_key=snk_…. Metered. Price: 1 call per request.
Call it
curl -fsS -X POST "https://api.mapmap.ai/v1/jobs/territory" \
-H "Authorization: Bearer $MAPMAP_KEY" \
-H "Content-Type: application/json" \
-d '{"bbox":[0],"boundary_id":"string","layers":["string"],"polygon":{},"source":"string","webhook_url":"string"}'Request body
application/json · TerritoryJobRequest
Exactly one of a bbox ([west, south, east, north]), a GeoJSON polygon and a boundary_id (from GET /v1/boundaries; its stored polygon is the area, limited and priced exactly as that polygon), optional layers (any of valhalla-tiles, pmtiles, geocode-index, style; default all), optional source territory and webhook_url. The area is cut out of ONE published country package, at most SN_REGION_MAX_AREA_KM2 (5,000 km² by default), with a bounding box of at most SN_REGION_MAX_BBOX_KM2 (15,000 km² by default), and SN_REGION_MAX_MIB installed (2,048 MiB by default). New cuts run one at a time, in order (SN_REGION_MAX_CONCURRENT_CUTS, default 1): a job waiting its turn stays queued and never fails for waiting, and a repeat of an area already cut answers at once. The result is a signed territory (region-… id, versioned by the source package version) a device installs from index_url like any other; its layer downloads count against the download allowance exactly as a country download does. A repeat request for an area already cut from the current source version costs nothing
| Field | Type | Required | Description |
|---|---|---|---|
| bbox | number[] | no | [west, south, east, north] in WGS84 degrees. Exactly one of
bbox, polygon and boundary_id. |
| boundary_id | string | no | An administrative boundary from GET /v1/boundaries, e.g.
osm-r51827: its stored polygon (the one GET
/v1/boundaries/{id} returns) is the area, limited and priced
exactly as that polygon would be. |
| layers | string[] | no | Layer kinds to carry: any of valhalla-tiles, pmtiles,
geocode-index, style (default: all four). style needs
pmtiles. |
| polygon | object | no | A GeoJSON Polygon or MultiPolygon (or a Feature wrapping one). |
| source | string | no | Territory to cut from, e.g. uk. Default: among the published
territories whose bounding box contains the area, the one whose
data covers it (the share of the area inside the extract the
package was built from); for a boundary_id, a package of the
boundary's own country first. The result's source_choice says
which and why. A named source with no data in the area is refused
(region-no-data). |
| webhook_url | string | no | Signed completion notification target (the ordinary job lane field). |
Example: A request assembled from this schema's own field examples, enums, defaults and types; not a recorded call
{
"bbox": [
0
],
"boundary_id": "string",
"layers": [
"string"
],
"polygon": {},
"source": "string",
"webhook_url": "string"
}Responses
result_url| Field | Type | Required | Description |
|---|---|---|---|
| id | string | yes | The job id to poll. |
| kind | string | yes | optimise, replan, matrix or coverage. |
| result_url | string | yes | Where to fetch it. The same URL the webhook will carry. |
| status | string | yes | Always queued, the worker has not looked at it yet. |
| units_charged | integer | yes | Quota units this submission drew. Charged now, refunded in full if the job fails. |
Example: A response assembled from this schema's own field examples, enums, defaults and types; not a recorded call
{
"id": "string",
"kind": "string",
"result_url": "string",
"status": "string",
"units_charged": 0
}webhook_urlapplication/problem+json · Problem
unauthorized); the body carries signup, docs and a one-call hint for a free keyapplication/problem+json · Problem
X-PAYMENT). Not problem+jsonapplication/json · X402PaymentRequired
scope-insufficient), a request from an origin the key does not allow (origin-not-allowed), or an account restriction (forbidden)application/problem+json · Problem
webhook_url was given but the key has no webhook signing secretapplication/problem+json · Problem
text/plain
region-area-too-large (over SN_REGION_MAX_AREA_KM2, with limit and value), region-bbox-too-large (the area's bounding box is over SN_REGION_MAX_BBOX_KM2, with limit and value: the box drives the cut's memory, so split the area), region-crosses-territories (not inside one published territory; the detail names the territories it touches), region-not-covered, region-unknown-source, region-unknown-boundary (no such boundary_id here) or region-no-dataapplication/problem+json · Problem
rate-limited, with Retry-After), or monthly quota exhausted with no payment path (quota-exceeded)application/problem+json · Problem
boundary_id on a deployment without boundaries data (SN_BOUNDARIES_DIR unset)application/problem+json · Problem
application/problem+json · Problem
request-timeout)application/problem+json · Problem
Error bodies follow the shared problem model documented on API conventions.
Also under Offline territories
Generated from https://api.mapmap.ai/openapi.json on 2026-11-12 · operationId post_territory_job