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

# Update Agent

> Update a prompt-based voice agent

Updates a prompt-based agent and deploys the change immediately. Only the fields
you include in the body are changed.

<Note>
  Flow agents cannot be modified via the API — `PATCH` on a `conversationalFlow`
  agent returns `422`. Edit flow agents in the [dashboard](https://app.voicy.co).
</Note>

## Path Parameters

<ParamField path="agent_id" type="string" required>The agent's unique identifier (UUID).</ParamField>

## Body Parameters

All optional — include only what you want to change.

<ParamField body="name" type="string" />

<ParamField body="prompt" type="string" />

<ParamField body="language" type="string" />

<ParamField body="voice" type="string">Voice display name (`Keren`, `Karmit`, `Kobi`, `Kfir`, `Dana`, `Dafna`, `Dorin`, `Dan`, `Dor`, `David`, `Sapir`, `Steve`).</ParamField>

<ParamField body="welcome_message" type="string" />

<ParamField body="variables_provided" type="array">
  Replaces the provided-variable set. Same item shape as [Create Agent](/api-reference/agent-create).
</ParamField>

<ParamField body="variables_extracted" type="array">
  Replaces the extracted-variable set. Same item shape as [Create Agent](/api-reference/agent-create).
</ParamField>

## Response

The updated [Agent](/api-reference/models/agent) object.

<RequestExample>
  ```bash cURL theme={null}
  curl -X PATCH https://api.voicy.co/functions/v1/agent-modify/550e8400-e29b-41d4-a716-446655440000 \
    -H "Authorization: Bearer voicy_sk_live_xxx" \
    -H "Content-Type: application/json" \
    -d '{ "prompt": "You are a friendly receptionist. Always confirm the date twice.", "voice": "Dafna" }'
  ```

  ```javascript JavaScript theme={null}
  const id = '550e8400-e29b-41d4-a716-446655440000';
  const agent = await (await fetch(`https://api.voicy.co/functions/v1/agent-modify/${id}`, {
    method: 'PATCH',
    headers: {
      'Authorization': 'Bearer voicy_sk_live_xxx',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({ prompt: 'Always confirm the date twice.', voice: 'Dafna' }),
  })).json();
  ```

  ```python Python theme={null}
  import requests
  agent_id = '550e8400-e29b-41d4-a716-446655440000'
  agent = requests.patch(
      f'https://api.voicy.co/functions/v1/agent-modify/{agent_id}',
      headers={'Authorization': 'Bearer voicy_sk_live_xxx'},
      json={'prompt': 'Always confirm the date twice.', 'voice': 'Dafna'},
  ).json()
  ```
</RequestExample>

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "agent_id": "550e8400-e29b-41d4-a716-446655440000",
    "name": "Appointment Booker",
    "language": "he",
    "voice": "Dafna",
    "agent_type": "singlePrompt",
    "active": true,
    "prompt": "You are a friendly receptionist. Always confirm the date twice.",
    "welcome_message": "שלום, איך אפשר לעזור?",
    "variables_provided": [],
    "variables_extracted": [],
    "created_at": "2026-06-06T10:00:00Z",
    "updated_at": "2026-06-06T11:30:00Z"
  }
  ```

  ```json 422 Unprocessable Entity theme={null}
  {
    "status": "error",
    "message": "Only singlePrompt agents can be modified via the API. Edit conversationalFlow agents in the dashboard."
  }
  ```
</ResponseExample>
