Twilio Setup to Connect to Retellai


You can edit phone number details using the Update Phone Number API endpoint(1).

The endpoint is PATCH /update-phone-number/{phone_number} where {phone_number} is the E.164 format of the number (e.g., “+14157774444”)(1).

You can update the following details(1):

  • inbound_agent_id - Agent for inbound calls(1)
  • outbound_agent_id - Agent for outbound calls(1)
  • inbound_agent_version - Version of the inbound agent(1)
  • outbound_agent_version - Version of the outbound agent(1)
  • nickname - Your internal reference name(1)
  • inbound_webhook_url - Webhook for inbound calls(1)
  • allowed_inbound_country_list - ISO 3166-1 alpha-2 country codes for allowed inbound calls(1)
  • allowed_outbound_country_list - ISO 3166-1 alpha-2 country codes for allowed outbound calls(1)
  • SIP trunk configuration (termination_uri, auth_username, auth_password, transport)(1)

Here’s an example using the JavaScript SDK:

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);

(1)

Note: If you need to update the phone number used for account verification/MFA, you cannot do this from the dashboard(2). You’ll need to contact Retell AI support at support@retellai.com(2).