> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bland.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Custom Twilio Integration

> Connect Bland to your own Twilio account

## Overview

Users can connect their own Twilio account to Bland. Easily bring over your existing phone numbers, integrations, and more.

Pre-requisites:

* Your own Twilio account

## Step 1: Creating an Encrypted Key with your Twilio Credentials

1. Go to your [Twilio Console](https://www.twilio.com/console) and get your Account SID and Auth Token.
2. Create an `encrypted_key` by either:
   * Going to the BYOT page in the [Bland Dashboard](https://app.bland.ai/dashboard/add-ons) and clicking "Generate New Key", or
   * [Sending an API request](/api-v1/post/accounts) to Bland.

This is the only time that your `encrypted_key` will be returned to you. Make sure to store it securely, and new keys will need to be generated if lost.

## Step 2: Importing Inbound numbers

1. The phone numbers in your Twilio account will appear on the [Add-ons page](https://app.bland.ai/dashboard/add-ons) under "BYOT" (Bring Your Own Twilio).
2. From there, you can select specific numbers to import into your Bland account by selecting the specific numbers and importing them through the dashboard or through [sending an API request](/api-v1/post/inbound-insert).
3. Once imported, these numbers can be used for both inbound and outbound calls through Bland's infrastructure.

## Step 3: Using the Encrypted Key in Outbound Calls

Include `encrypted_key` in the body (in addition to the `Authorization` header) of your [send call API requests](/api-v1/post/calls#param-encrypted-key), and we'll use that account's credentials to make the call.

For example:

```bash theme={null}
curl --location 'https://api.bland.ai/v1/calls' \
--header 'Content-Type: application/json' \
--header 'Authorization: [YOUR_BLAND_API_KEY]' \
--header 'encrypted_key: [YOUR_ENCRYPTED_KEY]' \
--data '{
  "from": "+1234567890",
  "phone_number": "+10987654321",
  "task": "Ask the user how their day is going"
}
```

Note:

* You can set your `from` number in the API request - this will need to be a number owned by that Twilio account (and not one purchased through Bland).
* By default, we'll send calls from a randomly selected number in the specified Twilio account if a `from` is not specified.

## Step 4: Configuring Inbound Numbers/Webhooks

## Note: When updating inbound numbers, the headers need to include the `encrypted_key` in addition to the `Authorization` header. Doing so makes sure the updates are applied to the correct Twilio account.

Docs for agents: [llms.txt](/llms.txt)
