aguilepino
08/20/2025, 9:38 AMAI Evy
08/20/2025, 9:38 AMAI Evy
08/20/2025, 9:39 AMoutbound_agent_id when importing or updating the phone number [(1) ]() [(2) ]() .
When importing your Twilio number via SIP trunking, you can set the outbound agent using the Import Phone Number API [(1) ]() :
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) ;
If your number is already imported, you can update it to add an outbound agent using the Update Phone Number API [(2) ]() :
javascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const phoneNumberResponse = await client.phoneNumber.update('+14157774444', {
inbound_agent_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD',
nickname: 'Frontdesk Number',
outbound_agent_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD',
}) ;
console.log(phoneNumberResponse.inbound_agent_id) ;
The key parameters you need to include are [(1) ]() [(2) ]() :
- `outbound_agent_id`: Unique id of agent to bind to the number for outbound calls and SMS
- `outbound_agent_version`: Version of the outbound agent (defaults to latest if not provided)
Without an outbound_agent_id configured, the number cannot initiate outbound calls or SMS without an agent id override .AI Evy
08/20/2025, 9:39 AMAI Evy
08/20/2025, 9:39 AMaguilepino
08/20/2025, 9:53 AMAI Evy
08/20/2025, 9:53 AMAI Evy
08/20/2025, 9:53 AMAI Evy
08/20/2025, 9:53 AMAI Evy
08/20/2025, 9:53 AM