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

# Text customers from your AI agent with the Send SMS Action

> Let your AI agent text a customer a confirmation, a link, or an update from one of your Twilio numbers

The **Send SMS** Action lets your AI agent text the person it's talking to from one of your Twilio numbers. You write the message once, with placeholders for the details the AI agent picks up in the conversation, and the AI agent sends it when the customer asks for it or when a text would help. The conversation keeps going while the text goes out.

> [card] Best for:
>
> Sending something the customer will want to keep: a booking confirmation, a link, or an order update.

**Common Use Cases:**

* "Can you text me the details?"
* "Send me the link by SMS"
* Confirming an appointment the AI agent just booked

## Before you start

* [Connect Twilio](https://chatbase.co/docs/user-guides/integrations/twilio.md) and import at least one number that can send SMS.
* Turn on the countries you'll text in Twilio. Twilio blocks SMS to any country that isn't turned on. In the Twilio Console, go to **Messaging → Settings → Geo permissions**.
* Send SMS is available on the Basic plan or higher.

## Who gets the text

The text goes to the person in the conversation, and only to them:

* **On a phone call:** the number the caller is calling from.
* **On other channels:** the phone number saved on the signed-in user's [Contact](https://chatbase.co/docs/user-guides/chatbot/contacts/contacts-overview.md). Visitors who aren't signed in, or whose contact has no phone number, can't be texted.

Before sending, the AI agent mentions the last four digits and asks the customer to confirm the number. It never sends to a number the customer types in. If there's no number to text, it tells the customer it can't text them here and doesn't ask for one.

## How to create the Action

**1. Navigate to Actions**

Go to your [Chatbase dashboard](https://www.chatbase.co/dashboard/) and select your AI agent. Click **Build > Actions** in the left sidebar.

**2. Create the Action**

Click **Create Action**, then select **Send SMS**.

**3. Configure General Settings**

**Action name:** A name that says what the text is for, such as `SMS_Booking_Confirmation`. Spaces turn into underscores as you type. If you send different kinds of texts, create one Send SMS Action for each so the AI agent can tell them apart.

**When to use:** Describe when the AI agent should send the text, with a few phrases customers use. The default covers the common case, and **Reset** brings it back.

To restrict the Action to [Procedure](https://chatbase.co/docs/user-guides/chatbot/procedures/procedures-overview.md) steps only, turn on [**Only use in Procedures**](https://chatbase.co/docs/user-guides/chatbot/actions/actions-overview.md#only-use-in-procedures).

**4. Write the message**

Pick the number to send from and write the message. See [Settings](#settings) below.

**5. Choose Channels**

Turn the Action on for the channels where the AI agent should be able to text. See [Channels](https://chatbase.co/docs/user-guides/chatbot/actions/actions-overview.md#channels).

**6. Enable and Test**

Click **Enable**, then ask the AI agent to text you. You can't enable the Action until a number and a message are set.

## Settings

**Send from:** The Twilio number the text comes from. The list shows the Twilio numbers on this AI agent, with their friendly name if they have one. A number that Twilio says can't send SMS is marked **Can't send SMS** and can't be picked. **Manage numbers** opens the page where your phone numbers are listed.

**Data inputs (optional):** Details the AI agent collects in the conversation before it sends, such as an appointment time or an order number. You can add up to 20. Each value is cut to 200 characters when it goes into the message.

**Message:** The text itself, up to 1,600 characters. Type `{{` to insert a data input or a variable:

```text theme={null}
Hi, we have received your appointment for {{appointmentTime}}.
```

### Variables

| Variable | Value |
| - | - |
| `{{conversationId}}` | The ID of the current conversation |
| `{{userId}}` | The signed-in user's ID, set with the identify method. Empty for anonymous visitors |
| `{{callerPhone}}` | The caller's number from caller ID, on phone calls only. Caller ID isn't verified |
| `{{contact.id}}`, `{{contact.external_id}}`, `{{contact.email}}`, `{{contact.name}}`, `{{contact.phonenumber}}`, `{{contact.created_at}}`, `{{contact.updated_at}}` | Fields of the [Contact](https://chatbase.co/docs/user-guides/chatbot/contacts/contacts-overview.md) linked to the conversation |

## When a text fails

If Twilio rejects the text, the AI agent tells the customer it couldn't send it and carries on with the conversation. Twilio's error code and message are saved on the Action's result, so you can see the reason in [Activity](https://chatbase.co/docs/user-guides/chatbot/activity.md).

If the error is about the destination country, turn that country on in Twilio's **Geo permissions** and try again.

## Other texts on phone calls

Two other features text callers without a Send SMS Action. Both send from the Twilio number the caller dialed:

* **Payment links:** a Shopify [Create order](https://chatbase.co/docs/user-guides/chatbot/actions/shopify-actions.md#4-create-order) Action set to **Online payment** texts the checkout link to the caller.
* **Helpdesk replies:** your team's replies to phone tickets can go out as texts. See [Replying to phone tickets](https://chatbase.co/docs/user-guides/chatbot/help-desk/help-desk-overview.md#replying-to-phone-tickets).

## Limitations

* **3 texts per conversation.** After the third, the AI agent tells the customer it can't send more texts here.
* **Twilio numbers only.** SIP trunk numbers can't send texts.
* **Only the customer's own number.** The AI agent can't text a number the customer gives it.
* **No v1 Chat API.** The Action doesn't run on conversations through the v1 Chat API.
* **Twilio bills each text** on your Twilio account.

## Frequently asked questions

> [accordion] Can the AI agent text a different number than the one I'm calling from?
>
> No. On a call it texts the caller's own number, and on other channels the number saved on the signed-in user's Contact.

> [accordion] Why can't I pick my number in Send from?
>
> It's marked **Can't send SMS** because Twilio reports that the number has no SMS capability. Check the number's capabilities in Twilio, or buy a number that supports SMS and import it.

> [accordion] The customer didn't get the text. Where do I look?
>
> Open the conversation in [Activity](https://chatbase.co/docs/user-guides/chatbot/activity.md) and check the Send SMS result for Twilio's error. If the result is a success but the text never arrived, check the message's delivery status in your Twilio Console logs.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.