---
title: "Delete Plan by ID"
method: DELETE
path: "/plans/{id}"
tags: ["Plans"]
---

# Delete Plan by ID

`DELETE /plans/{id}`

## Request

- Base URL: `https://api.smartroutes.io/v2`
- URL: `https://api.smartroutes.io/v2/plans/{id}`
- Auth: none declared

Permanently delete a plan from your depot, along with every route and stop on it. This includes routes from earlier optimisations of the plan and routes that have already been dispatched. Deleting a dispatched plan is allowed, and there is no undo.

What happens to related data:
- The orders themselves are not deleted.
- Orders on dispatched routes move back to `OPEN` so they can be planned again, and an [`orders.status`](#tag/Webhooks/operation/orders.status) webhook is published for each one. Orders on routes that were never dispatched keep their current status.
- Scheduled customer notifications for the removed stops are cancelled, and the SMS credit reserved for them is refunded.
- A [`routes.deleted`](#tag/Webhooks/operation/routes.deleted) webhook is published for each dispatched route removed, and a [`plans.deleted`](#tag/Webhooks/operation/plans.deleted) webhook is published for the plan.

A plan that does not exist, or that belongs to another depot, answers `404 RESOURCE_NOT_FOUND`.

## Path parameters

- `id` number, required

## Response `200`

Successful response

## Other responses

- `403`: Forbidden. Returned for rate-limit exhaustion (`name = FORBIDDEN`, with `details.retry_after_seconds` and `Retry-After` header) and permission gate failures (`name = PERMISSION`). Inspect `name` to disambiguate. Send `x-sr-api-features: rate-limit-429` to receive `429 RATE_LIMIT_EXCEEDED` for the rate-limit case instead, leaving `403` to mean permission failures only — see [API Features](#section/Getting-started/API-Features).
- `404`: The requested resource was not found.
- `429`: Rate limit exceeded (`name = RATE_LIMIT_EXCEEDED`). **Only returned to callers that opt in** with the `x-sr-api-features: rate-limit-429` request header; without it the same condition returns `403` with `name = FORBIDDEN` and an otherwise identical body. See [API Features](#section/Getting-started/API-Features).
- `500`: An unexpected server error occurred. The body carries only `name` and `description`: internal details are never returned.

---

[API](https://skmtc.dev/smartroutes/apis/smartroutes-api.md) · [All operations](https://skmtc.dev/smartroutes/apis/smartroutes-api/llms.txt) · [OpenAPI document](https://skmtc.dev/smartroutes/apis/smartroutes-api/revisions/a7ea507afac7?raw)
