Placeholders
Every snippet below uses these placeholders. Replace them before running the code.Create an agent
tool_refs; see Tools.
Test with a web session
Web sessions let you talk to your agent from a browser. No phone number or SIP trunk required. The response includes LiveKit credentials you can use with any LiveKit client SDK.arguments overrides template_defaults on the agent, and participant_name sets a display name in the LiveKit room. max_session_seconds is set by the server — it is not configurable per request — and is enforced for web sessions only; phone calls are not subject to it.
Update an agent
PATCH updates only the fields you send. Use PUT if you want to replace the entire configuration. Shared tool and MCP attachments need the complete agent document. Download it withGET /v1/agents/{agent_id}/config, edit tool_refs or mcp_refs, then send it with PUT. PATCH does not update attachments.
Duplicate an agent
Use duplication when you want to copy an existing agent configuration as-is, including prompts, models, tools, template defaults, and selected region. The request contract:nameis required. The Dashboard pre-fills<Name> Copy, but the API expects an explicit name.- The inbound connection is never inherited. Pass
target_sip_inbound_trunk_idto attach one to the copy — this is only accepted when the source agent has inbound telephony, and the trunk must differ from the source agent’s inbound trunk. - The outbound connection is inherited within your organisation unless you override it with
target_sip_outbound_trunk_id(only accepted when the source agent has outbound telephony).
- Reconnect inbound routing if the duplicate should receive calls.
- Verify the outbound trunk before dispatching calls.
- Test the duplicate with a web session or a test call.
Version history and restore
Every save — create, update, restore, import — appends an immutable version to the agent’s history. Versions can’t be edited or deleted; the only mutable part is an optional label. Restoring is a two-step preview-then-accept flow, so you can review exactly which fields will change before anything is applied.Browse the history
cURL
Preview a restore
cURL
preparation.config and candidate — the full config document that would be applied — are trimmed here for brevity):
202 with "state": "preparing" and a Retry-After header — retry the preview until state is ready. The version’s name is not restored by default; pass {"restore_historical_name": true} in the preview body to include it (and pass the same value again on accept — the acceptance hash binds the name policy).
Accept the restore
Send back the hashes from the preview:cURL
acceptance_hash comes from the top level of the preview; candidate_hash, resource_hash, and dependency_hash come from its preparation object. If the agent changed between preview and accept, the accept fails with a conflict — run the preview again. On success the response is the restored agent, and the X-Agent-Version-Created header reports whether a new version was appended (false means the restore was a no-op because nothing differed).
Label a version
Labels are the only mutable part of a version. Set one to mark a known-good configuration, or sendnull to clear it:
cURL
Export and import agent configs
GET /v1/agents/{agent_id}/config downloads the agent’s canonical config document — a portable JSON file with everything needed to recreate the agent. Secrets are never included. To download a historical snapshot instead, use GET /v1/agents/{agent_id}/versions/{n}/config from the section above.
cURL
POST /v1/agents/import creates a new agent from such a document — a download followed by an import round-trips exactly. Pass the optional sip_outbound_trunk_id query parameter to attach an outbound trunk to the imported agent.
cURL
List and inspect agents
Delete an agent
Returns204 No Content on success.