Twilio¶
URL Format¶
twilio://accountSID:authToken@fromNumber/toNumber[/toNumber2/...]
URL Fields¶
- AccountSID - Twilio Account SID (Required)
URL part:twilio://accountsid:authtoken@fromnumber/tonumbers/ - AuthToken - Twilio Auth Token (Required)
URL part:twilio://accountsid:authtoken@fromnumber/tonumbers/ - FromNumber - Sender phone number or Messaging Service SID (Required)
URL part:twilio://accountsid:authtoken@fromnumber/tonumbers/ - ToNumbers - Recipient phone number(s) (Required)
URL part:twilio://accountsid:authtoken@fromnumber/tonumbers/
Query/Param Props¶
Props can be either supplied using the params argument, or through the URL using
?key=value&key=value etc.
- Title - Notification title
Default: empty
Getting Started¶
To use the Twilio SMS service, you need a Twilio account. You can sign up at twilio.com.
Required Credentials¶
- Account SID — Found on your Twilio Console Dashboard
- Auth Token — Found on your Twilio Console Dashboard
- From Number — A Twilio phone number or Messaging Service SID from your account
- To Number(s) — One or more recipient phone numbers in E.164 format
Phone Number Format¶
Phone numbers should be in E.164 format (e.g. +15551234567).
Common formatting characters such as spaces, dashes, parentheses, and dots are
automatically stripped, so +1 (555) 123-4567 and +1.555.123.4567 are also accepted.
Multiple Recipients¶
You can send the same message to multiple recipients by adding additional phone numbers to the URL path:
twilio://ACXX...XX:token@+15551234567/+15559876543/+15551111111/+15552222222
Each recipient receives an independent API call. If delivery fails for one recipient, the remaining recipients are still attempted and all errors are returned together.
Messaging Service SID¶
Instead of a phone number, you can use a Twilio Messaging Service SID as the sender. Messaging Service SIDs start with MG:
twilio://ACXX...XX:token@MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/+15559876543
This is useful when you want Twilio to manage sender selection, opt-out handling, or when sending from a pool of numbers.
Examples¶
Basic SMS
twilio://ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token@+15551234567/+15559876543
Multiple recipients
twilio://ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token@+15551234567/+15559876543/+15551111111
Using a Messaging Service SID
twilio://ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token@MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/+15559876543
SMS with title
twilio://ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token@+15551234567/+15559876543?title=Server+Alert
Optional Parameters¶
You can optionally specify the title parameter in the URL. When set, the title is prepended to the message body.
Please refer to the Twilio SMS API documentation for more information.