> ## Documentation Index
> Fetch the complete documentation index at: https://docs.knoxcall.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Cancel Migration

> Cancel an in-flight migration, flipping its status to cancelled.

## POST /admin/migrations/:id/cancel

Cancel an in-flight migration. Only valid for migrations in `pending`, `discovering`, or `awaiting_review` status.

**Auth**: `requireOwnerOrAdmin`

<Warning>
  Cancellation flips the migration's `status` to `cancelled` (setting `completed_at`) and records a `migration.cancel` critical audit entry. It does **not** automatically tear down the discovery lease or any provisioned DB proxy routes — remove those separately via the `DELETE /admin/migrations/:id/db-proxy-routes/:routeId` endpoint.
</Warning>

### Response

```json theme={"dark"}
{ "id": "...", "status": "cancelled" }
```

Returns `404` if the migration is not found or its status is anything other than `pending`, `discovering`, or `awaiting_review` (for example `committing`, `failed`, `completed`, or already `cancelled`).

```bash theme={"dark"}
curl -X POST https://api.knoxcall.com/admin/migrations/550e8400.../cancel \
  -H "Authorization: Bearer $KC_ADMIN_JWT"
```
