Skip to main content
Working code for the agent lifecycle. For prompt design, tool configuration, and template variables, see Configuring voice agents.

Placeholders

Every snippet below uses these placeholders. Replace them before running the code.

Create an agent

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.
Both fields are optional. arguments overrides template_defaults on the agent, and participant_name sets a display name in the LiveKit room.

Update an agent

PATCH updates only the fields you send. Use PUT if you want to replace the entire configuration.

Duplicate an agent

Use duplication when you want to copy an existing agent configuration as-is, including prompts, models, tools, template defaults, selected region, and outbound telephony settings. The duplicate does not copy call history or the inbound connection. After duplicating an agent:
  • 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.

List and inspect agents

Delete an agent

Returns 204 No Content on success.