---
title: "Cancel an action 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 an action run

Path: CloudRaker Workspace API › Space Runs

`POST /spaces/{spaceId}/runs/{runId}/cancel`

Requests cancellation of a run in the space. Requires `space:contribute` (denied → 403). No request body. Returns 200 `{ data: ActionRun }` with the run's updated state (typically transitioning toward `failed`). Canceling a `sign-document` run also voids its pending envelope, so signers can no longer sign. A `runId` from another space returns 404.

## Authentication

- `bearerAuth`, http, header `Authorization`

## Path parameters

- `spaceId` (`cancelSpaceRun.path.spaceId`; string, required)
- `runId` (`cancelSpaceRun.path.runId`; string, required)

## Code samples

### cURL

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

### TypeScript

```typescript
const url = 'https://api.cloudraker.com/spaces/<spaceId>/runs/<runId>/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/spaces/<spaceId>/runs/<runId>/cancel"

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

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

print(response.text)
```

## Responses

### 200

The run, with its updated state.

#### Example

```json
{
  "data": {
    "id": "run_01J…",
    "spaceId": "string",
    "actionSlug": "extract-structured",
    "actionVersion": -9007199254740991,
    "installedActionId": "string",
    "configRevision": -9007199254740991,
    "configOverridden": true,
    "config": {
      "property1": null,
      "property2": null
    },
    "playbookRunId": "string",
    "apiRunId": "string",
    "status": "running",
    "error": "string",
    "output": {},
    "artifacts": [
      {
        "id": "string",
        "kind": "link",
        "title": "string",
        "url": "string",
        "open": "tab"
      }
    ],
    "awaitingInput": [
      {
        "id": "string",
        "title": "string",
        "url": "string",
        "resolved": true
      }
    ],
    "documents": [
      {
        "fileId": "string",
        "name": "string",
        "contentType": "string"
      }
    ],
    "outputs": [
      {
        "fileId": "string",
        "kind": "string",
        "key": "string",
        "size": 0
      }
    ],
    "timeoutSeconds": -9007199254740991,
    "lastEventAt": "2019-08-24T14:15:22Z",
    "createdAt": "2019-08-24T14:15:22Z",
    "createdBy": "string",
    "finishedAt": "2019-08-24T14:15:22Z"
  }
}
```

- `data` (`cancelSpaceRun.response.200.data`; object, required)
  - `id` (`cancelSpaceRun.response.200.data.id`; string, required)
    - example `"run_01J…"`
  - `spaceId` (`cancelSpaceRun.response.200.data.spaceId`; string, required)
  - `actionSlug` (`cancelSpaceRun.response.200.data.actionSlug`; string, required)
    - example `"extract-structured"`
  - `actionVersion` (`cancelSpaceRun.response.200.data.actionVersion`; integer, required)
    - min -9007199254740991; max 9007199254740991
  - `installedActionId` (`cancelSpaceRun.response.200.data.installedActionId`; string, required)
  - `configRevision` (`cancelSpaceRun.response.200.data.configRevision`; any of, required) — The revision of the saved config the run used. Null on a run created before revisions existed.
    - any of: `integer`, `null`
  - `configOverridden` (`cancelSpaceRun.response.200.data.configOverridden`; boolean, required) — True when inline config changed the saved config for this run.
  - `playbookRunId` (`cancelSpaceRun.response.200.data.playbookRunId`; string | null, required)
  - `status` (`cancelSpaceRun.response.200.data.status`; string, required)
    - one of `"running"`, `"awaiting_input"`, `"done"`, `"failed"`
  - `error` (`cancelSpaceRun.response.200.data.error`; string | null, required)
  - `output` (`cancelSpaceRun.response.200.data.output`; any of, required) — The action’s JSON output, when it has one.
    - any of: `Option 1`, `null`
  - `artifacts` (`cancelSpaceRun.response.200.data.artifacts`; array<object>, required) — Rendered links. Redacted for callers without `space:contribute`.
    - `id` (`cancelSpaceRun.response.200.data.artifacts.id`; string, required)
    - `kind` (`cancelSpaceRun.response.200.data.artifacts.kind`; string, required)
    - `title` (`cancelSpaceRun.response.200.data.artifacts.title`; string, required)
    - `url` (`cancelSpaceRun.response.200.data.artifacts.url`; string, required)
    - `open` (`cancelSpaceRun.response.200.data.artifacts.open`; string, required)
      - one of `"tab"`, `"embed"`
  - `awaitingInput` (`cancelSpaceRun.response.200.data.awaitingInput`; array<object>, required) — Open human steps while the run is `awaiting_input`.
    - `id` (`cancelSpaceRun.response.200.data.awaitingInput.id`; string, required)
    - `title` (`cancelSpaceRun.response.200.data.awaitingInput.title`; string, required)
    - `url` (`cancelSpaceRun.response.200.data.awaitingInput.url`; string, required)
    - `resolved` (`cancelSpaceRun.response.200.data.awaitingInput.resolved`; boolean, required)
  - `documents` (`cancelSpaceRun.response.200.data.documents`; array<object>, required)
    - `fileId` (`cancelSpaceRun.response.200.data.documents.fileId`; string, required)
    - `name` (`cancelSpaceRun.response.200.data.documents.name`; string, required)
    - `contentType` (`cancelSpaceRun.response.200.data.documents.contentType`; string | null, required)
  - `outputs` (`cancelSpaceRun.response.200.data.outputs`; array<object>, required) — Downloadable byproducts; stream each with the run-output route.
    - `fileId` (`cancelSpaceRun.response.200.data.outputs.fileId`; string, required)
    - `kind` (`cancelSpaceRun.response.200.data.outputs.kind`; string, required)
    - `key` (`cancelSpaceRun.response.200.data.outputs.key`; string, required)
    - `size` (`cancelSpaceRun.response.200.data.outputs.size`; number, required)
  - `timeoutSeconds` (`cancelSpaceRun.response.200.data.timeoutSeconds`; integer, required)
    - min -9007199254740991; max 9007199254740991
  - `lastEventAt` (`cancelSpaceRun.response.200.data.lastEventAt`; string, required)
    - format `date-time`; pattern `^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$`
  - `createdAt` (`cancelSpaceRun.response.200.data.createdAt`; string, required)
    - format `date-time`; pattern `^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$`
  - `createdBy` (`cancelSpaceRun.response.200.data.createdBy`; string | null, required)
  - `finishedAt` (`cancelSpaceRun.response.200.data.finishedAt`; any of, required)
    - any of: `string`, `null`
  - `config` (`cancelSpaceRun.response.200.data.config`; map<unknown>, optional) — The exact config used by this run, including inline overrides. Returned on the run detail read only.
  - `apiRunId` (`cancelSpaceRun.response.200.data.apiRunId`; string, optional) — The id of the `/v1` run that started this run, for example `exr_…`. Absent when the run started another way.


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