Changing the "From" number or Sender ID for outgoing SMS messages can be accomplished by changing the From parameter in your API requests.
Please note, if you are sending messages using a Twilio number from a different country as your recipients, the Sender ID shown on the user's device may be different than your Twilio number. For more info, see Why do some SMS recipients see a Sender ID that is not my Twilio number?
Here's how to change the From parameter you use through Twilio:
Twilio Phone Numbers and Hosted SMS numbers
Any SMS-enabled Twilio phone number or Hosted SMS number on your account can be used to send SMS messages. To use a phone number for sending messages, input your phone number in the From parameter of your API request using E.164 formatting.
Here’s an example cURL script - notice the From
parameter updated in line 4. For full details, please see our Programmable SMS REST API documentation.
curl -XPOST https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Messages.json \
-d "Body=Hello from my phone number" \
-d "To=+12685551234" \
-d "From=+12685555555" \
-u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
SMS support for your number can be checked via a number of methods:
- Console: SMS support for Twilio Phone Numbers can be viewed at www.twilio.com/console/phone-numbers. Supported numbers will have an SMS icon under the CAPABILITIES heading.
- API: A GET request to the IncomingPhoneNumbers API Resource will also return SMS support information for your Twilio Phone Numbers. Our response will include a Capabilities property with boolean true/false values for SMS and MMS capabilities.
Note: You can not spoof messages from your own cell phone number. The From parameter can only display a Twilio number on your project, or an Alphanumeric Sender ID (where available).
Alphanumeric Sender IDs
An alphanumeric sender ID of up to 11 characters can be used for sending messages to all supported countries where pre-registration is not required. To use an alphanumeric sender ID for sending messages, input your ID in the From parameter of your API request.
Here’s an example cURL script - notice the From
parameter updated in line 4. For full details, please see our Programmable SMS REST API documentation.
curl -XPOST https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Messages.json \
-d "Body=Hello there" \
-d "To=+12685551234" \
-d "From=MyCompany" \
-u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
If the country you want to send to requires Alpha Sender Pre-Registration, you will not be able to use this method. To register an Alphanumeric Sender ID to that country, please submit your request by completing this registration form.
Note: Alphanumeric Sender ID messages are one-way only, it is not possible to reply to messages sent from Alpha Sender IDs. For full details, please see our article for Getting started with Alphanumeric Sender ID.
Twilio Short Codes
Short codes send Twilio Programmable SMS messages in the same way. To use a short code for sending messages, input your short code number in the From parameter of your API Request. Note that short codes do not have a leading plus sign or country code, and should be formatted exactly as they appear on Twilio.
Here’s an example cURL script - notice the From
parameter updated in line 4. For full details, please see our Programmable SMS REST API documentation.
curl -XPOST https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Messages.json \
-d "Body=Hello from 123456" \
-d "To=+13105551234" \
-d "From=123456" \
-u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
Note: Short codes have different throughput options and purchase requirements than standard Twilio phone numbers. For full details, please see our article What is a short code.