Create agent
Create an AI agent for a sender. Each sender can have at most one agent.
Authorization
AuthorizationheaderrequiredBearer YOUR_API_KEY. Create a key in the dashboard.
Path parameters
senderIdstringrequired
Body
application/json
namestringrequiredLimitsmax length 100providerstringrequiredLLM provider for the AI agent.
One ofopenaianthropicgooglemistralzavumodelstringrequiredsystemPromptstringrequiredLimitsmax length 10000apiKeystringAPI key for the LLM provider. Required unless provider is 'zavu'.
contextWindowMessagesintegerDefault10Limitsmin 1 · max 50includeContactMetadatabooleanDefaulttruemaxTokensintegerLimitsmin 1 · max 4096temperaturenumberLimitsmin 0 · max 2triggerOnChannelsstring[]Default["*"]triggerOnMessageTypesstring[]Default["text"]voiceobjectVoice Agent configuration. Enable this to let the agent answer and place phone calls with Zavu's managed voice pipeline.
17 properties
enabledbooleanrequiredWhether the agent handles voice calls. When false, the sender's number is not answered by the voice agent 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
201Agent created.
agentobjectrequiredAI Agent configuration for a sender.
18 properties
idstringrequiredsenderIdstringThe sender the agent was created on, its primary. Absent on an agent created with
POST /v1/agents, which has no primary even after senders are connected to it.senderIdslists every sender the agent answers on.namestringrequiredenabledbooleanrequiredWhether 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.
17 properties
enabledbooleanrequiredWhether the agent handles voice calls. When false, the sender's number is not answered by the voice agent 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.
senderIdsstring[]Senders this agent answers on. An agent can serve several;
senderIdremains the primary one, for compatibility.
400Invalid request.
codestringrequiredmessagestringrequireddetailsobject
401Unauthorized.
codestringrequiredmessagestringrequireddetailsobject
404Sender not found.
codestringrequiredmessagestringrequireddetailsobject
409`conflict`: the sender already answers with an agent, either one created on it or one connected to it with `POST /v1/agents/{agentId}/senders`. Update that agent instead, or disconnect it first.
codestringrequiredmessagestringrequireddetailsobject