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

# Twilio

> Connect Twilio to Rocket and send SMS verification codes, alerts, and notifications - all wired up from chat.

export const LlmsDirective = () => <blockquote className="llms-directive">
    For the complete documentation index, see <a href="/llms.txt">llms.txt</a>.
    For a lightweight markdown version of this page, append .md to the URL.
  </blockquote>;

<LlmsDirective />

Describe the SMS flow you want in chat and Rocket generates the complete logic - message templates, sending API calls, phone number formatting, and delivery tracking.

<Divider />

## What you can do

<CardGroup cols={2}>
  <Card title="SMS verification codes" icon="shield-check">
    One-time codes for account verification, email confirmation, or identity checks.
  </Card>

  <Card title="Two-factor authentication" icon="lock">
    An extra layer of security with SMS-based verification during login.
  </Card>

  <Card title="Order and shipping updates" icon="truck">
    SMS notifications when order status changes, from confirmation to delivery.
  </Card>

  <Card title="Appointment reminders" icon="calendar-check">
    Automated SMS reminders before scheduled appointments, meetings, or events.
  </Card>

  <Card title="Alert and notification system" icon="bell">
    Time-sensitive alerts for system events, threshold warnings, or custom triggers.
  </Card>
</CardGroup>

<Divider />

## Before you connect

You need three values from the [Twilio Console](https://console.twilio.com/):

* **Account SID** - found on the Twilio Console dashboard
* **Auth Token** - found on the Twilio Console dashboard
* **From Phone Number** - your Twilio number in E.164 format, e.g. `+15551234567`

<Card icon="link" horizontal href="https://help.twilio.com/articles/223136027-Auth-Tokens-and-How-to-Change-Them" arrow="true">
  **How to find your Auth Token and Account SID** - Twilio Help Center
</Card>

<Warning>
  Never paste your Account SID or Auth Token directly into chat. Always use the secure connection popup.
</Warning>

<Note>
  Twilio is a **task-level** connector. Each Rocket task connects to its own Twilio credentials independently.
</Note>

<Divider />

## Connect Twilio

<Tabs>
  <Tab title="Web Browser">
    You can connect from two places - both open the same popup.

    **Option 1: From chat**

    Type a prompt that mentions SMS - for example, `Connect Twilio and send an SMS verification code when a user signs up`. Rocket detects the intent and shows a **Connect** button inline. Click it and the popup opens.

    <Frame caption="Twilio connection prompt in chat">
      <img src="https://mintcdn.com/dhiwisepvtltd-5e04e6a4/nQEvQeJSI0J08ewY/images/build-docs/connectors/twilio/web-browser/twilio-chat-light.webp?fit=max&auto=format&n=nQEvQeJSI0J08ewY&q=85&s=4d3a9e73683978bb6d3ee9d815f46e2d" alt="Twilio connection prompt in the Rocket chat panel." className="theme-image light-image" width="2880" height="1624" data-path="images/build-docs/connectors/twilio/web-browser/twilio-chat-light.webp" />

      <img src="https://mintcdn.com/dhiwisepvtltd-5e04e6a4/nQEvQeJSI0J08ewY/images/build-docs/connectors/twilio/web-browser/twilio-chat-dark.webp?fit=max&auto=format&n=nQEvQeJSI0J08ewY&q=85&s=099a1d181ef754557f52590302d25584" alt="Twilio connection prompt in the Rocket chat panel." className="theme-image dark-image" width="2880" height="1624" data-path="images/build-docs/connectors/twilio/web-browser/twilio-chat-dark.webp" />
    </Frame>

    **Option 2: From the Connectors tab**

    Click the **`...`** button in the preview toolbar, then select **Connectors**.

    <Frame caption="Open Connectors from the toolbar">
      <img src="https://mintcdn.com/dhiwisepvtltd-5e04e6a4/2lqYWidv_xVHKfL6/images/build-docs/connectors/shared/connectors-tab-open-light.webp?fit=max&auto=format&n=2lqYWidv_xVHKfL6&q=85&s=7bd785a0e878564054e08328b2aa3d6b" alt="Toolbar dropdown with Connectors option highlighted." className="theme-image light-image" width="2880" height="1624" data-path="images/build-docs/connectors/shared/connectors-tab-open-light.webp" />

      <img src="https://mintcdn.com/dhiwisepvtltd-5e04e6a4/2lqYWidv_xVHKfL6/images/build-docs/connectors/shared/connectors-tab-open-dark.webp?fit=max&auto=format&n=2lqYWidv_xVHKfL6&q=85&s=d047040372d776cb47e4e483de8eeb8d" alt="Toolbar dropdown with Connectors option highlighted." className="theme-image dark-image" width="2880" height="1624" data-path="images/build-docs/connectors/shared/connectors-tab-open-dark.webp" />
    </Frame>

    Click the **Twilio** card, then click **Connect**.

    <Frame caption="Twilio card in the Connectors panel">
      <img src="https://mintcdn.com/dhiwisepvtltd-5e04e6a4/nQEvQeJSI0J08ewY/images/build-docs/connectors/twilio/web-browser/twilio-connectors-tab-light.webp?fit=max&auto=format&n=nQEvQeJSI0J08ewY&q=85&s=a207dad2b45284d71340c9cf610ef593" alt="Connectors panel showing the Twilio card with a Connect button." className="theme-image light-image" width="1812" height="523" data-path="images/build-docs/connectors/twilio/web-browser/twilio-connectors-tab-light.webp" />

      <img src="https://mintcdn.com/dhiwisepvtltd-5e04e6a4/nQEvQeJSI0J08ewY/images/build-docs/connectors/twilio/web-browser/twilio-connectors-tab-dark.webp?fit=max&auto=format&n=nQEvQeJSI0J08ewY&q=85&s=183447e2701fe3cf2127217596afe984" alt="Connectors panel showing the Twilio card with a Connect button." className="theme-image dark-image" width="1810" height="518" data-path="images/build-docs/connectors/twilio/web-browser/twilio-connectors-tab-dark.webp" />
    </Frame>

    **After clicking Connect**

    A popup opens. Enter your **Account SID**, **Auth Token**, and **From Phone Number**, then click **Connect**.

    <Frame caption="Connect Twilio popup">
      <img src="https://mintcdn.com/dhiwisepvtltd-5e04e6a4/nQEvQeJSI0J08ewY/images/build-docs/connectors/twilio/web-browser/twilio-popup-light.webp?fit=max&auto=format&n=nQEvQeJSI0J08ewY&q=85&s=8d223d1d44fa4c8b0f2e466da37f4a59" alt="Connect Twilio popup with Account SID, Auth Token, and From phone number fields." className="theme-image light-image" width="844" height="782" data-path="images/build-docs/connectors/twilio/web-browser/twilio-popup-light.webp" />

      <img src="https://mintcdn.com/dhiwisepvtltd-5e04e6a4/nQEvQeJSI0J08ewY/images/build-docs/connectors/twilio/web-browser/twilio-popup-dark.webp?fit=max&auto=format&n=nQEvQeJSI0J08ewY&q=85&s=d160e3d076454efa41068f971e5fa620" alt="Connect Twilio popup with Account SID, Auth Token, and From phone number fields." className="theme-image dark-image" width="844" height="782" data-path="images/build-docs/connectors/twilio/web-browser/twilio-popup-dark.webp" />
    </Frame>

    A green dot appears next to Twilio when the connection is active.

    **Update or disconnect**

    Go to [**Connectors > Twilio**](#connect-twilio). Click **Edit** to update your credentials or **Disconnect** to remove the integration.

    <Frame caption="Edit and Disconnect options on a connected Twilio card">
      <img src="https://mintcdn.com/dhiwisepvtltd-5e04e6a4/nQEvQeJSI0J08ewY/images/build-docs/connectors/twilio/web-browser/twilio-disconnect-light.webp?fit=max&auto=format&n=nQEvQeJSI0J08ewY&q=85&s=0289310be469ebc603054dbdd674563e" alt="Twilio card showing Edit and Disconnect buttons." className="theme-image light-image" width="1813" height="516" data-path="images/build-docs/connectors/twilio/web-browser/twilio-disconnect-light.webp" />

      <img src="https://mintcdn.com/dhiwisepvtltd-5e04e6a4/nQEvQeJSI0J08ewY/images/build-docs/connectors/twilio/web-browser/twilio-disconnect-dark.webp?fit=max&auto=format&n=nQEvQeJSI0J08ewY&q=85&s=a9652623bcba7e0e63d5bc7352828406" alt="Twilio card showing Edit and Disconnect buttons." className="theme-image dark-image" width="1815" height="529" data-path="images/build-docs/connectors/twilio/web-browser/twilio-disconnect-dark.webp" />
    </Frame>
  </Tab>

  <Tab title="Mobile App">
    You can connect from two places - both open the same popup.

    **Option 1: From chat**

    Type a prompt that mentions SMS. Rocket detects the intent, shows a **Connect** button, and the popup opens when you tap it.

    **Option 2: From the Connectors tab**

    1. Tap the **More** button in the header.
    2. Tap **Integrations**.
    3. Tap the **Twilio** card, then tap **Connect**.

    **After tapping Connect**

    A popup opens. Enter your **Account SID**, **Auth Token**, and **From Phone Number**, then tap **Done**.

    A green dot appears next to Twilio when the connection is active.

    **Update or disconnect**

    Go back to the **Twilio** card in Integrations. Tap **Edit** to update credentials or **Disconnect** to remove it from this task.
  </Tab>
</Tabs>

<Divider />

## Example prompts

| What you want        | Prompt to use                                                                                           |
| :------------------- | :------------------------------------------------------------------------------------------------------ |
| Verification code    | `Send a 6-digit SMS verification code through Twilio when a user signs up. Expire it after 10 minutes.` |
| Two-factor auth      | `Add SMS-based two-factor auth to my login flow. Send a code via Twilio after password entry.`          |
| Order confirmation   | `Send an SMS through Twilio when a user completes checkout with their order number and total.`          |
| Shipping update      | `Send an SMS through Twilio when an order ships with the tracking number and carrier link.`             |
| Appointment reminder | `Send an SMS reminder 24 hours before a scheduled appointment with date, time, and reschedule link.`    |
| Password reset       | `Send an SMS with a one-time code for password reset. Expire the code after 5 minutes.`                 |
| Low balance alert    | `Send an SMS alert when a user's account balance drops below $5. Include a link to add funds.`          |
| Welcome message      | `Send a welcome SMS through Twilio when a new user creates an account.`                                 |
| Flash sale alert     | `Send an SMS to opted-in users announcing a 24-hour flash sale.`                                        |

<Divider />

## Tips

* **Pair with Supabase.** Rocket stores verification codes and user phone numbers in Supabase. Connect Supabase before Twilio for the best results.
* **Trial accounts have restrictions.** On a Twilio trial account, you can only send SMS to verified numbers. Upgrade before going live.
* **Phone numbers must be in E.164 format.** Always include the country code, e.g. `+15551234567`.
* **SMS costs vary by country.** Twilio charges per message based on destination. Check [Twilio's pricing page](https://www.twilio.com/en-us/sms/pricing/us) for current rates.
* **One Twilio account per task.** Each Rocket task connects to one set of Twilio credentials. Use different tasks for different Twilio accounts.

<Divider />

## What's next?

<CardGroup cols={2}>
  <Card title="Supabase" icon="database" href="./supabase/overview">
    Store phone numbers and verification codes. Recommended for most Twilio SMS flows.
  </Card>

  <Card title="Stripe" icon="credit-card" href="./stripe">
    Send SMS order confirmations and payment alerts after Stripe transactions.
  </Card>

  <Card title="Resend" icon="paper-plane" href="./resend">
    Combine SMS notifications with email for multi-channel communication.
  </Card>

  <Card title="All connectors" icon="plug" href="/build/connectors/overview">
    Browse every available integration.
  </Card>
</CardGroup>
