---
title: "Submit a mid-shift re-plan to the asynchronous lane."
method: POST
path: "/v1/jobs/replan"
tags: ["routing"]
---

# Submit a mid-shift re-plan to the asynchronous lane.

`POST /v1/jobs/replan`

## Request

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

## Request body

- object

## Response `202`

Accepted and queued. Poll `result_url`, or wait for the signed webhook

- JobAcceptedResponse: The 202 answer to a submission.
  - `id` string, required: The job id to poll.
  - `kind` string, required: `optimise`, `replan` or `matrix`.
  - `result_url` string, required: Where to fetch it. The same URL the webhook will carry.
  - `status` string, required: Always `queued`, the worker has not looked at it yet.
  - `units_charged` integer, required: Quota units this submission drew. Charged now, refunded in full if the job fails.

## Other responses

- `400`: Invalid problem, no progress and no changes, or an unusable `webhook_url`
- `401`: Missing or invalid API key
- `409`: A `webhook_url` was given but the key has no webhook signing secret
- `422`: The REMAINING problem has more than `SN_OPTIMISE_MAX_LOCATIONS_ASYNC` unique locations
- `429`: Quota, rate limit, or too many jobs already queued or running
- `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)
