# Connecting Twilio Numbers

This guide will walk through how to connect a Twilio Number to Airkit and be used as a Voice or SMS Resource. This enables the ability to leverage the Voice and SMS capabilities within the platform, such as sending an SMS to update a user or having a Journey get triggered by an inbound call.&#x20;

**Prerequisites:**

1. Access to a Twilio Account
2. Have an available number associated with the [Twilio Account](https://support.twilio.com/hc/en-us/articles/223135247-How-to-Search-for-and-Buy-a-Twilio-Phone-Number-from-Console).

### Setting up the integration in the Console

To connect Twilio with an Airkit application, follow these steps:

1. Once in the Console, go on **Integrations > Credentials** and click on **Create new**
2. Name the integration and from **Integration** select Twilio.

![](https://1191388742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhOn9CLWoV9VfJeM5EDAa%2Fuploads%2Fgit-blob-ce8812e546406a230d1866028d3cbfa51b1b47f5%2Fconnecting-twilio-numbers-v1715-0.png?alt=media)

3. Since the Username and Password are from Twilio, go to your Twilio account and copy the Account SID and an Auth Token from the dashboard:

* **Username** = Account SID
* **Password** = Auth Token

![](https://1191388742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhOn9CLWoV9VfJeM5EDAa%2Fuploads%2Fgit-blob-876251a6b08909b30de791e288e3a8da78ef2141%2Fconnecting-twilio-numbers-v1715-1.png?alt=media)

### Set up the phone number as a Resource

1. In the Console, go to **Resources** anc click on **Create new**.
2. Add a name to describe the Resource and, in **Capabilities**, select **Send Text Message** to set up a Chat Bot or **Send Voice** to set up a Voice Bot.

![](https://1191388742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhOn9CLWoV9VfJeM5EDAa%2Fuploads%2Fgit-blob-31a1e0bd5161d7f3da7f470e1d5ac25eca1b5b31%2Fconnecting-twilio-numbers-v1715-2.png?alt=media)

3. In **Datasource**, select the one that was created in the previous step.

### Setting up the SMS Resource in your app

1. Once inside the app, go to **Configuration builder** and scroll down to **Chat Bot.** Then select the SMS Resource that was created in the previous step. It should show up as the name previously provided.

![](https://1191388742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhOn9CLWoV9VfJeM5EDAa%2Fuploads%2Fgit-blob-e1d90e887b5f70608fdacf2fbf97a39fbbaa63ae%2Fconnecting-twilio-numbers-v1715-3.png?alt=media)

The app will now send SMS through the number provided.

### Setting up a Voice Resource in your app

This section will cover how to set up a phone number to be used via voice

1. Once inside the app, go to **Configuration builder** and scroll down to **Voice Bot.** Then select the Voice Resource that was created in the previous step. It should show up as the name previously provided.

![](https://1191388742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhOn9CLWoV9VfJeM5EDAa%2Fuploads%2Fgit-blob-72c265f42c7adbe40a5de6559491f094b223d102%2Fconnecting-twilio-numbers-v1715-4.png?alt=media)

The app will now use the Twilio integration for voice resources.

* **Voice Locked Behavior:** What action to take if someone calls in with the same number in a live session.

### Next Steps

Once the Twilio account is connected, it can then be used to integrate with the chat bots and voice bots in **Web Builder**. Also, when dealing with phone numbers in your app, it is best practice to use the [FORMAT\_PHONE](../airscript-expressions/phone-functions/format_phone) function to ensure the phone number gets passed with the region correctly.
