How do i support multiple Twilio numbers in VAPI?
# support
i
I have multiple twilio numbers that I want to use with VAPI. I am connecting them through adding it via the VAPI phone numbers API and setting up each twilio number to connect to a single Vapi SIP trunk. Right now I have multiple numbers set up as the origination URI. But its not routing properly. (It would route randomly to one of these numbers if I were to call one of those numbers) What am i missing in my setup? If i want to support both outbound and inbound numbers in twilio, do I have to create a separate SIP trunk for each number? https://cdn.discordapp.com/attachments/1437335455724208240/1437335456172740619/image.png?ex=69425475&is=694102f5&hm=ab972b7e54ad763ce7c6346c0a2eb07e76a8efbd97ff9c584fd138214fc90302&
c
Hi there, Thank you for your message. Our team is currently out of the office. We operate Monday through Friday, from 9:00 AM to 8:00 PM Pacific Standard Time (PST). We’ll get back to you as soon as possible during our normal business hours. If your message is urgent, please mark it accordingly or include “URGENT” in the subject line, and we’ll do our best to respond promptly. Warm regards, Vapi Customer Support Team
v
Thanks for sharing your setup details. To clarify, for each Twilio number, are you assigning a unique SIP URI in the format
sip:YOUR_TWILIO_NUMBER@sip.vapi.ai
as the origination URI in your Twilio SIP trunk, or are all numbers pointing to the same SIP URI? This detail will help determine if routing issues are due to URI configuration. Source: - [Twilio SIP Integration with Vapi](https://docs.vapi.ai/advanced/sip/twilio)
v
Message marked as helpful by @iSlinger! 🎉
i
@Vapi Support Bot Yes in the origination URI, each twilio number is a unique SIP URI that is corresponding to the twilio number
v
To support multiple Twilio numbers with a single Vapi SIP trunk, register each Twilio number as a separate phone number in Vapi using the same SIP trunk credential. For each number, use the following API call (replace placeholders):
Copy code
bash
curl -X POST "https://api.vapi.ai/phone-number" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_VAPI_API_KEY" \
  -d '{
    "provider": "byo-phone-number",
    "name": "Twilio Number 1",
    "number": "YOUR_TWILIO_NUMBER",
    "numberE164CheckEnabled": false,
    "credentialId": "YOUR_CREDENTIAL_ID"
  }'
This ensures each number routes correctly—no need for separate SIP trunks per number. Make sure your Twilio origination URIs match the format
sip:YOUR_TWILIO_NUMBER@sip.vapi.ai
for each number. Source: [Twilio SIP Integration with Vapi](https://docs.vapi.ai/advanced/sip/twilio)
i
@Vapi Support Bot If i want to support inbound calls as well, what is the process?
v
To support inbound calls from multiple Twilio numbers, register each number in Vapi using the same SIP trunk credential. For each Twilio number, use the following API call (replace placeholders):
Copy code
bash
curl -X POST "https://api.vapi.ai/phone-number" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_VAPI_API_KEY" \
  -d '{
    "provider": "byo-phone-number",
    "name": "Twilio Number 1",
    "number": "YOUR_TWILIO_NUMBER",
    "numberE164CheckEnabled": false,
    "credentialId": "YOUR_CREDENTIAL_ID"
  }'
Make sure your Twilio SIP trunk's origination URIs are set to
sip:YOUR_TWILIO_NUMBER@sip.vapi.ai
for each number—this will route inbound calls correctly to Vapi. Source: [Twilio SIP Integration with Vapi](https://docs.vapi.ai/advanced/sip/twilio)
c
Hi iSlinger, if you have an existing phone number on Twilio and would like to use it with Vapi, you can import the number following these steps: 1. In your Twilio console, note down your Account SID and Auth Token (found in "API keys & tokens"). 2. Go to the "Phone Numbers" section in Vapi and click "Import". 3. Enter your Twilio phone number and credentials, then click "Import". [More details on this process can be found here](https://docs.vapi.ai/phone-numbers/import-twilio). Once imported, you can use the number for inbound or outbound calls with assistants configured in Vapi. For international numbers or custom purposes, Vapi supports importing your own numbers from Twilio.
You can update your phone number and attach an assistant id to the phone number id either through dashboard or through API:
i
Thanks Kyle, I've tried all the solutions above I think its more of a twilio thing, if i add multiple numbers to the orgination URI, twilio doesnt know which number to route the inbound number to when I use the same SIP trunk for all the numbers. A work around I have atm is to create a separate SIP trunk for each number
c
Is creating a SIP trunk for each one your preferred method for importing Twilio numbers? Alternatively, you could import them using the native Twilio integration instead of creating a trunk each time.