Send SMS using Twilio
Audience:
Low-code EngineersSkill Prerequisites:
Actions,Tokens,Connectors
Sends a text message (SMS) to one phone number through your Twilio account. The ID that Twilio gives the message can be saved in a token.
The action logs in to Twilio with a Twilio connector, which holds your Account SID and Auth Token.
This action is part of the Twilio SMS add-on, which is installed and licensed separately (feature package TWILIOSMS). If it isn't licensed, the action fails with a not-licensed error. You also need a Twilio account with a phone number that can send SMS.
Typical Use Cases
- Send a confirmation code or a booking confirmation after a form is submitted
- Notify staff by SMS when something needs attention, for example a new high-priority request
- Send a message from a workflow or an API endpoint, for example when an order ships
Don't use it to
- Reply to an SMS you've just received on a Twilio webhook. Use Twilio Send Response to SMS Webhook instead. It's simpler and doesn't need a connector.
- Send picture messages (MMS) or send through a Twilio Messaging Service. The action only sends a text body from a phone number or sender ID.
- Send the same message to several numbers in one action. Use it inside Execute Actions for Each List Entry instead.
- Send email. Use Send Email.
Related Actions
| Action Name | Description |
|---|---|
| Twilio Parse Webhook SMS | Reads an incoming SMS that Twilio sends to an API endpoint. |
| Twilio Send Response to SMS Webhook | Replies to an incoming SMS. |
| Send SMS via Clickatell gateway | Sends an SMS through Clickatell instead of Twilio. |
| Add Connector | Creates a connector, for example a Twilio connector, from actions. |
| Execute Actions for Each List Entry | Sends the SMS to each number in a list. |
Input Parameter Reference
The parameters unique to this action are listed below. Review the common parameters for all actions here.
| Parameter | Description | Supports Tokens | Default | Required |
|---|---|---|---|---|
| Twilio API Connector | The Twilio connector to use. Create it on the Connectors page with the type Twilio API keys credential type, and fill in your Account SID and Auth Token from the Twilio Console. | Yes | empty | Yes |
| From Number | The number the message comes from. It must be a number you've bought in your Twilio account, or an alphanumeric sender ID. Write numbers in E.164 format: +, country code, then the number with its area code, for example +15005550006. In some countries, recipients see a sender ID instead of your number. | Yes | empty string | Yes |
| To Number | The number to send the message to, in E.164 format, for example +15555550123. Only one number is supported. | Yes | empty string | Yes |
| Sms Body | The text of the message. | Yes | empty string | Yes |
| Status Callback URL | A URL, for example of an API endpoint, that Twilio calls with an HTTP POST each time the message status changes. The status is in the MessageStatus field, for example delivered or failed. See Twilio's message status values. A relative URL, such as /sms-status, is made absolute with the current site address. | Yes | empty string | No |
| Ignore Errors | When checked, an error doesn't stop the actions that follow. | No | false | No |
| On Error | Actions to run when sending fails. The error text is in [ErrorMessage], and the full exception in [ExceptionString]. | No | empty | No |
Output Parameters Reference
| Parameter | Description |
|---|---|
| Output Token MessageId | The name of a token that receives the message SID Twilio returns, a 34-character ID that starts with SM. If it's empty, the token is [Twilio]. |
How errors are handled
If sending fails, for example because a number is invalid or the Auth Token is wrong, the action:
- Sets
[ErrorMessage]and[ExceptionString]and runs the On Error actions. The two tokens are removed again afterwards. - If an On Error action returns a result, for example a redirect or a response, that result is used.
- If On Error has actions, or Ignore Errors is checked, the next actions run.
- Otherwise the action fails with the Twilio error, and the actions after it don't run.
Considerations
- Accepted isn't delivered. A message SID means Twilio accepted the message, not that it reached the phone. Use Status Callback URL to track delivery.
- The On Error tokens are
[ErrorMessage]and[ExceptionString]. The help text in the action editor mentions[Twilio:ErrorMessage], but that token isn't set. - Use E.164 numbers. Numbers without
+and the country code are usually rejected by Twilio. Strip spaces, dashes and brackets from numbers entered in a form. - Trial accounts can only send to phone numbers you've verified in the Twilio Console.
- Keep credentials in the connector. The Auth Token is stored encrypted in the connector. Don't put it in tokens, settings or examples.
- Long messages are split and charged as several SMS by Twilio.
Examples
To understand how to use the below examples, please see Running Examples.
Replace the Entry value with the ID of your Twilio connector, or pick the connector in the action editor after importing.
1. Send a booking confirmation
This action texts the number entered in the form's Phone field and saves the message SID in [SmsId]. It only runs when a phone number was entered.
{
"Title": "Send SMS using Twilio",
"ActionType": "TwilioSendSms",
"Description": "Text the booking confirmation",
"Condition": "[Phone] != \"\"",
"Parameters": {
"Credentials": {
"Entry": "00000000-0000-0000-0000-000000000000"
},
"FromNumber": "+15005550006",
"ToNumber": "[Phone]",
"SmsBody": "Hi [FirstName], your booking for [BookingDate] is confirmed. Reference: [BookingId]",
"StatusCallbackUrl": "",
"OutputMessageId": "SmsId"
}
}
2. Track delivery and keep going on errors
This action sends an alert to an on-call number, asks Twilio to post status updates to an API endpoint, and continues with the next actions if sending fails. Replace https://www.example.com/sms-status with the URL of your API endpoint, which the API editor shows.
{
"Title": "Send SMS using Twilio",
"ActionType": "TwilioSendSms",
"Description": "Alert the on-call engineer",
"Parameters": {
"Credentials": {
"Entry": "00000000-0000-0000-0000-000000000000"
},
"FromNumber": "+15005550006",
"ToNumber": "+15555550123",
"SmsBody": "New high-priority ticket [TicketId]: [TicketTitle]",
"StatusCallbackUrl": "https://www.example.com/sms-status",
"OutputMessageId": "AlertSmsId",
"IgnoreErrors": true
}
}
Revised 09/27/2026