Skip to content
Documentation menu
docs / api / post-v1-coverage-guidance
Optimisation and jobs

POST/v1/coverage/guidance

Access and price

AuthAn API key, as Authorization: Bearer snk_… or ?api_key=snk_…. Metered. Needs a full key; a browser (maps) key is refused.
Price1 call per started block of 50 shape points walked (every piece's points, each join counted once), and never less than 1 call per piece, at most 400 pieces. A refused piece keeps its quota units and takes no credit, as a /trace_route engine refusal does; a walk past the route's own deadline is not billed. Class: standard, or premium for truck and ADR work. Published as unit_rules.coverage_guidance in /pricing.json.
PremiumWhen the plan guided is a truck plan (its pieces carry "costing": "truck")

What it does

Turn-by-turn guidance for one drive of a coverage plan.

An API key, as Authorization: Bearer snk_… or ?api_key=snk_…. Metered. Price: 1 call per started block of 50 shape points walked (every piece's points, each join counted once), and never less than 1 call per piece, at most 400 pieces. A refused piece keeps its quota units and takes no credit, as a /trace_route engine refusal does; a walk past the route's own deadline is not billed.

Call it

bash
curl -fsS -X POST "https://api.mapmap.ai/v1/coverage/guidance" \
  -H "Authorization: Bearer $MAPMAP_KEY" \
  -H "Content-Type: application/json" \
  -d '{"chunk":{},"chunk_id":0,"drive":"outing","job_id":"string"}'

Request body

application/json · CoverageGuidanceRequest

The drive to guide: job_id (your own succeeded POST /v1/jobs/coverage job) with chunk_id (an outing's id), or chunk (an outing or transfer object exactly as the job returned it); drive is outing (the default), transfer (the outing's transfer_from_previous) or transfer_to_start. Every piece of the drive's trace_route_parts is walked with shape_match: edge_walk, never map matching. Metered as one call: one call per started 50 shape points walked (the pieces' points, each join counted once), and never less than one call per piece; premium for a truck plan. The pieces must be one drive, each starting where the one before ends

FieldTypeRequiredDescription
chunkobjectnoInstead of job_id: the object exactly as the job returned it. An outing (result.chunks[i]), whose transfer_from_previous is used with drive: transfer; or a transfer object itself (transfer_from_previous, transfer_to_start). Only its trace_route_parts are read.
chunk_idintegernoThe outing's id in that job's chunks (from 1).
driveCoverageGuidanceDrivenoouting (the default), transfer or transfer_to_start.
job_idstringnoA coverage job's id (POST /v1/jobs/coverage): the caller's own job (any key of the same account), succeeded. With chunk_id, unless drive is transfer_to_start.

Example: A request assembled from this schema's own field examples, enums, defaults and types; not a recorded call

json
{
  "chunk": {},
  "chunk_id": 0,
  "drive": "outing",
  "job_id": "string"
}

Responses

200One trip with one leg per piece, in driving order
FieldTypeRequiredDescription
chunk_idintegernoThe outing's id, when the request named one.
drivestringyesThe drive guided: outing, transfer or transfer_to_start.
job_idstringnoThe job it came from, for a job-id request.
piecesintegeryesPieces walked: the trip has one leg per piece, in driving order.
tripobjectyesThe guidance: a Valhalla trip, as /trace_route answers one, with one leg per piece. Each leg is the engine's own answer for its piece (maneuvers, polyline6 shape, summary); summary is the whole drive's. Legs join exactly where one piece ends and the next begins, mid-street wherever the plan allowed: a leg's closing arrival and the next leg's opening departure there mean carry straight on.

Example: A response assembled from this schema's own field examples, enums, defaults and types; not a recorded call

json
{
  "drive": "string",
  "pieces": 0,
  "trip": {}
}
400No drive named, a drive with no usable trace_route_parts (a plan made before they existed), or a job that is not a succeeded coverage plan

application/problem+json · Problem

401Missing or invalid API key. Also: No key, or a missing, malformed, unknown, revoked or expired one (unauthorized); the body carries signup, docs and a one-call hint for a free key

application/problem+json · Problem

402Beyond the included volume with no way to pay this call: an x402 body naming how to pay (provisional key past its allowance, prepaid balance below the price, or a rejected X-PAYMENT). Not problem+json

application/json · X402PaymentRequired

403The key may not call this: a browser key outside its scope (scope-insufficient), a request from an origin the key does not allow (origin-not-allowed), or an account restriction (forbidden)

application/problem+json · Problem

404No such job for this caller, including one that belongs to somebody else

application/problem+json · Problem

413The request declares a body larger than 1048576 bytes (plain text, not problem+json)

text/plain

422coverage-guidance-refused: the engine's edge walk refused a piece, or answered it with a trip that is not the piece's length; the walk stops there. The body names piece, pieces, where it starts (lat, lon), its km, and engine_error_code and engine_error. Billed as /trace_route bills an engine refusal: the quota units stand, no prepaid credit or x402 payment is taken

application/problem+json · Problem

429Quota or rate limit exceeded. Also: Per-key rate limit (rate-limited, with Retry-After), or monthly quota exhausted with no payment path (quota-exceeded)

application/problem+json · Problem

501The deployment routes with GraphHopper only, which has no edge walk

application/problem+json · Problem

502Upstream routing engine failed

application/problem+json · Problem

504coverage-guidance-timeout: the pieces did not all walk within this route's deadline (the gateway's request deadline less 5 seconds). Not billed. Also: The request did not finish within the gateway's request deadline (request-timeout)

application/problem+json · Problem

Error bodies follow the shared problem model documented on API conventions.

Also under Optimisation and jobs

Generated from https://api.mapmap.ai/openapi.json on 2026-11-06 · operationId post_coverage_guidance