/agents endpoints let you manage agents as code: provision a standard agent for every new customer, copy a proven agent into a subaccount, rename agents or swap their phone numbers, and start or stop them on your own schedule.
Agents were previously called campaigns. The
/campaigns/... paths still work and behave the same as /agents/.... Responses include both campaignId/campaignGroupId and agentId/agentGroupId fields with the same values.Endpoints at a glance
List and get agents
GET /agents requires organizationId. Use your own account ID (from GET /organization) or the ID of one of your subaccounts. Filter by group with agentGroupId.
string
Agent ID.
string
Agent name.
boolean
Whether the agent is running.
boolean
true for inbound agents.object
Voice settings: voice, phone numbers (
phonesFrom), language, time zone, schedule, retries, recording, voicemail, and more.object
Email channel settings (Email agents).
object[]
Webhooks configured on the agent.
string[]
Variables the script uses. Provide these in each contact’s
data.string
Inbound number, for inbound agents.
string
When the first call or chat happened (ISO 8601).
string
When the agent ran out of contacts (ISO 8601).
string
Group ID, or
null.string
Group name, or
null.Create an agent
POST /agents creates an agent and returns it with status 201. The schema covers everything the dashboard can configure; most fields are optional and default to the same values the dashboard uses.
Things to know:
- Minimum fields. For a basic outbound Voice agent, send
name(at least 3 characters) andvoiceId. Get voice IDs fromGET /voices. - Nothing is picked for you. No voice or phone number is selected automatically. Send
phoneNumbers(orcallParams.phonesFrom) with numbers already in your account. - Type.
typeisCALL(default),CHAT,EMAIL, orTRIGGER. SetisIncoming: truefor inbound agents. - Time zone. If omitted, it’s
UTC. Send an IANA time zone (callParams.timezone) when calls should follow local hours. - Script. Use
steps(flat) ornestedStepsplusedges(graph). If you omit both, the agent gets the standard starter step. - Initial state. Call, chat, and email agents are created stopped. Trigger agents activate immediately.
- Arrays replace. Any array you send replaces the default; an empty array clears it.
- Shortcuts.
voiceIdandphoneNumbersoverridecallParams.voiceandcallParams.phonesFromwhen both are present.
toolFunctions).
Server-managed fields (owner, audit fields, generated credentials, provider-managed values) are always set by Callers and can’t be sent.
Replace an agent
PUT /agents/{agentId} replaces the agent’s entire writable configuration using the same schema as create. Fields you omit go back to their defaults, arrays you send replace existing arrays, and null clears nullable fields. Voice and phone numbers aren’t inferred, so include them.
The agent’s running state is kept, except that changing an agent to TRIGGER activates it.
Update name, phone numbers, or webhooks
PATCH /agents/{agentId} accepts any combination of name, phoneNumbers, and webhooks (at least one). It returns { "success": true }.
phoneNumbers and webhooks replace the current lists. Send "webhooks": [] to remove all of the agent’s webhooks. To add one webhook without touching the others, use POST /agents/{agentId}/webhook/subscribe instead.
Duplicate an agent
POST /agents/{agentId}/duplicate copies an agent, including its script and settings, and returns the new agent’s id.
PATCH the copy’s phone numbers and webhooks for that subaccount (using x-sub-organization-id). The request fails if the target account has reached its agent limit.
Start and stop
POST /agents/{agentId}/start and POST /agents/{agentId}/stop. Starting an active agent returns 400 Campaign already activated.; stopping a stopped agent returns 400 Campaign not activated. See Launch outbound calls.
Delete an agent
DELETE /agents/{agentId} archives the agent: it stops running workflows and releases provider configuration, but keeps the agent’s data, contacts, and calls. It returns { "success": true }. Archived agents can be restored from the dashboard.
Success criteria
POST /agents/{agentId}/update/interestcriteria replaces the agent’s success criteria. Criteria are grouped into goal-reached (interested) and goal-not-reached (notInterested) lists.
successCriteria.name) and as webhook events (POST_PROCESSING_FINISHED:Demo Scheduled). See Success criteria.
Agent groups
Agent groups organize agents in the dashboard.GET /agent-groups returns each group’s id, name, and campaignsCount; GET /agent-groups/{agentGroupId} returns one group. To create an agent inside a group, send agentGroupId on create.
Speech recognition vocabulary
Help the agent recognize product names, brands, and jargon.Troubleshooting
The agent was created but doesn't call
The agent was created but doesn't call
New call agents start stopped. Check it has a voice and a phone number, add contacts, and call
start.PUT reset settings I didn't send
PUT reset settings I didn't send
PUT is a full replacement. Read the agent, change what you need, and send the complete configuration, or use PATCH for name, phone numbers, and webhooks.404 Campaign not found
404 Campaign not found
The agent doesn’t exist in the account you’re acting on. Check the ID and the
x-sub-organization-id header.Related
Create an agent in the dashboard
Build and test agents visually.
Subaccounts and SIP
Roll agents out across subaccounts.
Voices and cloning
Find and create voice IDs.
Webhooks overview
Configure where results are sent.