---
title: "Validate a playbook definition"
method: POST
path: "/v1/projects/{project_id}/playbooks/validate"
tags: ["Playbooks"]
---

# Validate a playbook definition

`POST /v1/projects/{project_id}/playbooks/validate`

## Request

- Base URL: `https://api.naturali.ai`
- URL: `https://api.naturali.ai/v1/projects/{project_id}/playbooks/validate`
- Auth: one of:
  - HTTP bearer
  - OAuth 2 (authorization code, authorization URL `https://api.naturali.ai/authorize`, token URL `https://api.naturali.ai/token`, scopes: `mcp:access`)

Answers what a create or update would be told about a definition, without writing: `valid`, and every graph problem it holds. A definition whose shape cannot be read is `400 VALIDATION_FAILED`, as on a write.

## Request body

- ValidatePlaybookRequest
  - `definition` PlaybookDefinition, required
    - `nodes` PlaybookNode[], required
      - `id` string, required: Stable across versions: a case's values carry over by ID. Letters, digits and underscores, starting with a letter or underscore.
      - `title` string, required
      - `description` string
      - `kind` 'collect' | 'execute' | 'confirm', required: `collect` outputs its inputs, `execute` runs its executor, `confirm` waits for a person to confirm its inputs.
      - `final` boolean: A goal of the playbook; only a final node carries transformations
      - `inputs` PlaybookInput[], required
        - `name` string, required: Letters, digits and underscores, starting with a letter or underscore
        - `schema` object, required: The JSON Schema a value must satisfy
        - `required` boolean, required: The node cannot run until a required input is set
        - `description` string: What to ask for; shown with the input when it is missing
        - `source` union, required: `manual` for an input a person or an integration writes, or the field of an earlier node it reads: `output[.path]`, or `input.<name>[.path]`. Sources are the playbook's edges.
          - 'manual'
          - object
            - `node_id` string, required: The ID of the node it reads
            - `field` string, required
      - `executor` PlaybookExecutor
        - `type` 'agent' | 'tool' | 'decider' | 'workflow' | 'orchestration', required
        - `id` string, required: The ID of the agent, tool, decider, workflow or orchestration
        - `input` object: JSON Logic over the node's inputs, as an orchestration's `input_mapping`: each key is a field of the executor's input. Absent, the executor receives the node's input values as they are.
      - `transformations` PlaybookTransformation[]
        - `name` string, required
        - `format` 'csv' | 'docx' | 'html' | 'jpg' | 'json' | 'md' | 'pdf' | 'png' | 'pptx' | 'txt' | 'xlsx', required: The file's format; the tool must answer its content type: `application/pdf` for `pdf`, the Office Open XML types for `docx`, `xlsx` and `pptx`, `text/csv`, `text/html`, `text/markdown`, `text/plain`, `application/json`, `image/png` and `image/jpeg` for `jpg`
        - `tool` string, required: The tool that renders the final node's output as a file, answering with `execute.response_mode: base64`

## Response `200`

Validation result

- PlaybookValidationResult
  - `valid` boolean, required
  - `problems` ValidationProblem[], required: Every reason the definition cannot be stored: `DUPLICATE_NODE`, `DUPLICATE_INPUT`, `MISSING_NODE`, `UNKNOWN_FIELD`, `EXECUTOR_REQUIRED`, `EXECUTOR_FORBIDDEN`, `TRANSFORMATIONS_NOT_FINAL`, `DUPLICATE_TRANSFORMATION` or `CYCLE`. The same items a refused write lists under `meta.problems`.
    - `code` string, required: What kind of problem it is, stable across releases.
    - `path` string, required: Where in the request body the problem is.
    - `message` string, required: The problem in words, naming the values involved.

## Other responses

- `400`: Bad request — the definition's shape cannot be read
- `401`: Unauthorized

---

[API](https://skmtc.dev/naturali/apis/naturali-ai-api.md) · [All operations](https://skmtc.dev/naturali/apis/naturali-ai-api/llms.txt) · [OpenAPI document](https://skmtc.dev/naturali/apis/naturali-ai-api/revisions/e4905b78f422?raw)
