Skip to content

Commit 41bc773

Browse files
cursoragentsahil
andcommitted
Update Twilio import guide with API key details and improved instructions
Co-authored-by: sahil <[email protected]>
1 parent f36d019 commit 41bc773

File tree

1 file changed

+43
-15
lines changed

1 file changed

+43
-15
lines changed
Lines changed: 43 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
22
title: Import number from Twilio
3-
subtitle: Import a new or existing number from Twilio
3+
subtitle: Import a new or existing number from Twilio using API Keys
44
slug: phone-numbers/import-twilio
55
---
66

77
## Overview
88

9-
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.
9+
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 using a Twilio API Key (recommended) instead of an Auth Token. Restricted API Keys are supported and preferred for least‑privilege access.
1010

1111
## Prerequisites
1212

@@ -15,35 +15,63 @@ As you scale your agents, you may want to use other telephony providers, like Tw
1515
## Get started
1616

1717
<Steps>
18-
<Step title="Buy a Phone Number via Twilio (if needed)">
18+
<Step title="Buy a phone number in Twilio (if needed)">
1919
If you don't have a Twilio number, purchase one in your Twilio console's "Buy a number" section.
2020
<Frame caption="The Twilio 'Buy a Number' page in the Twilio console.">
2121
<img src="../static/images/quickstart/phone/buy-phone-number-twilio.png" />
2222
</Frame>
2323
</Step>
24-
<Step title="Get Your Twilio Account SID & Auth Token">
25-
In your Twilio console, go to "API keys & tokens" to find your Account SID and Auth Token.
26-
<Frame caption="Navigate to the credentials section of your Twilio account.">
24+
<Step title="Create a Twilio API Key (Restricted or Standard)">
25+
Use a Restricted API Key for least‑privilege access. You'll provide this key to Vapi when importing your number.
26+
<Info>Restricted keys are available to all Twilio users—no access request needed.</Info>
27+
28+
1. In the Twilio console, open <b>API keys & tokens</b> and click <b>Create new API key</b>.
29+
<Frame caption="Navigate to the API Keys & Tokens section in Twilio.">
2730
<img src="../static/images/quickstart/phone/twilio-api-key-nav.png" />
2831
</Frame>
29-
<Frame>
30-
<img src="../static/images/quickstart/phone/twilio-credentials.png" />
31-
</Frame>
32+
2. Give the key a friendly name and choose <b>Restricted (Beta)</b> as the type.
33+
3. Grant the following permissions:
34+
35+
- <b>Voice → Calls</b>: Read, List, Create, Update, Delete
36+
- <b>Voice → Conferences</b>: Read, List, Create, Update, Delete
37+
- <b>Phone Numbers → Active Numbers</b>: Read, List, Create, Update, Delete
38+
39+
4. Click <b>Create</b>, then securely copy the <b>API Key SID</b> and <b>Secret</b>.
40+
<Warning>The Secret is shown only once. Store it in a secure location.</Warning>
3241
</Step>
33-
<Step title="Import Your Number in the Vapi Dashboard">
34-
1. Go to the "Phone Numbers" section in Vapi and click "Import".
42+
<Step title="Import your number in the Vapi Dashboard">
43+
1. Go to the <b>Phone numbers</b> section in Vapi and click <b>Import</b>.
3544
<Frame caption="Click 'Import' in the 'Phone Numbers' tab of your dashboard.">
3645
<img src="../static/images/quickstart/phone/dashboard-import-phone-number.png" />
3746
</Frame>
38-
2. Enter your phone number and Twilio credentials, then click "Import".
47+
2. Enter your phone number, Twilio <b>Account SID</b>, <b>API Key SID</b>, and <b>API Secret</b>, then click <b>Import</b>.
3948
<Frame>
4049
<img src="../static/images/quickstart/phone/import-twilio-number-dashboard.png" />
4150
</Frame>
4251
</Step>
43-
<Step title="Your number is ready now ready">
44-
You can use the number with an assistant for inbound or outbound calls.
52+
<Step title="Import via API (optional)">
53+
Use the API to import your Twilio number programmatically using your API Key SID/Secret.
54+
55+
```bash title="Import Twilio number with API Key"
56+
curl -X POST https://api.vapi.ai/phone-number \
57+
-H "Authorization: Bearer <token>" \
58+
-H "Content-Type: application/json" \
59+
-d '{
60+
"provider": "twilio",
61+
"number": "+15551234567",
62+
"twilioAccountSid": "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
63+
"smsEnabled": false,
64+
"twilioApiKey": "SKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
65+
"twilioApiSecret": "<YOUR_TWILIO_API_SECRET>"
66+
}'
67+
```
68+
</Step>
69+
<Step title="Your number is ready">
70+
You can now use the number with an assistant for inbound or outbound calls.
4571
<Frame caption="The phone number detail page, where you can configure your phone number.">
4672
<img src="../static/images/quickstart/phone/phone-number-import-complete.png" />
4773
</Frame>
4874
</Step>
49-
</Steps>
75+
</Steps>
76+
77+
<Tip>If you previously imported numbers using an Auth Token, you can continue doing so. However, using a Restricted API Key is recommended for better security and tighter scope.</Tip>

0 commit comments

Comments
 (0)