- A management REST API to create and configure SIP Trunks and their Extensions, and to place outbound calls over a trunk.
- A SIP/RTP interface your telephony system connects to.
A SIP Trunk is an account-level virtual connection that carries voice calls between your telephony platform and PolyAI. It authenticates callers, accepts inbound calls, and holds a list of Extensions that map a dialed number to a specific PolyAI agent.
Resource model
The API is organized around two nested, account-scoped resources:Base URL
The API is served from a regional gateway. Use the region your PolyAI account is hosted in:
Every resource is scoped to an account, so all management endpoints are prefixed with
/v1/accounts/{account_id}/telephony/….
Authentication
All endpoints authenticate with an API key sent in theX-API-Key header — either an Agent Studio personal access token or an account-level API key.
Create a key from the API Keys tab in Agent Studio — see API keys.
Quick start
Create a trunk, map a number to an agent, then point your telephony platform at PolyAI.1. Create a SIP Trunk
Create an encrypted trunk that authenticates inbound calls with a SIP token:id and its inbound.hostname — the host your telephony platform connects to.
2. Create an extension
Map a dialed number on the trunk to a PolyAI agent. The extension is the number or extension sent in the Request URI of the SIPINVITE to PolyAI:
1000 on this trunk now route to the my-agent agent.
3. Connect your telephony platform
Update your SIP server to route calls to your trunk’sinbound.hostname and to the correct port — for TLS that’s port 5061, e.g. tr-0123456789abcdefghijklmn.sbc.sip.us.poly.ai:5061.
If using SIP token-based auth, you’ll also need to send a X-PolyAI-SIP-Trunk-Token SIP header on your first SIP INVITE.
Placing outbound calls
A trunk can also place outbound calls: PolyAI dials a number and connects the answered call to one of your agents. First configure the trunk’s outbound settings — adefault_caller_id and the sip_addresses your calls route to — with Update a SIP Trunk. Then call the outbound-call endpoint:
call_sid to poll the call with Get outbound call status until it reaches success or failure.
Error responses
Example error response
Related
Connecting to PolyAI Telephony
Route inbound phone calls into PolyAI over SIP/RTP.
Place an outbound call
Dial a number and connect the call to one of your agents over a trunk.
Outbound calls over PolyAI telephony
Place outbound calls over PolyAI-managed telephony with the Agents API.
Agents API
Build and deploy the agents your extensions route calls to.

