# Twilio

{% hint style="info" %}
The **HTTP API datasource** will be used to connect to Twilio API.
{% endhint %}

## Configuration

### Prerequisites

Before connecting the data source, you'll need to obtain the necessary parameters for authentication.

Twilio supports [HTTP Basic Authentication](/reference/data-sources/http/api-authentication.md#basic-auth). For this type of authentication, you'll need your **Twilio account SID** as the username and your **auth token** as the password. You can find these credentials in the [Twilio console](https://www.twilio.com/login?g=%2Fconsole%3F\&t=2b1c98334b25c1a785ef15b6556396290e3c704a9b57fc40687cbccd79c46a8c).

<figure><img src="/files/B4ge7e1hhL3GfZ7y8AMW" alt=""><figcaption></figcaption></figure>

If you want to use [API keys](https://www.twilio.com/docs/usage/api/keys) to authenticate instead of your Twilio account SID and auth token, then you can use the **API key** as the username and your **API key’s secret** as the password. \
You can learn more about Twilio authentication in their [documentation](https://www.twilio.com/docs/usage/api#authenticate-with-http).

### Connecting the data source

Once you have the credentials, you can proceed to connecting your Twilio data source:

1. On the **Data sources** page, click **Connect**, and select *HTTP API* in the Data sources list.
2. Next, specify the **Base URL** - `https://api.twilio.com/api_version`.
3. Select **Basic Auth** in the *Authentication settings* dropdown and specify your account SID & auth token/API key & API key secret in the *Username* and *Password* fields respectively.
4. Finally, click **Connect Datasource** to complete the setup.

<figure><img src="/files/9bCmvdoc0w2T3oYeHZck" alt=""><figcaption></figcaption></figure>

## Usage

Once you've established the connection between UI Bakery and your Twilio API, you can start interacting with its data. For this purpose, you'll need to use the [HTTP Request](/reference/working-with-actions/http-request.md) action step.

Refer to [Twilio documentation](https://www.twilio.com/docs/messaging/api/message-resource) to learn more about Twilio requests.

{% hint style="info" %}
If you want to send messages in *trial* mode, you must first [verify your 'To' phone number with Twilio](https://support.twilio.com/hc/en-us/articles/223135427-What-s-the-difference-between-a-verified-phone-number-and-a-Twilio-phone-number-). You can verify it by adding the number to your [Verified Caller IDs](https://www.twilio.com/console/phone-numbers/verified) in the console.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.uibakery.io/reference/data-sources/twilio.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
