---
title: "Cancel a run"
---

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

# Cancel a run

Path: CloudRaker Paperwork API › Runs

`POST /v1/runs/{id}/cancel`

Stops a run's in-flight work and returns the run in its cancelled state.

- **Files and the TTL are untouched** — the run still purges at `expiresAt`. To delete everything now, use [DELETE /v1/runs/{id}](https://docs.cloudraker.com/paperwork/api/runs/delete-run).
- **Idempotent** — cancelling an already-terminal run changes nothing and returns the current run body.

## Authentication

- `bearerAuth`, http, header `Authorization`

## Path parameters

- `id` (`cancelRun.path.id`; string, required)
  - minLength 1

## Code samples

### cURL

```bash
curl --request POST \
  --url 'https://api.cloudraker.com/v1/runs/<id>/cancel' \
  --header 'Authorization: Bearer <token>'
```

### TypeScript

```typescript
const url = 'https://api.cloudraker.com/v1/runs/<id>/cancel';
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.cloudraker.com/v1/runs/<id>/cancel"

headers = {"Authorization": "Bearer <token>"}

response = requests.post(url, headers=headers)

print(response.text)
```

## Responses

### 200

The run after cancellation.

#### Example

```json
{
  "object": "extract_run",
  "id": "string",
  "status": "queued",
  "expiresAt": "string",
  "statusUrl": "string",
  "files": [
    {
      "id": "string",
      "name": "string",
      "status": "string",
      "error": "string"
    }
  ],
  "file": {
    "id": "string",
    "name": "string",
    "status": "string",
    "error": "string"
  },
  "error": {
    "code": "string",
    "message": "string"
  },
  "metadata": {
    "property1": null,
    "property2": null
  },
  "config": {
    "schema": {
      "property1": null,
      "property2": null
    },
    "revision": 1,
    "overridden": true
  },
  "output": {
    "value": null,
    "citations": {
      "property1": [
        {
          "fileId": "string",
          "page": 0,
          "bbox": {
            "x": 0,
            "y": 0,
            "width": 0,
            "height": 0
          },
          "timecodeStart": 0,
          "timecodeEnd": 0,
          "timecode": 0,
          "text": "string",
          "confidence": 0,
          "uncited": true,
          "notFound": true
        }
      ],
      "property2": [
        {
          "fileId": "string",
          "page": 0,
          "bbox": {
            "x": 0,
            "y": 0,
            "width": 0,
            "height": 0
          },
          "timecodeStart": 0,
          "timecodeEnd": 0,
          "timecode": 0,
          "text": "string",
          "confidence": 0,
          "uncited": true,
          "notFound": true
        }
      ]
    },
    "citationsOmitted": true,
    "markdownUrl": "string",
    "jsonUrl": "string",
    "markdown": "string",
    "json": null,
    "documents": [
      {
        "fileId": "string",
        "name": "string",
        "status": "string",
        "error": "string",
        "value": null,
        "citations": {
          "property1": [
            {
              "fileId": "string",
              "page": 0,
              "bbox": {},
              "timecodeStart": 0,
              "timecodeEnd": 0,
              "timecode": 0,
              "text": "string",
              "confidence": 0,
              "uncited": true,
              "notFound": true
            }
          ],
          "property2": [
            {
              "fileId": "string",
              "page": 0,
              "bbox": {},
              "timecodeStart": 0,
              "timecodeEnd": 0,
              "timecode": 0,
              "text": "string",
              "confidence": 0,
              "uncited": true,
              "notFound": true
            }
          ]
        },
        "markdownUrl": "string",
        "jsonUrl": "string",
        "markdown": "string",
        "json": null
      }
    ]
  }
}
```

Any of:

- `V1ExtractRun`
- `V1ParseRun`
- `V1RedactRun`
- `V1FillRun`
- `V1SignRun`
- `V1PipelineRun`

### 400

Validation Error

#### Example

```json
{
  "success": false,
  "error": [
    null
  ],
  "data": null
}
```

- `success` (`cancelRun.response.400.success`; boolean, required)
  - one of `false`
- `error` (`cancelRun.response.400.error`; array<unknown>, required)
- `data` (`cancelRun.response.400.data`; unknown, required)

### 404

Unknown run id.

### 410

The run expired.

### 429

Rate limited. The `/v1` API allows at least **67 requests per minute per organization** (about 1,000 requests per 15 minutes) — a guaranteed floor, enforced per edge location, so a geographically spread caller may get more. Wait for the `Retry-After` interval and retry — the error is `retryable`.

#### Example

```json
{
  "code": "rate_limited",
  "message": "string",
  "retryable": true,
  "requestId": "string",
  "docUrl": "string"
}
```

- `code` (`cancelRun.response.429.code`; string, required)
  - one of `"rate_limited"`
- `message` (`cancelRun.response.429.message`; string, required)
- `retryable` (`cancelRun.response.429.retryable`; boolean, required)
  - one of `true`
- `requestId` (`cancelRun.response.429.requestId`; string, required)
- `docUrl` (`cancelRun.response.429.docUrl`; string, optional)


Source: https://docs.cloudraker.com/paperwork/api/runs/cancel-run/index.md
