---
title: "List playbook runs 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.

# List playbook runs in a space

Path: CloudRaker Workspace API › Playbooks

`GET /spaces/{spaceId}/playbook-runs`

Lists playbook runs in this space, newest first. Authorization: `space:read` (org admins bypass); missing → 404. Query params: `playbookId` (filter to one playbook), `status` (one of running, waiting_approval, waiting_action, waiting_user, paused, completed, failed, cancelled — an unrecognized value returns 400 `invalid_status`), `limit` (1–100), and `starting_after` (opaque cursor = the id of the last run from the previous page). Returns `{ data: PlaybookRun[], has_more }`; when `has_more` is true, page again using the last run id as `starting_after`.

## Authentication

- `bearerAuth`, http, header `Authorization`

## Path parameters

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

## Query parameters

- `playbookId` (`listPlaybookRuns.query.playbookId`; string, optional) — Only runs of this playbook.
  - minLength 1
- `status` (`listPlaybookRuns.query.status`; string, optional) — Run-status filter. An unrecognized value returns 400 `invalid_status`.
  - one of `"running"`, `"waiting_approval"`, `"waiting_action"`, `"waiting_user"`, `"paused"`, `"completed"`, `"failed"`, `"cancelled"`
- `limit` (`listPlaybookRuns.query.limit`; integer, optional) — Page size, 1–100.
  - min 1; max 100; default `20`
- `starting_after` (`listPlaybookRuns.query.starting_after`; string, optional) — Cursor: the id of the last run on the previous page.
  - minLength 1

## Code samples

### cURL

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

### TypeScript

```typescript
const url = 'https://api.cloudraker.com/spaces/<spaceId>/playbook-runs';
const options = {method: 'GET', 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>/playbook-runs"

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

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

print(response.text)
```

## Responses

### 200

One page of playbook runs, newest first.

#### Example

```json
{
  "data": [
    {
      "id": "string",
      "spaceId": "string",
      "playbookId": "string",
      "playbookVersion": -9007199254740991,
      "playbookName": "string",
      "status": "running",
      "fileScope": {
        "mode": "space"
      },
      "taskProgress": {
        "total": -9007199254740991,
        "completed": -9007199254740991
      },
      "pendingApproval": {
        "id": "string",
        "kind": "pre",
        "actionName": "string",
        "requestedAt": "2019-08-24T14:15:22Z"
      },
      "result": "string",
      "error": "string",
      "startedBy": "string",
      "createdAt": "2019-08-24T14:15:22Z",
      "updatedAt": "2019-08-24T14:15:22Z",
      "finishedAt": "2019-08-24T14:15:22Z"
    }
  ],
  "has_more": true
}
```

- `data` (`listPlaybookRuns.response.200.data`; array<object>, required)
  - `id` (`listPlaybookRuns.response.200.data.id`; string, required)
  - `spaceId` (`listPlaybookRuns.response.200.data.spaceId`; string, required)
  - `playbookId` (`listPlaybookRuns.response.200.data.playbookId`; string, required)
  - `playbookVersion` (`listPlaybookRuns.response.200.data.playbookVersion`; integer, required)
    - min -9007199254740991; max 9007199254740991
  - `playbookName` (`listPlaybookRuns.response.200.data.playbookName`; string, required)
  - `status` (`listPlaybookRuns.response.200.data.status`; string, required)
    - one of `"running"`, `"waiting_approval"`, `"waiting_action"`, `"waiting_user"`, `"paused"`, `"completed"`, `"failed"`, `"cancelled"`
  - `fileScope` (`listPlaybookRuns.response.200.data.fileScope`; PlaybookFileScope, required)
    - one of:
      - `object`
        - `mode` (`listPlaybookRuns.response.200.data.fileScope.1.mode`; string, required)
      - `object`
        - `mode` (`listPlaybookRuns.response.200.data.fileScope.2.mode`; string, required)
        - `fileIds` (`listPlaybookRuns.response.200.data.fileScope.2.fileIds`; array<string>, required)
          - minLength 1
  - `taskProgress` (`listPlaybookRuns.response.200.data.taskProgress`; object, required)
    - `total` (`listPlaybookRuns.response.200.data.taskProgress.total`; integer, required)
      - min -9007199254740991; max 9007199254740991
    - `completed` (`listPlaybookRuns.response.200.data.taskProgress.completed`; integer, required)
      - min -9007199254740991; max 9007199254740991
  - `pendingApproval` (`listPlaybookRuns.response.200.data.pendingApproval`; any of, required)
    - any of:
      - `object`
        - `id` (`listPlaybookRuns.response.200.data.pendingApproval.1.id`; string, required)
        - `kind` (`listPlaybookRuns.response.200.data.pendingApproval.1.kind`; string, required)
          - one of `"pre"`, `"post"`
        - `actionName` (`listPlaybookRuns.response.200.data.pendingApproval.1.actionName`; string, required)
        - `requestedAt` (`listPlaybookRuns.response.200.data.pendingApproval.1.requestedAt`; 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))$`
      - `null`
  - `result` (`listPlaybookRuns.response.200.data.result`; string | null, required)
  - `error` (`listPlaybookRuns.response.200.data.error`; string | null, required)
  - `startedBy` (`listPlaybookRuns.response.200.data.startedBy`; string, required)
  - `createdAt` (`listPlaybookRuns.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))$`
  - `updatedAt` (`listPlaybookRuns.response.200.data.updatedAt`; 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))$`
  - `finishedAt` (`listPlaybookRuns.response.200.data.finishedAt`; any of, required)
    - any of: `string`, `null`
- `has_more` (`listPlaybookRuns.response.200.has_more`; boolean, required)

### 400

Unrecognized status filter (invalid_status)


Source: https://docs.cloudraker.com/workspace/api/playbooks/list-playbook-runs/index.md
