Skip to navigation

Import number from Twilio

Import a new or existing number from Twilio

Overview

As you scale your agents, you may want to use other telephony providers, like Twilio. In this guide, you’ll learn how to add a new or existing Twilio number to Vapi.

Prerequisites

Get started

1

Buy a Twilio phone number (if needed)

If you do not have a Twilio phone number, purchase one from the Buy a number section of the Twilio Console.

Twilio console Buy a Number page with country, capabilities, and search filters above a list of available local numbers, each with a Buy button
The Twilio 'Buy a Number' page in the Twilio console.
2

Get your Twilio credentials

Open the Twilio Console Dashboard and locate Account Info. Copy the Account SID, then reveal and copy the Auth Token. See Twilio’s guide to finding your Auth Token.

Twilio console Account menu open with API keys and tokens highlighted under Keys and Credentials
Navigate to the credentials section of your Twilio account.
Twilio console Live credentials panel showing the Account SID and a hidden Auth token
3

Open the phone number options

Open the Dashboard, select Phone Numbers, and select Create Phone Number.

Phone Numbers panel in the Dashboard with the Create Phone Number button and a Search Phone Numbers field
Create a phone number

Choose Import Twilio under Phone Number Options.

4

Enter the Twilio number and credentials

Enter the number, including its country code, in Twilio Phone Number. Enter your Twilio Account SID and Twilio Auth Token.

Optionally, enter a descriptive Label and choose whether SMS Enabled should be on. Then select Import from Twilio.

Phone Number Options dialog in the Dashboard with Import Twilio selected and fields for Twilio Phone Number, Twilio Account SID, Twilio Auth Token, Label, and an SMS Enabled toggle
Import a Twilio phone number
5

Use the imported number

Open the imported phone number. You can now assign it to an assistant for inbound calls or use it to place outbound calls.

If outbound calls fail before the phone rings, see Troubleshoot call connection errors.

Outbound transport settings

Set transportConfigurations on the assistant through the API to configure outbound calls and warm-transfer legs placed through Twilio. These settings have no Dashboard control.

{
"transportConfigurations": [
{
"provider": "twilio",
"timeout": 30,
"record": true,
"recordingChannels": "dual"
}
]
}
FieldDefaultBehavior
timeout60Seconds to let the destination ring before treating the call as unanswered. This is not a conversation-duration or silence timeout. For some call flows, Twilio adds 5 seconds to timeout, so the destination can ring for up to timeout + 5 seconds.
recordfalseEnables recording in your Twilio account. Requires your own Twilio credentials on the phone number. Without them, record is turned off, including on Vapi numbers.
recordingChannelsmonomono combines both call legs in one channel. dual puts the parent call in the first channel and the child call in the second. Applies when record is true.

Recording in your Twilio account is separate from Vapi’s artifactPlan recording. To control Vapi’s recordings, configure artifactPlan. The transport settings control recordings in your Twilio account.