Agents
Agents represent AI personas (e.g., Support Bot, Sales Agent) that can have phone numbers attached to them. Each agent can be configured with a voice mode, system prompt, greeting message, and voice selection.
Voice modes
Agents support two voice modes for handling calls:
webhook(default) — Forwards call transcripts to your configured webhook URL. You process the transcript with your own AI backend and return a response.hosted— Uses a built-in LLM with the agent’ssystemPrompt. No webhook is needed for voice conversations; the platform handles the AI interaction directly.
Voice tuning
Beyond the voice mode, a handful of agent fields shape how a call actually sounds and behaves. They apply to both webhook and hosted modes (the Calls guide describes the underlying engine). Set them on POST /v1/agents or change them anytime with PATCH /v1/agents/{id} — voice infrastructure re-provisions with no downtime.
Good defaults for a natural-sounding assistant: leave interruptionSensitivity near 0.8, keep enableBackchannel on, and use sttMode: "accurate" only when you need exact capture of spelled-out details. Tune one field at a time and listen back with call recordings.
Language
Set language to a BCP-47 locale to run recognition and synthesis in that language. AgentPhone supports 63 locales, including:
Pick a voice that matches the locale for the most natural result. The full list of accepted locale codes is in the API Reference under the agent language field.
Create agent
Create a new agent.
Request body
See Voice tuning below for how the voice-related fields shape a call.
Example
List agents
List all agents for this project.
Query parameters
Example
Get agent
Get a single agent with its attached numbers.
Example
Update agent
Update an agent’s configuration. Use this to change voice mode, system prompt, greeting, or voice.
All fields are optional. Only include the fields you want to update.
Example
Delete agent
Delete an agent. Phone numbers, conversations, and calls associated with the agent will have their agent reference cleared but will not be deleted.
Example
Attach number to agent
Attach an existing phone number to an agent. The number must belong to the same project and must not be released.
Request body
Example
List agent conversations
List all conversations for a specific agent.
Example
List agent calls
List all calls for a specific agent.
Example
List available voices
List all available TTS voices that can be used with the voice field when creating or updating agents.
Example
Use the returned voice identifiers (e.g., "Polly.Amy", "Polly.Joanna") in the voice field when creating agents, updating agents, or making outbound calls.

