Add number to SIP trunk API
Add a phone number from your carrier to a SIP trunk via POST /trunk/trunks//numbers, optionally with the agent that answers it.
e164 must be in E.164 format with the plus. Set destination_key to the called number exactly as your carrier sends it in the SIP Request-URI, without a leading +; for most carriers that is the E.164 digits.Next steps
- Assign an agent to answer inbound calls to the number.
- To call out from the number, set the agent’s telephony provider to
trunkwith the Update agent API and pass the number asfrom_phone_numbertoPOST /call.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The trunk's id
Body
The number in E.164 format, a plus then 7 to 15 digits. Used as the caller ID on outbound calls from this number.
^\+[1-9]\d{6,14}$"+12025550143"
The called number exactly as your carrier puts it in the SIP Request-URI of an inbound call, without a leading +. Required by the API; for most carriers it is the E.164 number's digits (12025550143), which is what the dashboard fills in. An inbound call matches the number on its E.164 form first, then on this key.
1"12025550143"
Agent that answers inbound calls to this number. Must be one of your agents. Leave out to use the trunk's default_inbound_agent_id.
Response
The added number
"5e6f7a8b-9c0d-4e1f-a2b3-c4d5e6f7a8b9"
"3f2b8c1e-6d4a-4f7b-9e2c-1a5d7b9c0e21"
"+12025550143"
"12025550143"
Agent that answers inbound calls to this number. When null, the trunk's default_inbound_agent_id answers.
"123e4567-e89b-12d3-a456-426614174000"
When this number last took an inbound call, updated at most once a minute.
When an outbound call was last placed from this number, updated at most once a minute.

