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

# Cancel Migration

> Cancel a migration run.

# Cancel Migration

Cancels queued/pre-execution runs immediately. Running imports move to `cancel_requested` while workers stop linked subscriber import chunks, then finish as `canceled`.

## Request

<ParamField path="runId" type="string" required>
  Migration run ID.
</ParamField>

```bash theme={null}
curl -X POST "https://api.sequenzy.com/api/v1/migrations/run_123/cancel" \
  -H "Authorization: Bearer SEQUENZY_API_KEY"
```

## Responses

<ResponseExample>
  ```json 200 theme={null}
  {"success":true,"data":{"id":"run_123","status":"canceled"}}
  ```

  ```json 200 theme={null}
  {"success":true,"data":{"id":"run_123","status":"cancel_requested"}}
  ```

  ```json 401 theme={null}
  {"error":"Invalid API key"}
  ```

  ```json 403 theme={null}
  {"error":"Access denied to the migration run"}
  ```

  ```json 404 theme={null}
  {"error":"Migration run not found"}
  ```
</ResponseExample>
