Skip to navigation

Configure the Send Text tool

Create the tool, guide the assistant, and control what the caller hears

Configure the Send Text tool in the dashboard, then add it to an assistant. You choose the sending Twilio number, who the assistant can text, when it sends a text, and what the caller hears afterward. This page also covers how to verify a text was sent and how to troubleshoot texts that weren’t sent.

Before you start, read Send Text tool for what the tool does and its requirements. You need a Twilio number imported into Vapi that can send SMS messages to US numbers.

Create the tool

1

Open the tool form

In the Dashboard, select Tools, then select Create Tool.

2

Select Send Text

Under Phone Call Tools, select Send Text.

3

Name the tool

Give the tool a name and description. The description tells the assistant when to send a text.

4

Choose the sending number

Under From Phone Number, select the Twilio number to send texts from. If the list is empty, import a Twilio number first.

5

Preset the recipient (optional)

Under To Phone Number (Preset), enter the number to send texts to. See Send texts only to the caller.

6

Preset the message (optional)

Under Message Body (Preset), enter the message to send every time. You can include variables, such as Your appointment is confirmed for {{appointmentDate}}.

7

Set tool messages (optional)

Under Messages, set what the assistant says after the text is sent. See Tool messages.

8

Publish and assign the tool

Publish the tool, then add it to your assistant.

Send texts only to the caller

Unless you preset the recipient, the assistant chooses who to text. It can send a text to any number given during the call.

To send texts only to the caller, enter {{customer.number}} under To Phone Number (Preset). The assistant can’t change the recipient, and it only writes the message.

Web calls don’t have a caller phone number. On a web call, a text with this preset isn’t sent, and the tool returns an error.

Tell the assistant when to send a text

Add instructions to your system prompt that say when to send a text and what to include. Refer to the tool by the name you gave it. For example:

After you book the appointment, ask the caller if they'd like a text with the details. If they say yes, use `send_text_tool` to send the date, time, and address.

If you don’t preset the recipient, also tell the assistant which number to use. For example:

Send the text to the number the caller is calling from unless they give you a different number. Repeat the number back before you send.

Tool messages

The Send Text tool has no default messages. If you don’t set any, the assistant says nothing after the text is sent and waits for the caller to speak.

This tool’s messages all play after the text is sent, not before. The first message that applies is the one that plays:

  1. Request Failed (request-failed), if the text wasn’t sent.
  2. Request Start (request-start), if you set one. It plays instead of Request Complete.
  3. Request Complete (request-complete).

Because nothing plays before the text is sent, write any Request Start message as something the caller hears afterward, not “Sending that now.”

We recommend setting a Request Complete message and a Request Failed message, so the caller knows whether to expect a text. In the dashboard, open the tool’s Messages section, select Add Message, choose the message type, and enter your message.

To let the assistant respond in its own words instead of speaking fixed text, set the message role to system through the API. The message content goes to the model as a hint, and the assistant continues the conversation:

{
"messages": [
{
"type": "request-complete",
"role": "system",
"content": "The text was sent. Tell the caller to check their phone, then continue the conversation."
},
{
"type": "request-failed",
"role": "system",
"content": "The text could not be sent. Apologize, read the details out loud instead, then continue the conversation."
}
]
}

To change messages through the API, use the Update Tool endpoint.

Rejection plan

To stop the tool from running under certain conditions, add a tool rejection plan.

Verify the text was sent

Place a test call and ask for a text. Then check these places:

  1. The tool call and its result. In the Dashboard, select Logs, open the call, and select the Messages tab. Find the Send Text tool call to see the number and message the assistant used, and the result that came back. A successful result includes the Twilio message ID. An error result includes an error code.
  2. Your Twilio account. A success result means Twilio accepted the message. To confirm it was delivered, find the message ID in your Twilio Console messaging logs.

Troubleshoot the Send Text tool

What you seeWhat to check
No Send Text tool call in the Messages tabThe assistant didn’t call the tool. Make the system prompt and tool description more specific about when to send a text. See Tell the assistant when to send a text.
The assistant says nothing after the text is sentThe tool has no default messages. Set a Request Complete message. See Tool messages.
The text went to the wrong numberThe assistant chose the recipient. To text only the caller, preset the recipient. See Send texts only to the caller.
The result is a success, but the text didn’t arriveTwilio accepted the message but didn’t deliver it. Find the message ID in your Twilio Console messaging logs, and check the number’s A2P 10DLC or toll-free registration.
The result includes UNSUPPORTED_PROVIDERThe From Phone Number isn’t a Twilio number. Select a number you imported from Twilio.
The result includes CONFIGURATION_ERRORThe From Phone Number wasn’t found in your Vapi account. Select a number from the list, or import it again.
The result includes MISSING_REQUIRED_PARAMETERNo sender, recipient, or message. Check that From Phone Number is set. On web calls, there’s no caller number to text.
The result includes INVALID_FROM_NUMBERThe Twilio number can’t send SMS messages. Check its SMS capability and registration in Twilio.
The result includes INVALID_PHONE_NUMBERThe recipient’s number isn’t valid. Tell the assistant to confirm the number with the caller, including the country code.
The result includes TWILIO_CLIENT_ERRORThe Twilio credentials saved with the phone number don’t work. Update them on the phone number in Vapi.
The result includes INSUFFICIENT_FUNDSYour Twilio account doesn’t have enough balance. Add funds in your Twilio Console.
The result includes TWILIO_API_ERRORTwilio rejected the message for another reason. The result includes Twilio’s error message.
The assistant can’t be saved with the Send Text toolGPT-Live models don’t support the Send Text tool. Use a different model, or remove the tool.