---
title: "Validate 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.

# Validate a playbook definition

Path: CloudRaker Workspace API › Playbooks

`POST /playbooks/{playbookId}/validate`

Lints the playbook, optionally with a draft overlay merged over the stored document (same fields as update). Always 200 with `{ data: { issues } }` — each issue carries `severity: error | warning`; warnings never block activation. Authorization: organization administrators only.

## Authentication

- `bearerAuth`, http, header `Authorization`

## Path parameters

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

## Request body

_Required._

- `name` (`validatePlaybook.name`; string, optional)
  - minLength 1; maxLength 200
- `description` (`validatePlaybook.description`; string, optional)
  - maxLength 5000
- `spaceTypes` (`validatePlaybook.spaceTypes`; array<string>, optional)
- `tasks` (`validatePlaybook.tasks`; array<object>, optional)
  - `id` (`validatePlaybook.tasks.id`; string, required)
    - minLength 1; maxLength 64
  - `title` (`validatePlaybook.tasks.title`; string, required)
    - minLength 1; maxLength 200
  - `instructions` (`validatePlaybook.tasks.instructions`; string, optional, nullable)
    - maxLength 4000
  - `dependsOn` (`validatePlaybook.tasks.dependsOn`; array<string>, optional) — Task ids that must complete first.
  - `executor` (`validatePlaybook.tasks.executor`; string, optional) — `human` tasks are completed by a person out-of-band; the agent never does them.
    - one of `"agent"`, `"human"`
  - `assignee` (`validatePlaybook.tasks.assignee`; string, optional, nullable) — User id. Human tasks only; null = anyone in the space.
- `model` (`validatePlaybook.model`; string, optional, nullable)
  - maxLength 200
- `actions` (`validatePlaybook.actions`; array<object>, optional)
  - `installedActionId` (`validatePlaybook.actions.installedActionId`; string, required)
    - minLength 1
  - `preApproval` (`validatePlaybook.actions.preApproval`; boolean, optional) — Gate the action behind a human approval.
  - `postApproval` (`validatePlaybook.actions.postApproval`; boolean, optional) — Review the action output before continuing.
  - `dependsOn` (`validatePlaybook.actions.dependsOn`; array<string>, optional) — Task ids only — an action may never depend on another action.
  - `trigger` (`validatePlaybook.actions.trigger`; string, optional) — `user` actions are started from the run view; the agent never proposes them.
    - one of `"agent"`, `"user"`

## Example request

```json
{
  "name": "string",
  "description": "string",
  "spaceTypes": [
    "string"
  ],
  "tasks": [
    {
      "id": "string",
      "title": "string",
      "instructions": "string",
      "dependsOn": [
        "string"
      ],
      "executor": "agent",
      "assignee": "string"
    }
  ],
  "model": "string",
  "actions": [
    {
      "installedActionId": "string",
      "preApproval": true,
      "postApproval": true,
      "dependsOn": [
        "string"
      ],
      "trigger": "agent"
    }
  ]
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url 'https://api.cloudraker.com/playbooks/<playbookId>/validate' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "string",
  "description": "string",
  "spaceTypes": [
    "string"
  ],
  "tasks": [
    {
      "id": "string",
      "title": "string",
      "instructions": "string",
      "dependsOn": [
        "string"
      ],
      "executor": "agent",
      "assignee": "string"
    }
  ],
  "model": "string",
  "actions": [
    {
      "installedActionId": "string",
      "preApproval": true,
      "postApproval": true,
      "dependsOn": [
        "string"
      ],
      "trigger": "agent"
    }
  ]
}
'
```

### TypeScript

```typescript
const url = 'https://api.cloudraker.com/playbooks/<playbookId>/validate';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({
    name: 'string',
    description: 'string',
    spaceTypes: ['string'],
    tasks: [
      {
        id: 'string',
        title: 'string',
        instructions: 'string',
        dependsOn: ['string'],
        executor: 'agent',
        assignee: 'string'
      }
    ],
    model: 'string',
    actions: [
      {
        installedActionId: 'string',
        preApproval: true,
        postApproval: true,
        dependsOn: ['string'],
        trigger: 'agent'
      }
    ]
  })
};

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>/validate"

payload = {
    "name": "string",
    "description": "string",
    "spaceTypes": ["string"],
    "tasks": [
        {
            "id": "string",
            "title": "string",
            "instructions": "string",
            "dependsOn": ["string"],
            "executor": "agent",
            "assignee": "string"
        }
    ],
    "model": "string",
    "actions": [
        {
            "installedActionId": "string",
            "preApproval": True,
            "postApproval": True,
            "dependsOn": ["string"],
            "trigger": "agent"
        }
    ]
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

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

print(response.text)
```

## Responses

### 200

Validation issues (possibly empty).

#### Example

```json
{
  "data": {
    "issues": [
      {
        "path": "string",
        "message": "string",
        "severity": "error"
      }
    ]
  }
}
```

- `data` (`validatePlaybook.response.200.data`; object, required)
  - `issues` (`validatePlaybook.response.200.data.issues`; array<object>, required)
    - `path` (`validatePlaybook.response.200.data.issues.path`; string, required)
    - `message` (`validatePlaybook.response.200.data.issues.message`; string, required)
    - `severity` (`validatePlaybook.response.200.data.issues.severity`; string, required)
      - one of `"error"`, `"warning"`


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