Skip to main content

POST /admin/migrations/:id/cancel

Cancel an in-flight migration. Only valid for migrations in pending, discovering, or awaiting_review status. Auth: requireOwnerOrAdmin
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.

Response

{ "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).
curl -X POST https://api.knoxcall.com/admin/migrations/550e8400.../cancel \
  -H "Authorization: Bearer $KC_ADMIN_JWT"