> For the complete documentation index, see [llms.txt](https://anunzi-ai.gitbook.io/anunzi-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://anunzi-ai.gitbook.io/anunzi-docs/api-widgets/trabajar-con-la-api-de-llamadas/assistants/update-assistant.md).

# Actualizar agente

**PUT**\
`https://api.anunzi.net/v2/assistants/{model_id}`

Update the configuration of an existing AI call assistant within your Anunzi environment.

#### Path Parameters

| Parameter  | Type   | Required | Description                               |
| ---------- | ------ | -------- | ----------------------------------------- |
| `model_id` | string | Yes      | The unique ID of the assistant to update. |

***

#### Body Parameters

| Parameter                   | Type             | Description                                                                    |
| --------------------------- | ---------------- | ------------------------------------------------------------------------------ |
| `name`                      | string           | Name of the person who will be called.                                         |
| `phone_number`              | string           | Retrieve your phone numbers using the "Get Numbers" API endpoint.              |
| `external_webhook_url`      | string           | URL to receive post-call data (transcripts, etc.).                             |
| `is_recording`              | boolean          | Enable to record conversations.                                                |
| `is_transcript_disabled`    | boolean          | Defaults to `false`. Disable to prevent transcription of conversations.        |
| `agent`                     | object           | Configuration of the agent behavior (see details below).                       |
| `allowed_idle_time_seconds` | int32            | Disconnect the call after this period of inactivity.                           |
| `initial_pause_seconds`     | int32            | Delay before the assistant starts speaking.                                    |
| `transcriber_keywords`      | array of strings | Business terms to improve accuracy and recognition.                            |
| `ring_pause_seconds`        | int32            | Ring duration before the assistant answers.                                    |
| `patience_level`            | string           | Adjust the assistant's response speed. Options: `"low"`, `"medium"`, `"high"`. |
| `timezone`                  | string           | Timezone of the agent.                                                         |
| `max_duration`              | object           | Limit for call duration (see below).                                           |
| `caller_id_number`          | string           | Phone number to be shown as caller ID (e.g., +12345678901).                    |
| `consent_recording`         | boolean          | If enabled, the agent will ask for consent to record the call.                 |
| `consent_text`              | string           | The message the agent will use to request recording consent.                   |

***

#### Agent Object

| Parameter                          | Type    | Description                                                                  |
| ---------------------------------- | ------- | ---------------------------------------------------------------------------- |
| `prompt`                           | string  | Dynamic prompt using variables (e.g., `{your-variable}`).                    |
| `llm`                              | string  | Defaults to `"anunzi"`. Determines the LLM used by the assistant.            |
| `language`                         | string  | Language the assistant will speak.                                           |
| `greeting_message`                 | string  | Custom greeting message, supports variables (e.g., `{your-variable}`).       |
| `voice_id`                         | string  | Retrieve available voices using the "Get Voices" API endpoint.               |
| `voice_stability`                  | float   | Range `0` to `1`. Lower values = more expressive, higher = steadier.         |
| `voice_similarity_boost`           | float   | Range `0` to `1`. Higher values increase similarity but may introduce noise. |
| `voice_style`                      | float   | Range `0` to `1`. Enhances voice distinctiveness, may slow processing.       |
| `voice_optimise_streaming_latency` | int32   | Range `0` to `4`. Optimizes streaming latency.                               |
| `voice_use_speaker_boost`          | boolean | Boosts likeness to the original speaker, may slightly delay responses.       |

***

#### Max Duration Object

| Parameter          | Type    | Description                                                              |
| ------------------ | ------- | ------------------------------------------------------------------------ |
| `duration_seconds` | int32   | Maximum allowed call duration in seconds.                                |
| `is_enabled`       | boolean | If `true`, the call will automatically end after the specified duration. |

***

#### Example Request (cURL)

```bash
curl --request PUT \
     --url https://api.anunzi.net/v2/assistants/23432323x324241321 \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --header 'Authorization: Bearer API_KEY' \
     --data '
{
  "is_recording": true,
  "is_transcript_disabled": true
}
'
```

***

#### Example Response (200 OK)

```json
{
  "status": "ok",
  "response": {
    "model_id": "1726005822670x239735712159542050"
  },
  "details": {
    "phone": "",
    "voice": ""
  }
}
```

***

#### Status Codes

| Code | Description                                 |
| ---- | ------------------------------------------- |
| 200  | Assistant updated successfully.             |
| 400  | Bad Request. Invalid or missing parameters. |
