---
title: "Update an agent"
method: PATCH
path: "/v1/agents/{agentId}"
tags: ["Agents"]
---

# Update an agent

`PATCH /v1/agents/{agentId}`

## Path parameters

- `agentId` string, required

## Request body

- AgentUpdateRequest
  - `name` string
  - `enabled` boolean
  - `provider` 'openai' | 'anthropic' | 'google' | 'mistral' | 'zavu' — LLM provider for the AI agent.
  - `model` string
  - `systemPrompt` string
  - `apiKey` string
  - `contextWindowMessages` integer
  - `includeContactMetadata` boolean
  - `maxTokens` integer, nullable
  - `temperature` number, nullable
  - `triggerOnChannels` string[]
  - `triggerOnMessageTypes` string[]
  - `voice` AgentVoiceConfig — Voice Agent configuration on a sender's AI agent. Controls how the agent behaves on inbound and outbound phone calls through Zavu's managed voice pipeline (speech recognition, the agent's LLM, and speech synthesis, with real-time interruption handling). Requires the Voice Agents feature to be enabled for your team.
    - `enabled` boolean, required — Whether the agent handles voice calls. When false, the sender's number is not answered by the voice agent and outbound calls are rejected.
    - `greeting` string — Opening line the agent speaks when the call connects. If omitted, the agent waits for the caller to speak first.
    - `greetings` object — Greeting per language, keyed by language code. Used when the caller's language differs from the one `greeting` is written in.
    - `language` string — BCP-47 language code used for both speech recognition and speech synthesis (e.g. `en`, `es`, `pt-BR`). Auto-detected from the recipient when omitted.
    - `model` string — Model that runs the conversation, co-located in the voice network for lowest latency. Independent of the model used for text messaging. Derived from the agent's text model when omitted.
    - `sttProvider` string — Speech-recognition provider. Uses the default when omitted.
    - `sttModel` string — Speech-recognition model. Uses the default when omitted.
    - `ttsProvider` string — Speech-synthesis provider. Uses the default when omitted.
    - `ttsVoiceId` string — Identifier of the synthesized voice that speaks. Choose from the voices available in the dashboard. Uses a neutral default when omitted.
    - `voiceSpeed` number — Speech rate. 1.0 is natural. Only honoured by voices that support rate control; ignored by the others.
    - `interruptible` boolean — Whether the caller can interrupt the agent while it is speaking (barge-in). When true, the agent stops talking as soon as the caller starts.
    - `maxCallDurationMinutes` integer — Hard limit on call length in minutes. The call ends automatically when reached.
    - `maxIdleSeconds` integer — How long the agent waits during silence before ending the call.
    - `recordCalls` boolean — Whether the call audio is recorded.
    - `voicemailAction` 'hangup' | 'leave_message' — What the agent does when an answering machine or voicemail is detected on an outbound call.
    - `voicemailMessage` string — Message spoken when `voicemailAction` is `leave_message`. Falls back to `greeting` when omitted.
    - `transferPhoneNumber` string — E.164 phone number the agent can transfer the call to. When set, the agent is given a transfer tool it can use to hand the call to a human.

## Response `200`

Agent updated.

- object
  - `agent` Agent, required — AI Agent configuration for a sender.
    - `id` string, required
    - `senderId` string, required
    - `name` string, required
    - `enabled` boolean, required — Whether the agent is active.
    - `provider` 'openai' | 'anthropic' | 'google' | 'mistral' | 'zavu', required — LLM provider for the AI agent.
    - `model` string, required — Model ID (e.g., gpt-4o-mini, claude-3-5-sonnet).
    - `systemPrompt` string, required — System prompt for the agent.
    - `contextWindowMessages` integer — Number of previous messages to include as context.
    - `includeContactMetadata` boolean — Whether to include contact metadata in context.
    - `maxTokens` integer, nullable — Maximum tokens for LLM response.
    - `temperature` number, nullable — LLM temperature (0-2).
    - `triggerOnChannels` string[] — Channels that trigger the agent.
    - `triggerOnMessageTypes` string[] — Message types that trigger the agent.
    - `stats` object
      - `totalInvocations` integer
      - `totalTokensUsed` integer
      - `totalCost` number — Total cost in USD.
    - `createdAt` string, date-time, required
    - `updatedAt` string, date-time, required
    - `voice` AgentVoiceConfig — Voice Agent configuration on a sender's AI agent. Controls how the agent behaves on inbound and outbound phone calls through Zavu's managed voice pipeline (speech recognition, the agent's LLM, and speech synthesis, with real-time interruption handling). Requires the Voice Agents feature to be enabled for your team.
      - `enabled` boolean, required — Whether the agent handles voice calls. When false, the sender's number is not answered by the voice agent and outbound calls are rejected.
      - `greeting` string — Opening line the agent speaks when the call connects. If omitted, the agent waits for the caller to speak first.
      - `greetings` object — Greeting per language, keyed by language code. Used when the caller's language differs from the one `greeting` is written in.
      - `language` string — BCP-47 language code used for both speech recognition and speech synthesis (e.g. `en`, `es`, `pt-BR`). Auto-detected from the recipient when omitted.
      - `model` string — Model that runs the conversation, co-located in the voice network for lowest latency. Independent of the model used for text messaging. Derived from the agent's text model when omitted.
      - `sttProvider` string — Speech-recognition provider. Uses the default when omitted.
      - `sttModel` string — Speech-recognition model. Uses the default when omitted.
      - `ttsProvider` string — Speech-synthesis provider. Uses the default when omitted.
      - `ttsVoiceId` string — Identifier of the synthesized voice that speaks. Choose from the voices available in the dashboard. Uses a neutral default when omitted.
      - `voiceSpeed` number — Speech rate. 1.0 is natural. Only honoured by voices that support rate control; ignored by the others.
      - `interruptible` boolean — Whether the caller can interrupt the agent while it is speaking (barge-in). When true, the agent stops talking as soon as the caller starts.
      - `maxCallDurationMinutes` integer — Hard limit on call length in minutes. The call ends automatically when reached.
      - `maxIdleSeconds` integer — How long the agent waits during silence before ending the call.
      - `recordCalls` boolean — Whether the call audio is recorded.
      - `voicemailAction` 'hangup' | 'leave_message' — What the agent does when an answering machine or voicemail is detected on an outbound call.
      - `voicemailMessage` string — Message spoken when `voicemailAction` is `leave_message`. Falls back to `greeting` when omitted.
      - `transferPhoneNumber` string — E.164 phone number the agent can transfer the call to. When set, the agent is given a transfer tool it can use to hand the call to a human.
    - `senderIds` string[] — Senders this agent answers on. An agent can serve several; `senderId` remains the primary one, for compatibility.

## Other responses

- `400` — Invalid request.
- `401` — Unauthorized.
- `404` — Agent not found.

---

[API](https://skmtc.net/zavudev/apis/zavu-unified-messaging-layer-api.md) · [All operations](https://skmtc.net/zavudev/apis/zavu-unified-messaging-layer-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/zavudev/zavu-unified-messaging-layer-api/versions/07b87b6ae707/schema)
