# Create or update an agent

`PUT /agent/create_update_agent`

Creates the agent when it does not exist yet, and updates it when it does. This is the recommended way to write agent configuration.

## Auth

Authentication required.

## Parameters

No parameters.

## Request body

Required: yes
Content-Type: application/json
Shape: CreateUpdateAgentRequest

| Name | Type | Required | Description |
|---|---|---|---|
| bot_name | string | yes |  |
| agent_data | object | no | Default {}. |
| voice_data | object | no | Default {}. |
| transfer | object | no | Default {}. |
| webhook | WebhookField | no | Default {}. |
| webhook.auth | WebhookAuth \| null | no |  |
| webhook.auth.type | enum(none \| bearer \| jwt \| api_key) | no | Default "none". |
| webhook.auth.source | string \| null | no |  |
| webhook.auth.header_name | string \| null | no |  |
| webhook.auth.scheme | string \| null | no |  |
| webhook.auth.token | string \| null | no |  |
| webhook.auth.api_key | string \| null | no |  |
| agent_id | string \| null | no |  |

## Responses

| Status | Description | Content-Type | Shape |
|---|---|---|---|
| 200 | Successful Response | application/json | unknown |
| 422 | Validation Error | application/json | HTTPValidationError |

## Machine-readable

This page is also available as Markdown at `/docs/put-agent-create_update_agent.md` (the ".md" suffix convention). The full curated API contract is at `/api/openapi.json`, and a machine-readable index of every page is at `/llms.txt`.
