---
title: "Re-plan a fleet mid-shift (see module docs). `/optimize/replan` is an alias."
method: POST
path: "/optimise/replan"
tags: ["routing"]
---

# Re-plan a fleet mid-shift (see module docs). \`/optimize/replan\` is an alias.

`POST /optimise/replan`

## Request

- Base URL: `https://api.mapmap.ai`
- URL: `https://api.mapmap.ai/optimise/replan`
- Auth: one of:
  - HTTP bearer
  - API key in query parameter `api_key`

## Request body

- object

## Response `200`

The 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

- object

## Other responses

- `400`: Neither 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
- `401`: Missing or invalid API key
- `422`: More than 200 unique locations in the REMAINING problem, or a problem spread wider than the routing engine's `max_matrix_distance`
- `429`: Quota or rate limit exceeded
- `502`: The VROOM solver is unreachable or failed
- `503`: Optimisation is not enabled on this deployment (SN_VROOM_URL unset)

---

[API](https://skmtc.dev/mapmap/apis/sn-gateway.md) · [All operations](https://skmtc.dev/mapmap/apis/sn-gateway/llms.txt) · [OpenAPI document](https://skmtc.dev/mapmap/apis/sn-gateway/revisions/2293be8b4c38?raw)
