Twilio Send SMS
Sends an SMS from your Twilio account, using the Twilio connection set up on your dashboard.
Twilio Send SMS
Sends an SMS from your Twilio account, using the Twilio connection set up on your dashboard.
Use it to send a customer a text from a flow, for example a link, a confirmation or an update during or after a voice call.
Before you start
This action uses a Twilio connection for its credentials, so you never put API keys or tokens in your flow.
- In Twilio, create an API key (Account → API keys & tokens). Note its SID (starts with
SK) and secret. - On the DigitalGenius dashboard, go to Modules → Twilio and add a connection:
| Field | What to enter |
|---|---|
| Username | The API key SID (SK…) |
| Password | The API key secret |
| AccountSid | Your Twilio Account SID (AC…) |
| api_hostname | api.twilio.com, unless your Twilio account uses a non-US region (for example api.dublin.ie1.twilio.com for Ireland). Leave the default if you're not sure. |
- In Flow Builder, add the Twilio Send SMS action and select this connection on it.
Use an API key, not your Auth TokenAn API key can be revoked on its own without affecting the rest of your Twilio account.
You also need a Twilio number that can send SMS, or a Twilio Messaging Service.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| To | String | Yes | Phone number to send the SMS to, in E.164 format, for example +12345678901. |
| Message | String | Yes | Text of the SMS. |
| From | Optional String | One of From or Messaging Service SID | Twilio phone number (E.164) or alphanumeric sender ID to send from. |
| Messaging Service SID | Optional String | One of From or Messaging Service SID | Twilio Messaging Service SID (starts with MG). Use it instead of From to let Twilio pick the sender. |
| Safe Mode | Optional Boolean | No | Default false. See Safe Mode below. |
Outputs
| Name | Type | Description |
|---|---|---|
| Success | Boolean | true when Twilio accepted the message. |
| Message SID | String | Twilio's ID for the message (starts with SM). Use it to look the message up in the Twilio console. |
| Status | String | The message's status when it was created, usually queued or accepted. |
| Error Message | String | What went wrong. Only returned when Safe Mode is on and the action fails. |
Success means accepted, not deliveredTwilio sends the SMS after the action finishes.
Success = truemeans Twilio accepted and queued it. To check whether it was delivered, look up the Message SID in the Twilio console.
Safe Mode
- Off (default): if the SMS can't be sent, the action fails and the flow stops.
- On: the action returns
Success = falsewith an Error Message, and the flow carries on. Use this when the flow should continue even if the text isn't sent, for example to fall back to email.
Common errors
| Error | What it means |
|---|---|
Missing Twilio connection | No Twilio connection is selected on the action. |
Twilio connection has no valid Account SID | The connection's AccountSid field is empty or isn't an AC… SID. |
From or Messaging Service SID is required | Neither input was mapped. |
Twilio error 20003 | Twilio rejected the credentials. Check the API key SID and secret on the connection, and that api_hostname matches the region the key was created in. |
Twilio error 21211 | The To number isn't a valid phone number. Make sure it's in E.164 format. |
Twilio error 21606 / 21659 | The From number can't send SMS, or doesn't belong to this Twilio account. |
For any other code, see Twilio's error reference.
Example
Send an order confirmation link after a call:
| Input | Value |
|---|---|
| To | {{Caller Phone Number}} |
| Message | Thanks for calling! Track your order here: {{Tracking Link}} |
| From | +15555550199 |
| Safe Mode | true |
Output:
{
"success": true,
"message_sid": "SM0123456789abcdef0123456789abcdef",
"status": "queued"
}Updated about 10 hours ago
