Calls
Voice calls are real-time conversations through your agent’s phone numbers. Calls can be inbound (received) or outbound (initiated via API). Each call includes metadata like duration, status, and transcript.
How calls are handled depends on your agent’s voice mode.
Voice modes
voiceMode: "webhook" (default) — Caller speech is transcribed and sent to your webhook as agent.message events. Your server controls every response using any LLM, RAG, or custom logic.
voiceMode: "hosted" — Calls are handled end-to-end by a built-in LLM using your systemPrompt. No webhook or server needed.
Switch modes at any time via PATCH /v1/agents/:id. The backend automatically re-provisions voice infrastructure and rebinds phone numbers with no downtime.
SMS is always webhook-based regardless of voice mode.
Call flow (webhook mode)
When voiceMode is "webhook":
Transcript is sent to your webhook
We POST the transcript to your webhook with event: "agent.message" and channel: "voice", including recentHistory for context.
Your server responds
You process the transcript (e.g., send to your LLM) and return a response. We strongly recommend streaming NDJSON — TTS starts speaking on the first chunk.
Call flow (built-in AI mode)
When voiceMode is "hosted":
Voice capabilities
Both modes share the same low-latency engine:
Webhook response format
For voice webhooks, your server must return a response telling the agent what to say.
Streaming response (recommended)
Return Content-Type: application/x-ndjson with newline-delimited JSON chunks. TTS starts speaking on the very first chunk while your server continues processing.
Mark interim chunks with "interim": true — the final chunk (without interim) closes the turn. Use this for tool calls, LLM token forwarding, or any time your response takes more than ~1 second.
Simple response
Return a single JSON object for instant replies where no processing delay is expected.
Response fields
Example: streaming handler (Python / FastAPI)
Example: streaming handler (Node.js / Express)
List calls
List all calls for this project.
Query parameters
Example
Get call
Get details of a specific call, including its full transcript.
Example
Create outbound call
Initiate an outbound voice call from one of your agent’s phone numbers. The agent’s first assigned phone number is used as the caller ID.
Request body
Example
List calls for number
List all calls associated with a specific phone number.
