Messaging API

The next generation of business text messaging services

Build deeper customer relationships at scale with a messaging platform based on trust, quality, and engagement.

Illustration of a business sending delivery status updates to a customer on their preferred channel.

How Twilio Messaging works

Diagram of a communication cloud network with various message and communication icons.

Engage customers on their preferred channels including SMS, RCS, MMS, WhatsApp, and more with our centralized business messaging platform. Powered by an intelligent network that monitors over 900 million data points daily, Messaging enables unrivaled reliability at any scale.

Discover developer-friendly APIs for a wide range of use cases: 

Notifications showing order confirmation from OWL Cafe and Google business verification.
New

Modernize your messaging with Rich Communication Services (RCS)

Create more interactive messages for your customers. See how RCS with Twilio can provide branded communications, greater deliverability, and improved customer engagement.

Messaging use cases

Creating meaningful engagements through trusted messaging

 

Alerts and notifications

Build any type of alert or notification, from intelligent product-triggered notifications and security alerts, to appointment reminders and payment confirmations. 


Jack Henry ensures timely and secure delivery of critical financial information at scale with Twilio Messaging capabilities.

Laptop computer with security lock

15M

notifications per month

Bar graph with arrow showing an increase

10M+

Banno users

Security Shield with checkmark

25x

growth in 5 years

Notifications showing order confirmation from OWL Cafe and Google business verification.

Reach customers on their favorite channels from a single platform

  • Twilio Messaging logo
    SMS

    Reach consumers worldwide for notifications, alerts, verifications, and marketing with SMS.

  • Twilio Google Business Messages logo
    Rich Communication Services (RCS)

    Deliver rich content and measure engagement as a branded, verified sender with RCS.

  • Twilio MMS Messaging logo
    MMS

    Send rich marketing messages with multimedia capabilities using MMS.

  • Twilio Programmable Messaging logo
    Conversational Chat

    Engage customers seamlessly with an integrated, in-app chat experience.

  • Twilio WhatsApp Business API logo
    WhatsApp

    Provide customer care, delivery notifications, and promotions on the world’s most popular messaging app.

  • Twilio Facebook Messenger logo
    Facebook Messenger

    Connect to billions with rich messaging, live cross-channel support, and ads that click to message.

Explore our latest Messaging products and features

Twilio Messaging is built for enterprises pushing the boundaries of global messaging at scale and innovating in customer engagement.

Notifications showing order confirmation from OWL Cafe and Google business verification.

Twilio Messaging Engagement Suite

Experience simpler development, quicker time to market, and higher deliverability rates.* See how Message Scheduling, Link Shortening with Click Tracking, advanced data, and real-time dashboards can benefit your business.

Notifications showing order confirmation from OWL Cafe and Google business verification.

Customer Deliverability Engine

Get guidance on how to build, iterate, and scale your messaging solution with our newest suite of messaging products that combines messaging traffic, robust data, and AI to create an intelligent and transparent messaging platform.

Notifications showing order confirmation from OWL Cafe and Google business verification.

Traffic Optimization Engine

Scale and manage your messaging traffic with products that provide simpler capacity planning, better traffic prioritization, and granular control of your messaging while avoiding queuing errors and undelivered or late messages.

Features

Omnichannel messaging solutions on a scalable platform

  • Verified messaging

    Access trusted messaging ecosystems and engage customers over routes that protect consumers from spam and unwanted messages.

  • Real-time routing algorithms

    Leverage AI to optimize deliverability and reach customers every time with quality messaging.

  • Messaging Insights

    Get a real-time, out-of-the-box dashboard for transparency into delivery health and tools to troubleshoot issues.

  • Trust Hub

    Navigate the regulatory landscape, maintain high deliverability, and access our network of trusted senders to establish trust.

  • Fraud Guard

    Prevent fraudulent traffic with protection against SMS pumping and detect issues as they occur to save time as you scale.

  • Messaging Services

    Ensure customers receive messages from the same number, from their country/area code, and more.

  • Lookup

    Validate phone numbers to reduce costs, increase conversion percentages, and reduce risk of fines.

  • Content Template Builder

    Create and manage templates across SMS, MMS, WhatsApp, and more.

Get started with code

Explore quickstart guides, code snippets, SDKs, and more in our comprehensive resource library to kickstart your build for Messaging.

Create a message

// Download the helper library from https://www.twilio.com/docs/node/install
// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = require('twilio')(accountSid, authToken);

client.messages
      .create({from: '+15017122661', body: 'Hi there', to: '+15558675310'})
      .then(message => console.log(message.sid));
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client


# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ['TWILIO_ACCOUNT_SID']
auth_token = os.environ['TWILIO_AUTH_TOKEN']
client = Client(account_sid, auth_token)

message = client.messages.create(
                              from_='+15017122661',
                              body='Hi there',
                              to='+15558675310'
                          )

print(message.sid)
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

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 twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        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")
        );

        Console.WriteLine(message.Sid);
    }
}
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.api.v2010.account.Message;
import com.twilio.type.PhoneNumber;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    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")
            .create();

        System.out.println(message.getSid());
    }
}
require_once '/path/to/vendor/autoload.php';

use Twilio\Rest\Client;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$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"]
                  );

print($message->sid);
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'rubygems'
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

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

puts message.sid
# Install the twilio-cli from https://twil.io/cli

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

Need help building? 
No problem.

Work with one of our trusted partners to get coding support or explore a pre-built messaging solution. View partners

Why Twilio Messaging

A business text messaging platform with trust, quality, and engagement

167+ billion

messages sent and received yearly

180+ countries

within your reach

99.95% +

monthly API uptime

4,800

global carrier connections

Next-generation business messaging services, simple pricing

Only pay for what you use with no subscriptions. Additional volume and committed-use discounts are available as you scale.

Notifications showing order confirmation from OWL Cafe and Google business verification.

* In an evaluation of more than 63M messages sent through Twilio with shortened hyperlinks, messages with shortened hyperlinks by 3rd party Link Shorteners were filtered at 1.96% or 28x the rate of Twilio which was filtered at a rate of 0.07%

FAQ

 

Toll-free numbers

Toll-free numbers are 10-digit numbers that have a standard prefix like 800 or 833 (Example: 1-833-456-78XX).

  • Can be used for calls and text messages
  • Support high-throughput for high-volume use cases like notifications, alerts, and promotions
  • Require a verification process for high-volume use cases

See more about toll-free numbers

A2P 10DLC

Application-to-person 10-digit long codes are numbers with a local prefix, like +1 (415) 568-00XX.

  • Specifically for business messaging traffic
  • Support both phone calls and text messages
  • A verification process is required to prove you're a trusted sender with approved campaigns

See more about 10DLC numbers

Short codes

Short codes are 5-6 character codes (56748) that are recognizable, and can be used for text and picture messaging.

  • Throughput starts at 100 messages per second
  • Support high-volume use cases like alerts, notifications, verifications, and promotions

A verification process is required to prove you're a trusted sender with approved campaigns

See more about short codes

Alphanumeric sender IDs

Alphanumeric sender IDs are based on your company or brand name and used for one-way messaging at high volumes in supported countries.

See more about alphanumeric numbers

Sending a high volume of messages in the United States and globally quickly becomes complex. As the complexity of your messaging application grows, it's helpful to organize your account and message logs into separate Messaging Services using Twilio Programmable Messaging.

You can think of a Messaging Service as a higher-level "bundling" of messaging functionality around a common set of senders, features, and configuration. The same settings and feature configuration apply to all of the senders (long code numbers, short codes, toll-free numbers, etc.) in the Messaging Service's pool.

A Messaging Service's features can be managed and configured directly through the Console as well as using the REST API.

Requirements vary widely by communication channel, use case, and region that you are messaging in. Visit the Twilio Trust Center to learn more or download our Global Regulatory & Compliance Guide for Marketers.