Client Nexus
12/31/2025, 7:16 PMAI Evy
12/31/2025, 7:16 PMAI Evy
12/31/2025, 7:16 PMphone_number (E.164 format) and termination_uri. [(1) ]()
Optional fields include: sip_trunk_auth_username, sip_trunk_auth_password, inbound_agent_id, outbound_agent_id, inbound_agent_version, outbound_agent_version, nickname, inbound_webhook_url, inbound_allowed_countries, outbound_allowed_countries, and transport.
Termination URI
No sip: prefix needed. The documentation shows the format as: "someuri.pstn.twilio.com"
For Twilio elastic SIP trunks, it always ends with .pstn.twilio.com.
Credentials Format
Username and password are simple strings. Examples from the docs:
- `sip_trunk_auth_username`: "username"
- `sip_trunk_auth_password`: "123456"
Update API - Termination URI
I don't have information in the available sources about whether termination_uri can be updated after import. The Update Phone Number API documentation isn't included in my sources.
Fix Misconfiguration
Without documentation on the Update Phone Number endpoint, I can confirm you can delete using: [(2) ]()
javascript
await client.phoneNumber.delete('+14157774444') ;
Then reimport with corrected settings.
Phone ID for API Calls
Use the E.164 format phone number (e.g., "+14157774444") as the unique identifier for phone number APIs. [(1) ]() , [(2) ]()AI Evy
12/31/2025, 7:16 PMAI Evy
12/31/2025, 7:16 PMClient Nexus
12/31/2025, 7:18 PMAI Evy
12/31/2025, 7:18 PMAI Evy
12/31/2025, 7:19 PMsip:sip.retellai.com [(1) ]()
For different transport protocols, append the transport method: [(2) ]()
- TCP: sip:sip.retellai.com;transport=tcp
- UDP: sip:sip.retellai.com;transport=udp
- TLS: sip:sip.retellai.com;transport=tls
*Retell's Outbound IPs (for Twilio IP ACL) *
IP block for traffic:
- 18.98.16.120/30 (All regions)
- 143.223.88.0/21 (United States only)
- 161.115.160.0/19 (United States only)
Note: Some non-US traffic might come from IPs not listed above, but will be migrated to the first IP block by 12/03/2025.
Transport Protocol
Supported transport methods: TCP (Recommended) , UDP, TLS
SRTP media encryption is also supported when transport is set to TLS.
Credential Direction
The sip_trunk_auth_username and sip_trunk_auth_password are credentials that Retell uses to authenticate WITH Twilio for outbound calls. [(1) ]()
From the Twilio setup guide: "For your elastic SIP trunk to accept our outbound request, you need to whitelist IP address or create auth with username and password. If you opt for the auth route, you need to specify the username and password in the next step when importing the number to Retell."
Webhook for Inbound
The inbound_webhook_url is optional. When you set inbound_agent_id, Retell handles inbound routing automatically. [(3) ]()
The webhook is only needed "if set, will send a webhook for inbound calls, where you can override agent id, set dynamic variables and other fields specific to that call."
So if you just want standard agent handAI Evy
12/31/2025, 7:19 PMinbound_agent_id alone is sufficient. Use inbound_webhook_url only if you need per-call customization.AI Evy
12/31/2025, 7:19 PMAI Evy
12/31/2025, 7:19 PMClient Nexus
12/31/2025, 7:20 PMAI Evy
12/31/2025, 7:20 PMAI Evy
12/31/2025, 7:21 PMsip: prefix needed. The format should be:
[(2) ]()
someuri.pstn.twilio.com
The documentation confirms: "For Twilio elastic SIP trunks it always ends with '.pstn.twilio.com'."
So your example agency-abc123.pstn.twilio.com follows the correct format.
Also note: you may want to use a localized termination URI near your region for better performance. You can find localized URIs in the Twilio console.
[(1) ]()AI Evy
12/31/2025, 7:21 PMAI Evy
12/31/2025, 7:21 PMClient Nexus
12/31/2025, 7:56 PMAI Evy
12/31/2025, 7:56 PMAI Evy
12/31/2025, 7:57 PMphone_number (E.164 format) and termination_uri. The auth credentials are optional but recommended for outbound authentication:
[(2) ]()
javascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const phoneNumberResponse = await client.phoneNumber.import({
phone_number: '+14157774444',
termination_uri: 'someuri.pstn.twilio.com',
}) ;
console.log(phoneNumberResponse.inbound_agent_id) ;
Clean import with no prerequisites (on the Retell side) . As long as:
1. The number is assigned to your Elastic SIP Trunk in Twilio
2. Your trunk's origination points to sip.retellai.com
3. You have the correct termination URI and credentials
Just call /import-phone-number for each number. Once imported, "you can make and receive calls with this number just like a number you purchased from Retell — it will show up in your dashboard."
[(1) ]()
You can optionally include inbound_agent_id, outbound_agent_id, nickname, and other fields during import, or update them later.
[(2) ]() , [(2) ]()AI Evy
12/31/2025, 7:57 PMAI Evy
12/31/2025, 7:57 PM