---
title: "Start an action run in a space"
---

> 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.

# Start an action run in a space

Path: CloudRaker Workspace API › Space Runs

`POST /spaces/{spaceId}/runs`

Starts a new action run scoped to the space in the path. Requires `space:contribute` on that space (denied → 403). The space is taken from the path — a `spaceId` in the body never scopes the run. Body: `actionSlug` (installed action to run, required, non-empty), `fileIds` (1–100 file IDs from the space to feed the run, each non-empty), optional `params` (free-form object passed to the action), optional `config` (inline action config, deep-merged over the install's saved config — inline wins, a `null` deletes a key outside `schema`, and an inline `schema` replaces the saved one whole, nulls included — and snapshotted onto the run, so an action can be run without saving its config first). Returns 201 `{ data: ActionRun }`; the run starts in status `running` — poll `getRun` for `awaiting_input` / `done` / `failed` plus its `outputs` and `artifacts`.

## Authentication

- `bearerAuth`, http, header `Authorization`

## Path parameters

- `spaceId` (`createRun.path.spaceId`; string, required)

## Request body

_Required._

- `actionSlug` (`createRun.actionSlug`; string, required) — Installed action to run, by id or per-organization slug.
  - minLength 1; example `"contract-terms-extraction"`
- `fileIds` (`createRun.fileIds`; array<string>, required) — Files from this space to feed the run.
  - minLength 1
- `params` (`createRun.params`; map<unknown>, optional) — Per-run parameters for the action.
- `config` (`createRun.config`; map<unknown>, optional) — Inline action config, deep-merged over the install's saved config (inline wins; a `null` deletes a key outside `schema`; an inline `schema` replaces the saved one whole, nulls included). Snapshotted onto the run.

## Example request

```json
{
  "actionSlug": "contract-terms-extraction",
  "fileIds": [
    "string"
  ],
  "params": {
    "property1": null,
    "property2": null
  },
  "config": {
    "property1": null,
    "property2": null
  }
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url 'https://api.cloudraker.com/spaces/<spaceId>/runs' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "actionSlug": "contract-terms-extraction",
  "fileIds": [
    "string"
  ],
  "params": {
    "property1": null,
    "property2": null
  },
  "config": {
    "property1": null,
    "property2": null
  }
}
'
```

### TypeScript

```typescript
const url = 'https://api.cloudraker.com/spaces/<spaceId>/runs';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({
    actionSlug: 'contract-terms-extraction',
    fileIds: ['string'],
    params: {property1: null, property2: null},
    config: {property1: null, property2: null}
  })
};

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"

payload = {
    "actionSlug": "contract-terms-extraction",
    "fileIds": ["string"],
    "params": {
        "property1": None,
        "property2": None
    },
    "config": {
        "property1": None,
        "property2": None
    }
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

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

print(response.text)
```

## Responses

### 201

The started run.

#### 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` (`createRun.response.201.data`; object, required)
  - `id` (`createRun.response.201.data.id`; string, required)
    - example `"run_01J…"`
  - `spaceId` (`createRun.response.201.data.spaceId`; string, required)
  - `actionSlug` (`createRun.response.201.data.actionSlug`; string, required)
    - example `"extract-structured"`
  - `actionVersion` (`createRun.response.201.data.actionVersion`; integer, required)
    - min -9007199254740991; max 9007199254740991
  - `installedActionId` (`createRun.response.201.data.installedActionId`; string, required)
  - `configRevision` (`createRun.response.201.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` (`createRun.response.201.data.configOverridden`; boolean, required) — True when inline config changed the saved config for this run.
  - `playbookRunId` (`createRun.response.201.data.playbookRunId`; string | null, required)
  - `status` (`createRun.response.201.data.status`; string, required)
    - one of `"running"`, `"awaiting_input"`, `"done"`, `"failed"`
  - `error` (`createRun.response.201.data.error`; string | null, required)
  - `output` (`createRun.response.201.data.output`; any of, required) — The action’s JSON output, when it has one.
    - any of: `Option 1`, `null`
  - `artifacts` (`createRun.response.201.data.artifacts`; array<object>, required) — Rendered links. Redacted for callers without `space:contribute`.
    - `id` (`createRun.response.201.data.artifacts.id`; string, required)
    - `kind` (`createRun.response.201.data.artifacts.kind`; string, required)
    - `title` (`createRun.response.201.data.artifacts.title`; string, required)
    - `url` (`createRun.response.201.data.artifacts.url`; string, required)
    - `open` (`createRun.response.201.data.artifacts.open`; string, required)
      - one of `"tab"`, `"embed"`
  - `awaitingInput` (`createRun.response.201.data.awaitingInput`; array<object>, required) — Open human steps while the run is `awaiting_input`.
    - `id` (`createRun.response.201.data.awaitingInput.id`; string, required)
    - `title` (`createRun.response.201.data.awaitingInput.title`; string, required)
    - `url` (`createRun.response.201.data.awaitingInput.url`; string, required)
    - `resolved` (`createRun.response.201.data.awaitingInput.resolved`; boolean, required)
  - `documents` (`createRun.response.201.data.documents`; array<object>, required)
    - `fileId` (`createRun.response.201.data.documents.fileId`; string, required)
    - `name` (`createRun.response.201.data.documents.name`; string, required)
    - `contentType` (`createRun.response.201.data.documents.contentType`; string | null, required)
  - `outputs` (`createRun.response.201.data.outputs`; array<object>, required) — Downloadable byproducts; stream each with the run-output route.
    - `fileId` (`createRun.response.201.data.outputs.fileId`; string, required)
    - `kind` (`createRun.response.201.data.outputs.kind`; string, required)
    - `key` (`createRun.response.201.data.outputs.key`; string, required)
    - `size` (`createRun.response.201.data.outputs.size`; number, required)
  - `timeoutSeconds` (`createRun.response.201.data.timeoutSeconds`; integer, required)
    - min -9007199254740991; max 9007199254740991
  - `lastEventAt` (`createRun.response.201.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` (`createRun.response.201.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` (`createRun.response.201.data.createdBy`; string | null, required)
  - `finishedAt` (`createRun.response.201.data.finishedAt`; any of, required)
    - any of: `string`, `null`
  - `config` (`createRun.response.201.data.config`; map<unknown>, optional) — The exact config used by this run, including inline overrides. Returned on the run detail read only.
  - `apiRunId` (`createRun.response.201.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/create-run/index.md
