> ## Documentation Index
> Fetch the complete documentation index at: https://docs.talkover.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Validate Agent Flow

> Dry-run validation of a flow configuration

# Validate Agent Flow

Run validation on a candidate flow configuration without persisting changes. Returns the same errors that [Update Agent Flow](/api-reference/endpoints/update-agent-flow) would return.

## Endpoint

```
POST /api/v1/agents/{agent_id}/flow/validate
```

## Path parameters

<ParamField path="agent_id" type="string" required>Agent UUID. Used to scope validation (e.g., to check that referenced action IDs exist).</ParamField>

## Request headers

<ParamField header="Authorization" type="string" required>
  Bearer token. Format: `Bearer talq_your_environment_token_here`
</ParamField>

<ParamField header="Content-Type" type="string" required>
  Must be set to `application/json`
</ParamField>

## Request body

<ParamField body="flow_config" type="object" required>
  Same shape as in [Update Agent Flow](/api-reference/endpoints/update-agent-flow).
</ParamField>

## Examples

<RequestExample>
  ```bash theme={null}
  curl -X POST "https://app.talkover.ai/api/v1/agents/agent-uuid/flow/validate" \
    -H "Authorization: Bearer talq_your_environment_token_here" \
    -H "Content-Type: application/json" \
    -d '{
      "flow_config": {
        "initial_node_id": "node-greet",
        "nodes": [
          { "id": "node-greet", "type": "say", "content": "Hi!", "next": "node-end" },
          { "id": "node-end", "type": "end" }
        ]
      }
    }'
  ```
</RequestExample>

## Response

### Valid

<ResponseExample>
  ```json theme={null}
  {
    "success": true,
    "message": "Flow is valid"
  }
  ```
</ResponseExample>

### Invalid

<ResponseExample>
  ```json theme={null}
  {
    "success": false,
    "errors": [
      "Duplicate node id: 'node-greet'",
      "Node 'node-end' is unreachable"
    ]
  }
  ```
</ResponseExample>

## Notes

* Use this from your editor before submitting an update — surfaces issues early without modifying agent state.
* Validation rules cover: unique node IDs, reachability, valid `next`/`branches` targets, required fields per node `type`.
