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

# Twilio

> Send SMS, WhatsApp messages, make calls, and manage communications with Twilio

## At a glance

* **Availability**: Experimental ([how to enable](/cloud/integrations)).
* **Auth**: Basic auth.
* **Connection**: HTTP Basic auth with `TWILIO_ACCOUNT_SID` as the username and `TWILIO_AUTH_TOKEN` as the password.
* **Docs**: [https://www.twilio.com/docs/iam/credentials/api](https://www.twilio.com/docs/iam/credentials/api)

## Credentials

Set these per environment. See [Connect an integration](/cloud/integrations).

| Variable              | Required | Description                                                                                                                        |
| --------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| `TWILIO_ACCOUNT_SID`  | Yes      | Twilio Account SID (starts with AC) [Docs](https://console.twilio.com/).                                                           |
| `TWILIO_AUTH_TOKEN`   | Yes      | Twilio Auth Token [Docs](https://console.twilio.com/).                                                                             |
| `TWILIO_PHONE_NUMBER` | Yes      | Your Twilio phone number (E.164 format: +1234567890) [Docs](https://console.twilio.com/us1/develop/phone-numbers/manage/incoming). |

## Setup

1. **Create a Twilio Account**: Sign up for a free Twilio account at [https://www.twilio.com/try-twilio](https://www.twilio.com/try-twilio)
2. **Get Your Account SID and Auth Token**: Navigate to the Twilio Console Dashboard. Your Account SID and Auth Token are displayed on the main dashboard page. Click the eye icon to reveal your Auth Token.
3. **Get a Phone Number**: Go to Phone Numbers > Manage > Buy a number. Select a phone number with SMS and Voice capabilities. Trial accounts come with one free phone number.
4. **Set Up WhatsApp (Optional)**: To send WhatsApp messages, join the Twilio Sandbox for WhatsApp. Go to Messaging > Try it out > Send a WhatsApp message. Follow the instructions to connect your WhatsApp to the sandbox.
5. **Add Environment Variables**: Add your Twilio credentials to your .env file: - TWILIO\_ACCOUNT\_SID=ACxxxxx - TWILIO\_AUTH\_TOKEN=your\_auth\_token - TWILIO\_PHONE\_NUMBER=+1234567890
6. **Test the Integration**: Try sending a test SMS using the send-sms tool. For trial accounts, you can only send messages to verified phone numbers. Add your phone number at Phone Numbers > Manage > Verified Caller IDs.

* Twilio authenticates with HTTP Basic auth: Account SID as the username and Auth Token as the password
* Trial accounts have limitations: you can only send messages to verified phone numbers
* All trial messages will be prefixed with 'Sent from your Twilio trial account'
* WhatsApp messages require recipients to first opt-in by messaging your sandbox number
* Phone numbers must be in E.164 format: +\[country code]\[number] (e.g., +14155552671)
* Upgrade your account to remove trial restrictions and enable production features

## Tools

| Tool                  | Access | Description                                |
| --------------------- | ------ | ------------------------------------------ |
| Send SMS              | Write  | Send an SMS text message to a phone number |
| Send WhatsApp Message | Write  | Send a WhatsApp message to a phone number  |
| List Messages         | Read   | List recent SMS and WhatsApp messages      |
| Get Message           | Read   | Get details about a specific message       |
| List Calls            | Read   | List recent phone calls                    |

## Example prompts

* Help me send an SMS notification to a customer about their order status.
* Show me the most recent SMS and WhatsApp messages from the last 24 hours.
* Give me a summary of recent calls including duration and status.
* Help me draft and send a WhatsApp message for customer outreach.
