Configure the Send Text tool
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
Name the tool
Give the tool a name and description. The description tells the assistant when to send a text.
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.
Preset the recipient (optional)
Under To Phone Number (Preset), enter the number to send texts to. See Send texts only to the caller.
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}}.
Set tool messages (optional)
Under Messages, set what the assistant says after the text is sent. See Tool messages.
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:
If you don’t preset the recipient, also tell the assistant which number to use. For example:
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:
- Request Failed (
request-failed), if the text wasn’t sent. - Request Start (
request-start), if you set one. It plays instead of Request Complete. - 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:
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:
- 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.
- 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.