Create an agent
Connect it to an address with POST /v2/agents/{agentId}/channels.
Authorization
AuthorizationheaderrequiredBearer YOUR_API_KEY. Create a key in the dashboard.
Body
application/json
namestringrequiredLimitsmax length 100providerstringrequiredLLM provider for the AI agent.
One ofopenaianthropicgooglemistralzavuapiKeystringYour key for the model provider. Required for
openai,anthropic,googleandmistral, where a request without it is refused with400; not used withzavu. Stored encrypted and never returned.modelstringrequiredsystemPromptstringrequiredLimitsmax length 10000contextWindowMessagesintegerDefault10Limitsmin 1 · max 50includeContactMetadatabooleanDefaulttruetriggerOnChannelsstring[]Default["*"]triggerOnMessageTypesstring[]Default["text"]maxTokensintegerLimitsmin 1 · max 4096temperaturenumberLimitsmin 0 · max 2voiceobjectVoice Agent configuration on an 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.
17 properties
enabledbooleanrequiredWhether the agent handles voice calls. When false, the voice agent does not answer calls and outbound calls are rejected.
greetingstringOpening line the agent speaks when the call connects. If omitted, the agent waits for the caller to speak first.
Limitsmax length 1000greetingsobjectGreeting per language, keyed by language code. Used when the caller's language differs from the one
greetingis written in.1 properties
{key}string
languagestringBCP-47 language code used for both speech recognition and speech synthesis (e.g.
en,es,pt-BR). Auto-detected from the recipient when omitted.modelstringModel 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.
sttProviderstringSpeech-recognition provider. Uses the default when omitted.
sttModelstringSpeech-recognition model. Uses the default when omitted.
ttsProviderstringSpeech-synthesis provider. Uses the default when omitted.
ttsVoiceIdstringIdentifier of the synthesized voice that speaks. Choose from the voices available in the dashboard. Uses a neutral default when omitted.
voiceSpeednumberSpeech rate. 1.0 is natural. Only honoured by voices that support rate control; ignored by the others.
Default1Limitsmin 0.5 · max 1.5interruptiblebooleanWhether the caller can interrupt the agent while it is speaking (barge-in). When true, the agent stops talking as soon as the caller starts.
DefaulttruemaxCallDurationMinutesintegerHard limit on call length in minutes. The call ends automatically when reached.
Default15Limitsmin 1 · max 120maxIdleSecondsintegerHow long the agent waits during silence before ending the call.
Default30Limitsmin 5 · max 300recordCallsbooleanWhether the call audio is recorded.
voicemailActionstringWhat the agent does when an answering machine or voicemail is detected on an outbound call.
One ofhangupleave_messageDefaulthangupvoicemailMessagestringMessage spoken when
voicemailActionisleave_message. Falls back togreetingwhen omitted.Limitsmax length 1000transferPhoneNumberstringE.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.
Responses
201Created, disabled and connected to no channel.
agentobjectrequiredAn AI agent. It answers on the addresses in
channels.17 properties
idstringrequirednamestringrequiredenabledbooleanrequiredWhether the agent is active.
providerstringrequiredLLM provider for the AI agent.
One ofopenaianthropicgooglemistralzavumodelstringrequiredModel ID (e.g., gpt-4o-mini, claude-3-5-sonnet).
systemPromptstringrequiredSystem prompt for the agent.
contextWindowMessagesintegerNumber of previous messages to include as context.
Default10includeContactMetadatabooleanWhether to include contact metadata in context.
DefaulttruemaxTokensintegerMaximum tokens for LLM response.
temperaturenumberLLM temperature (0-2).
triggerOnChannelsstring[]Channels that trigger the agent.
triggerOnMessageTypesstring[]Message types that trigger the agent.
statsobject3 properties
totalInvocationsintegertotalTokensUsedintegertotalCostnumberTotal cost in USD.
createdAtstring<date-time>requiredupdatedAtstring<date-time>requiredvoiceobjectVoice Agent configuration. When present and enabled, the agent can answer inbound phone calls and place outbound calls with Zavu's managed voice pipeline. Requires the Voice Agents feature to be enabled for your team.
17 properties
enabledbooleanrequiredWhether the agent handles voice calls. When false, the voice agent does not answer calls and outbound calls are rejected.
greetingstringOpening line the agent speaks when the call connects. If omitted, the agent waits for the caller to speak first.
Limitsmax length 1000greetingsobjectGreeting per language, keyed by language code. Used when the caller's language differs from the one
greetingis written in.1 properties
{key}string
languagestringBCP-47 language code used for both speech recognition and speech synthesis (e.g.
en,es,pt-BR). Auto-detected from the recipient when omitted.modelstringModel 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.
sttProviderstringSpeech-recognition provider. Uses the default when omitted.
sttModelstringSpeech-recognition model. Uses the default when omitted.
ttsProviderstringSpeech-synthesis provider. Uses the default when omitted.
ttsVoiceIdstringIdentifier of the synthesized voice that speaks. Choose from the voices available in the dashboard. Uses a neutral default when omitted.
voiceSpeednumberSpeech rate. 1.0 is natural. Only honoured by voices that support rate control; ignored by the others.
Default1Limitsmin 0.5 · max 1.5interruptiblebooleanWhether the caller can interrupt the agent while it is speaking (barge-in). When true, the agent stops talking as soon as the caller starts.
DefaulttruemaxCallDurationMinutesintegerHard limit on call length in minutes. The call ends automatically when reached.
Default15Limitsmin 1 · max 120maxIdleSecondsintegerHow long the agent waits during silence before ending the call.
Default30Limitsmin 5 · max 300recordCallsbooleanWhether the call audio is recorded.
voicemailActionstringWhat the agent does when an answering machine or voicemail is detected on an outbound call.
One ofhangupleave_messageDefaulthangupvoicemailMessagestringMessage spoken when
voicemailActionisleave_message. Falls back togreetingwhen omitted.Limitsmax length 1000transferPhoneNumberstringE.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.
channelsobject[]requiredThe (address, type) entries this agent answers on: every transport of the addresses it is connected to that its
triggerOnChannelsallows. Connect one withPOST /v2/agents/{agentId}/channels.3 properties
addressstringrequiredtypestringrequiredA transport a message travels on.
One ofsmssms_onewaywhatsapptelegramemailinstagrammessengervoiceactivebooleanrequired
400A required field is missing or invalid. Every missing required field is listed, not the first (`details.errors`, e.g. `[{"path":["provider"],"message":"provider is required"},{"path":["model"],"message":"model is required"}]`).
codestringrequiredmessagestringrequireddetailsobjectMachine-readable context. Keys that mean the same thing everywhere: -
errors: present on every400 invalid_requestfor an invalid body or query parameter,[{path, message, ...}],pathnaming the field (["to"],["contacts", 2, "recipient"],["limit"]). -recommendation: one sentence saying what to do next. -dashboardUrl: the dashboard screen that fixes it. -connect: on409 no_channel, the channels this project can connect to reach the recipient, each{type, request, note, available, dashboardUrl?};requestis the exact call (POST /v2/channelswith its body, orPOST /v2/numbers), or null for a channel connected from the dashboard (WhatsApp, Instagram, Messenger).available: falsesays why innote(one-way SMS closed until business verification is approved). -address/from: the address the error is about, under the name the request used for it.1 properties
errorsobject[]3 properties
pathobject[]requiredmessagestringrequiredcodestring
401Unauthorized.
codestringrequiredmessagestringrequireddetailsobjectMachine-readable context. Keys that mean the same thing everywhere: -
errors: present on every400 invalid_requestfor an invalid body or query parameter,[{path, message, ...}],pathnaming the field (["to"],["contacts", 2, "recipient"],["limit"]). -recommendation: one sentence saying what to do next. -dashboardUrl: the dashboard screen that fixes it. -connect: on409 no_channel, the channels this project can connect to reach the recipient, each{type, request, note, available, dashboardUrl?};requestis the exact call (POST /v2/channelswith its body, orPOST /v2/numbers), or null for a channel connected from the dashboard (WhatsApp, Instagram, Messenger).available: falsesays why innote(one-way SMS closed until business verification is approved). -address/from: the address the error is about, under the name the request used for it.1 properties
errorsobject[]3 properties
pathobject[]requiredmessagestringrequiredcodestring