---
title: "Archive a playbook definition"
---

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

# Archive a playbook definition

Path: CloudRaker Workspace API › Playbooks

`POST /playbooks/{playbookId}/archive`

Transitions the playbook identified by `playbookId` to `archived` status, retiring it from active use. Authorization: organization administrators only — other callers are rejected with 403. No request body. Response: `{ data: Playbook }` with the updated status.

## Authentication

- `bearerAuth`, http, header `Authorization`

## Path parameters

- `playbookId` (`archivePlaybook.path.playbookId`; string, required)

## Code samples

### cURL

```bash
curl --request POST \
  --url 'https://api.cloudraker.com/playbooks/<playbookId>/archive' \
  --header 'Authorization: Bearer <token>'
```

### TypeScript

```typescript
const url = 'https://api.cloudraker.com/playbooks/<playbookId>/archive';
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/playbooks/<playbookId>/archive"

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

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

print(response.text)
```

## Responses

### 200

The archived playbook definition.

#### Example

```json
{
  "data": {
    "id": "string",
    "name": "Contract intake",
    "description": "string",
    "status": "draft",
    "spaceTypes": [
      "string"
    ],
    "tasks": [
      {
        "id": "string",
        "title": "string",
        "instructions": "string",
        "dependsOn": [
          "string"
        ],
        "executor": "agent",
        "assignee": "string"
      }
    ],
    "actions": [
      {
        "installedActionId": "string",
        "preApproval": true,
        "postApproval": true,
        "dependsOn": [
          "string"
        ],
        "trigger": "agent"
      }
    ],
    "model": "string",
    "version": -9007199254740991,
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z",
    "createdBy": "string"
  }
}
```

- `data` (`archivePlaybook.response.200.data`; object, required)
  - `id` (`archivePlaybook.response.200.data.id`; string, required)
  - `name` (`archivePlaybook.response.200.data.name`; string, required)
    - example `"Contract intake"`
  - `description` (`archivePlaybook.response.200.data.description`; string, required)
  - `status` (`archivePlaybook.response.200.data.status`; string, required)
    - one of `"draft"`, `"active"`, `"archived"`
  - `spaceTypes` (`archivePlaybook.response.200.data.spaceTypes`; array<string>, required) — Space-type identifiers this playbook applies to. Empty means every space type.
  - `tasks` (`archivePlaybook.response.200.data.tasks`; array<object>, required)
    - `id` (`archivePlaybook.response.200.data.tasks.id`; string, required)
      - minLength 1; maxLength 64
    - `title` (`archivePlaybook.response.200.data.tasks.title`; string, required)
      - minLength 1; maxLength 200
    - `instructions` (`archivePlaybook.response.200.data.tasks.instructions`; any of, required)
      - any of: `string`, `null`
    - `dependsOn` (`archivePlaybook.response.200.data.tasks.dependsOn`; array<string>, required) — Task ids that must complete first.
    - `executor` (`archivePlaybook.response.200.data.tasks.executor`; string, required) — `human` tasks are completed by a person out-of-band; the agent never does them.
      - one of `"agent"`, `"human"`
    - `assignee` (`archivePlaybook.response.200.data.tasks.assignee`; string | null, required) — User id. Human tasks only; null = anyone in the space.
  - `actions` (`archivePlaybook.response.200.data.actions`; array<object>, required)
    - `installedActionId` (`archivePlaybook.response.200.data.actions.installedActionId`; string, required)
      - minLength 1
    - `preApproval` (`archivePlaybook.response.200.data.actions.preApproval`; boolean, required) — Gate the action behind a human approval.
    - `postApproval` (`archivePlaybook.response.200.data.actions.postApproval`; boolean, required) — Review the action output before continuing.
    - `dependsOn` (`archivePlaybook.response.200.data.actions.dependsOn`; array<string>, required) — Task ids only — an action may never depend on another action.
    - `trigger` (`archivePlaybook.response.200.data.actions.trigger`; string, required) — `user` actions are started from the run view; the agent never proposes them.
      - one of `"agent"`, `"user"`
  - `model` (`archivePlaybook.response.200.data.model`; string | null, required) — Optional model override for agent runs. Validated against an allowlist.
  - `version` (`archivePlaybook.response.200.data.version`; integer, required)
    - min -9007199254740991; max 9007199254740991
  - `createdAt` (`archivePlaybook.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` (`archivePlaybook.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))$`
  - `createdBy` (`archivePlaybook.response.200.data.createdBy`; string, required)


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