Changing the sender ID for sending SMS messages

Changing the Sender ID for outgoing SMS messages can be accomplished by changing the From parameter in your API requests.

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:

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.

Please note, You can not spoof messages from your own cell phone number.

Alphanumeric Sender IDs

An alphanumeric sender ID of up to 11 characters can be used for sending messages to supported countries. 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:

curl -XPOST ttps://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'

 

Please note that alphanumeric sender ID messages are relegated to one-way messaging, as users are unable to reply to these messages. 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. Here’s an example cURL script:

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'

 

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.

Have more questions? Submit a request
Powered by Zendesk