Skip to content

50,000 free calls a month, card-free. Get an API key →

Documentation menu
docs / api / post-optimise-replan
routing

POST/optimise/replan

API key required, sent as Authorization: Bearer snk_… or ?api_key=snk_….

Call it

bash
curl -fsS -X POST "https://api.mapmap.ai/optimise/replan" \
  -H "Authorization: Bearer $MAPMAP_KEY" \
  -H "Content-Type: application/json" \
  -d @request.json

Request body

application/json

The ORIGINAL POST /optimise body: vehicles, jobs, shipments, costing, costing_options, adr, emissions, avoid_zones, eu_drivers_hours, plus two re-planning fields. progress: an array of {vehicle, completed_stop_ids[], current_position{lat,lon}, unavailable}, one entry per vehicle that has done something. changes: {cancel_job_ids[], add_jobs[], add_shipments[]} in exactly the /optimise task shapes. Both are optional, but at least one progress entry or one change is required. Completed stops are LOCKED: they are removed from the problem and the reporting vehicle re-plans from current_position (or its last completed stop), so no solver can reschedule them. relax_if_unassigned applies to the REMAINING problem, exactly as on /optimise. Per-vehicle reloads (multi-trip) is NOT supported here and is refused with a 400: a completion in progress does not say which trip it belongs to. Nothing is stored: MapMap keeps no dispatch state, so every re-plan carries the whole day

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

200The re-planned day: exactly the POST /optimise response: summary, unassigned, routes[] and any zones block, covering the REMAINING work, plus a replan block: locked_stops_per_vehicle (the prefix held per vehicle, in order, with the start it re-planned from), released_stops, changes_applied and notes naming every instruction that could not be carried out as asked, plus a relaxation block when relax_if_unassigned was given
400Neither progress nor changes; an unknown or duplicated vehicle; a stop two vehicles both claim; an added task whose id is already taken; a vehicle declaring reloads (re-planning a multi-trip problem is not supported); or the underlying problem was invalid
401Missing or invalid API key
422More than 200 unique locations in the REMAINING problem, or a problem spread wider than the routing engine's max_matrix_distance
429Quota or rate limit exceeded
502The VROOM solver is unreachable or failed
503Optimisation is not enabled on this deployment (SN_VROOM_URL unset)

Error 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_replan