Send SMS api

Send SMS api


Deliver at scale with proven APIs for SMS

Send and receive text messages with just a few lines of code on MessagingX, the trusted platform for cross-channel messaging.

Start for free
Twilio's SMS API helps you deliver messages securely at-scale

Engage customers globally with reliable SMS messaging

Launching a trusted SMS solution is easy with MessagingX. Twilio gives you developer-friendly APIs, scalability, and built-in software for compliance, routing, and advanced use cases. All to help you get to market faster, and with unmatched deliverability.


Scale from concept to global solution with flexible SMS APIs

Twilio Programmable Messaging API

Programmable Messaging API

Send transactional MMS, SMS, and WhatsApp messages with a single API.

  • Reach 180+ countries reliably with localized senders, compliance tools, and global guidelines.

  • Manage compliance, deliverability, replies, and more with Twilio’s programmable software.

  • Monitor and troubleshoot message delivery and engagement with real-time analytics.

Explore the Programmable Messaging API
Twilio Conversations API

Conversations API

Drive two-way engagement with cross-channel messaging for MMS and more using a single API.

  • Power commerce and support on SMS, MMS, chat, Facebook Messenger, Google’s Business Messages, and WhatsApp.

  • Manage participants, archive messages, and orchestrate workflows without additional code.

  • Get to market faster with quick-starts, sample apps, and SDKs.

Explore the Conversations API

Use cases

Start and scale customer relationships


Send personalized alerts, reminders, and notifications for appointments, deliveries, and more with the Programmable Messaging API.


Deliver one-time passwords for fast onboarding that reduces support costs and fraud at once.


Distribute marketing messages and offers with the Programmable Messaging API to drive leads, sales, and loyalty.

Conversational care and commerce

Support the full customer journey with two-way, SMS for support, sales, and lead generation with the Conversations API.

A Forrester Consulting study about the ROI of Twilio Messaging.


The Total Economic Impact™ of Twilio Messaging

A commissioned study conducted by Forrester Consulting found Twilio Messaging provided a 3% increase in messages delivered, a 15% improvement among development teams, and a 30 to 40% opt-in rate for SMS marketing.

View the 2023 study

Developer resources

Read the Docs

Explore quick-start guides, code snippets, SDKs, and more in our comprehensive resource library to kickstart your build for Facebook Messenger with MessagingX.

Read SMS DocsGet started with MessagingX

Create a message

// Download the helper library from
// Find your Account SID and Auth Token at
// and set the environment variables. See
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = require('twilio')(accountSid, authToken);

      .create({from: '+15017122661', body: 'Hi there', to: '+15558675310'})
      .then(message => console.log(message.sid));
# Download the helper library from
import os
from import Client

# Find your Account SID and Auth Token at
# and set the environment variables. See
account_sid = os.environ['TWILIO_ACCOUNT_SID']
auth_token = os.environ['TWILIO_AUTH_TOKEN']
client = Client(account_sid, auth_token)

message = client.messages.create(
                              body='Hi there',

// Install the C# / .NET helper library from

using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account;

class Program
    static void Main(string[] args)
        // Find your Account SID and Auth Token at
        // and set the environment variables. See
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        var message = MessageResource.Create(
            from: new Twilio.Types.PhoneNumber("+15017122661"),
            body: "Hi there",
            to: new Twilio.Types.PhoneNumber("+15558675310")

// Install the Java helper library from

import com.twilio.Twilio;
import com.twilio.type.PhoneNumber;

public class Example {
    // Find your Account SID and Auth Token at
    // and set the environment variables. See
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        Message message = Message.creator(
                new com.twilio.type.PhoneNumber("+15558675310"),
                new com.twilio.type.PhoneNumber("+15017122661"),
                "Hi there")

require_once '/path/to/vendor/autoload.php';

use Twilio\\Rest\\Client;

// Find your Account SID and Auth Token at
// and set the environment variables. See
\$sid = getenv("TWILIO_ACCOUNT_SID");
\$token = getenv("TWILIO_AUTH_TOKEN");
\$twilio = new Client(\$sid, \$token);

\$message = \$twilio->messages
                  ->create("+15558675310", // to
                           ["from" => "+15017122661", "body" => "Hi there"]

# Download the helper library from
require 'rubygems'
require 'twilio-ruby'

# Find your Account SID and Auth Token at
# and set the environment variables. See
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client =, auth_token)

message = @client.messages.create(
                             from: '+15017122661',
                             body: 'Hi there',
                             to: '+15558675310'

puts message.sid
# Install the twilio-cli from

twilio api:core:messages:create \\
    --from +15017122661 \\
    --body "Hi there" \\
    --to +15558675310
curl -X POST "\$TWILIO_ACCOUNT_SID/Messages.json" \\
--data-urlencode "From=+15017122661" \\
--data-urlencode "Body=Hi there" \\
--data-urlencode "To=+15558675310" \\


SMS made easy with MessagingX

Send and receive text messages at scale with two developer-friendly APIs in one trusted platform, MessagingX. Pay as you go and enjoy scaling discounts for high-volume and long-term use.

See pricingExplore MessagingX