Skip to main content
The SIP Trunking API lets you connect your own telephony platform to PolyAI. It has two parts:
  1. A management REST API to create and configure SIP Trunks and their Extensions, and to place outbound calls over a trunk.
  2. 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/….
Do not use https://api.poly.ai without a region prefix — it returns an error. Always include the region.

Authentication

All endpoints authenticate with an API key sent in the X-API-Key header — either an Agent Studio personal access token or an account-level API key.
The key must belong to a user who is an admin on the account named in the request path.
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:
The response includes the trunk 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 SIP INVITE to PolyAI:
Calls dialed to 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’s inbound.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.
See Connecting to PolyAI Telephony for transport, DNS, and authentication details.

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 — a default_caller_id and the sip_addresses your calls route to — with Update a SIP Trunk. Then call the outbound-call endpoint:
Use the returned call_sid to poll the call with Get outbound call status until it reaches success or failure.

Error responses

Example error response

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.
Last modified on August 27, 2026