Blog / Messaging APIs

What Is a Messaging API?

A Developer’s Guide to SMS and MMS

Key Takeaways

A messaging API works as a loop of requests and callbacks, and most integration problems start when teams treat it as a one-way send function.

  • A success response isn’t a delivery. It means your message was queued. The actual outcome arrives later through a webhook.
  • SMS and MMS share an endpoint and little else. Segmenting, size limits, cost, and receipt coverage all depend on the channel.
  • Some failures deserve a retry, and some should never be retried. Telling them apart protects your budget and your standing with carriers.
  • Sender type, registration, consent, and pricing model are decided before the code. They shape the build more than the endpoint does.

Get comfortable with the lifecycle first, then follow the specialist article that matches the job in front of you.


Americans exchanged almost 2.2 trillion text and multimedia messages in 2024, the most since 2020. A fair chunk of those weren’t typed by anyone. They came from scheduling systems, login screens, order trackers, and help desks, built by teams that have never touched a piece of telecom gear and don’t plan to.

2.2 trillion

text and multimedia messages exchanged in the US in 2024, the most since 2020.Source: CTIA annual survey, as reported by RCR Wireless

What those teams use instead is a messaging API built for developers. This guide walks through what a messaging API is and how a message gets from your request to someone’s phone, then back to your server as a status update. It also covers where SMS and MMS part ways, how to read delivery and failure states, and what you should decide before anyone opens an editor. We’ve kept it to the shared concepts on purpose. Sending a first message, bulk sending, pricing, and provider selection each have their own article. There’s a table near the end of this article that maps them.

1What Is a Messaging API?

A messaging API (application programming interface) is an HTTP interface for sending and receiving SMS (Short Message Service) and MMS (Multimedia Messaging Service) messages on a phone number, without your application ever talking to a carrier network itself. You make a web request, then the provider turns it into carrier traffic, keeps track of what happens next, and tells you. If you’ve integrated a payment or email service before, the pattern will feel familiar.

The naming is messier than it should be. An SMS API deals in text only, an MMS API adds media, and “messaging API” generally means the two together under one set of endpoints and credentials. Some vendors also use the phrase for products that include chat apps and other channels. We’ll come back to that later, since it affects what you should expect from a given platform.

The provider handles

  • Carrier relationships
  • A route for each message
  • Splitting long texts into segments
  • A log of every message

You own

  • Who gets a message
  • Proof that they agreed to receive it
  • Retry rules that fit your business
  • The endpoint that receives replies
Figure 1. Where the provider’s work stops and yours starts.

What the API Handles for You

Underneath a text message sits a pile of things most developers would happily never learn: carrier interconnects, routing tables, encoding rules, and per-carrier sending policies. That’s the provider’s job. It maintains carrier relationships, selects a route for each message, breaks long texts into segments, and logs every message so you can reconcile a bill or figure out why a customer says they never received their login code.

What Stays on Your Side

Quite a lot, as it turns out. The API has no opinion about who should get a message or whether they ever agreed to receive it. It won’t retry in any way that understands your business, and it can’t host the endpoint that receives replies. The integrations that cause trouble six months in are usually the ones where the send call works fine, but nothing was built around it.

2How Does the Messaging API Request and Webhook Lifecycle Work?

The first thing to understand is that sending a text is asynchronous. Your request succeeds, you get an acknowledgment, and the real outcome shows up later, anywhere from a second to a few minutes on. A message can be accepted by the API and still fail at the carrier. Developers who misunderstand this tend to log “sent” and move on, which is how a customer gets told their reminder went out when it didn’t.

A message can be accepted by the API and still fail at the carrier.

The 5 Stages Every Message Passes Through

Whichever provider you pick, an outbound message goes through roughly the same sequence.

  1. Authenticate: Your application sends its credentials with the request over HTTPS. If the credentials are wrong, the platform rejects the request with an authorization error immediately.
  2. Validate and accept: The platform checks the number format, confirms that you own the sending number, and looks over the payload. If it’s satisfied, it returns a message ID and a response telling you it accepted the request for processing. That’s all it’s saying.
  3. Route: The platform chooses a carrier path. It also splits long text into segments and fetches any media you referenced.
  4. Deliver: The recipient’s carrier tries to put the message on the handset.
  5. Report: The carrier sends back a delivery receipt. The platform posts that receipt to your webhook and writes it to the message record.
Message lifecycle across three actors Your application authenticates. The messaging platform validates and accepts the request, returning 202 Accepted and a message ID, then routes the message. The carrier delivers it and reports back. The platform posts the delivery receipt to your webhook seconds to minutes after the acknowledgment. YourApplication MessagingPlatform Carrier 1. Authenticate 2. Validateand accept 3. Route 4. Deliver 5. Report seconds to minutes 202 Accepted + message ID Delivery receipt via webhook Platform posts the receipt
Figure 2. Who acts at each stage. Solid arrows show the message moving forward. Dashed arrows show what comes back to your application: an acknowledgment first, and the delivery receipt later.

One Request, Start to Finish

A send request is short. In the example, the host is a placeholder, and the field names will differ between providers, though most JSON-based messaging APIs ask for the same four things: credentials, a destination, a sending number you own, and the text.

Example send request
curl https://api.example.com/v2.1/messages \
  -X POST \
  -u "$ACCESS_KEY:$SECRET_KEY" \
  -H "Content-Type: application/vnd.api+json" \
  -d '{
    "data": {
      "type": "message",
      "attributes": {
        "to": "12065550142",
        "from": "12065550100",
        "body": "Your appointment is confirmed for 3 PM tomorrow."
      }
    }
  }'
Returns202 Acceptedmessage record IDNo phone has buzzed yet

What comes back is 202 Accepted and a message ID. No phone has buzzed yet. Save that ID in your own database alongside the message, because the delivery receipt that arrives on your webhook later carries the same ID, and it’s how you match the result to the text you sent. The example also assumes two things are already in place: API credentials for your account, and a sending number that’s enabled for messaging. The SMS API getting started walkthrough covers both.

What Webhooks Carry Back

A webhook is just a URL on your server that the provider calls when there’s news. You’ll care about two kinds. One is an inbound message: a POST with the sender’s number, your number, and the content, which is what makes two-way texting possible. The other is a delivery receipt, which points back to the ID of something you sent.

A few habits save pain later. Return a success code fast and push the real work to a background job, because a slow response often triggers a resend. Expect the occasional duplicate event anyway and make your handler safe to run twice. Check that the request really came from your provider, using whichever verification method their docs describe. It’s also surprisingly common to skip the receipt webhook altogether. Teams that do have no way of knowing whether their messages arrived.

Answer fast

Return a success code first. Do the real work in a background job.

Expect duplicates

Make your handler safe to run twice on the same event.

Verify the sender

Confirm that each request really came from your provider.

Figure 3. Three webhook habits that prevent most production surprises.

3SMS vs. MMS: What Can Each Channel Do?

A typical messaging API exposes both channels through the same endpoint, and the transition from SMS to MMS can be as simple as adding a media URL to the request. But don’t let that fool you. The two behave differently when they leave the platform, in ways that show up on your invoice and in your delivery numbers.

FactorSMSMMS
ContentText onlyText plus images, audio, or video
Length160 characters per message in the standard alphabet, 70 with emoji or other UnicodeMuch longer text, but text and media share one size limit
Long messagesSplit into linked segments, each billed separatelySent as a single message
Media handlingNonePlatform fetches files from URLs you supply
Device reachEvery mobile phoneBroad, dependent on device and carrier support
Relative costLower per messageHigher per message
Delivery receiptsWidely supportedLess consistent across carriers
Typical jobsCodes, alerts, remindersPhotos, visual confirmations, short clips

Why Segments Matter in SMS

One SMS message can hold 160 characters if you stick to the standard GSM alphabet. A longer message gets cut into 153-character segments, which the phone reassembles so the recipient sees a single text. The catch is encoding. A single emoji, or a curly apostrophe pasted in from a word processor, pushes the entire message into Unicode, where the ceiling is 70 characters (67 per segment once it’s split). You’re billed per segment. That’s how a two-sentence reminder with one smiley face ends up as three billable messages.

SMS segment calculator

Type or paste a message to see how many segments it uses.

Encoding
GSM
Characters
0
Limit per segment
160
Segments billed
1

This tool estimates segments using the standard GSM alphabet and Unicode limits described above. Your provider’s message records show the count it bills.

What Changes When You Add Media

MMS does away with segments. In exchange, you get a size budget: providers limit the total data of a message (media plus text), and a carrier may compress an oversized file or refuse it. The media itself must be available at a publicly accessible URL, since the platform fetches it at send time.

When using media messages, keep images small. Test on more than one carrier, and have a plain-text version ready for the numbers that can’t take MMS at all.

Before you send media

  • Host each file at a publicly accessible URL
  • Keep images small
  • Test on more than one carrier
  • Keep a plain-text version ready
Figure 4. A short MMS preflight check.

Two supporting articles pick this up. Our MMS API article gets into media use cases and what to ask a provider, and the piece on SMS vs MMS for business messaging helps with choosing a channel for a particular use case.

4How Do Delivery Receipts and Failures Work?

After the platform hands a message to a carrier, the delivery receipt is how you find out what became of it. Nothing else tells you a text actually went anywhere. Receipts are less definitive than the name implies, though, and it helps to know what each status is really claiming.

Accepted, Sent, and Delivered Are Different States

“Accepted” means the API took your request. “Sent” means the platform passed the message to a carrier. “Delivered” means that the carrier reported it reached the handset. Some platforms send receipts twice, first at the carrier handoff and later when the carrier reports on what happened downstream.

Accepted

The API took your request.

Sent

The platform passed the message to a carrier.

Delivered

The carrier reported that it reached the handset.

Not all carriers report this step.
Figure 5. Each status makes a narrower claim than the one after it.

The awkward part is that not all carriers return handset-level receipts. A message with no “delivered” status may well have arrived. For that reason, it’s better to watch delivery rates across a few thousand messages than to read too much into any one of them.

Temporary and Permanent Failures

When a message fails, the first question is whether trying again could possibly help.

  • RetryTemporary failures include carrier congestion, a phone that’s switched off, and rate limits on your account. Retry after a pause, and lengthen the wait with each attempt.
  • StopPermanent failures include invalid or disconnected numbers, landlines that can’t receive texts, recipients who have opted out, and content a carrier has blocked. Stop sending and flag the record.
  • Fix the callRequest errors never reach a carrier. Bad credentials, a malformed payload, or media over the size cap come straight back as an HTTP error on the original call.

Retrying something permanent is an expensive mistake. Repeatedly sending to a disconnected number costs money on every attempt, and carriers notice senders who keep doing it. Most messaging API providers publish their status codes in enough detail to sort failures into these groups. Adding that mapping into your retry logic early will save you a cleanup job later.

5Which Integration Decisions Should You Make Before Writing Code?

Writing the send call is quick. What slows projects down is everything decided (or left undecided) around it, and some of those choices are hard to undo after launch. These are worth settling first.

Which Sender Type Fits Your Traffic?

In the US and Canada, business texts usually go from either a local 10-digit number or a toll-free number. If you’re sending application traffic from local numbers in the US, you’re in 10DLC territory: A carrier registration system links your brand, and each use case you text about, to the numbers you send from. Toll-free numbers have a verification process of their own. Neither is instant. You complete both through your provider, and each one needs carrier approval before you can send, so start the registration when development starts. That way the approval wait runs alongside the build instead of delaying your launch.

How Will You Handle Volume?

Calling the API straight from a request thread is fine for a login code. Ten thousand shipping notices are another matter. At that scale, you need a queue between your application and the API, a send rate that stays inside provider and carrier limits, and receipt handling that doesn’t fall behind. We won’t go through those patterns here, but the bulk SMS API article is devoted to them.

Legal teams think of consent as a compliance question. For developers, it’s mostly a data question: who agreed to what, where is that stored, and what happens the moment they change their mind? FCC rules that took effect in April 2025 let recipients revoke consent by any reasonable means and require senders to honor opt-outs within 10 business days. The practical upshot is a suppression list: your own record of every number that has opted out of your messages, fed by inbound messages and checked on every send. It’s separate from the national Do Not Call Registry, which your legal team may also need to account for.

A recipient opts outThe request arrives as an inbound message on your webhook.
Your suppression list updatesYour handler adds the number to the list.
Your send path checks itEvery send looks up the list before it calls the API.
10 business daysThe deadline FCC rules give senders to honor an opt-out.
Figure 6. How an opt-out moves through your system.

How Will Cost Scale With Usage?

Messaging API usage is usually billed per message. SMS segments and MMS carry different rates. Carrier surcharges get added on top. Metered billing is friendly to development work, because test traffic costs the same per message as production, and you aren’t paying for capacity that sits unused. Budgets usually go wrong on segment counts and fees nobody modeled, far more often than on the advertised rate. The SMS API pricing guide shows how to compare those line items.

6Which Messaging API Capabilities Are Standard, and Which Vary by Provider?

A “messaging API” is a category name, and vendors don’t agree on its boundaries. Certain features come with almost any carrier-grade SMS and MMS service. Others exist only on some platforms, or exist everywhere but work differently enough that you’d want to check before designing around them.

CapabilityWhat to Expect
Send and receive SMS and MMSStandard on carrier-grade platforms
Inbound message webhooksStandard
Delivery receipts for SMSStandard, with coverage that depends on the carrier
Message detail recordsStandard, though fields and retention differ
Local and toll-free sending numbersStandard in North America
Delivery receipts for MMSVaries: some providers return them and some don’t, and carrier support is uneven
Webhook scope (account-wide or per number)Varies: some providers use one callback URL per account, others let you set one per number
Webhook verification methodVaries: providers use different methods, such as signed requests, shared secrets, or IP allowlists
10DLC registration workflowRequired for US application traffic on local numbers; providers differ in how much of the process they handle
Short codesVaries: not every provider offers them, and availability and setup time differ
Scheduling, templates, and link trackingVaries: some platforms build these in, while many leave them to your application
RCS and over-the-top chat channelsOffered by multichannel suites, not by every SMS and MMS provider

StandardVaries by providerRequiredOutside core SMS and MMS

More features don’t make a platform a better fit. A product that needs dependable SMS and MMS on numbers it controls is often better served by a focused platform with clear records and support staff who pick up the phone. Contrast that with a sprawling suite where most of the menu goes unused. Our article on SMS API providers explains how to compare vendors against your own requirements.

7Where Should You Go Next?

Everything so far applies to any messaging project. The specialist articles take over from here: two on implementation, one on sending at scale, one on budgeting, and several to help you choose a channel and a vendor. Go to the row with the question most similar to what you are asking right now.

Messaging API Guide

Build

  • SMS API: How It Works
  • SMS API Getting Started

Scale

  • Bulk SMS API

Budget

  • SMS API Pricing

Choose

  • MMS API
  • SMS vs MMS for Business
  • 10DLC Explained
  • SMS API Providers
Figure 7. How the supporting articles group around this guide. The table below links to each one.
Your QuestionGo ToWhat It Adds
How does SMS sending and receiving work in more depth?SMS API: How It WorksAutomation patterns, queuing, and deliverability tuning
How do I send my first message?SMS API Getting StartedSetup steps from credentials to a first send
How do I send to large lists?Bulk SMS APIHigh-volume sending and the practices around it
What can I do with media messages?MMS APIMMS use cases and selection criteria
Which channel suits my use case?SMS vs MMS for BusinessChannel fit, compliance context, and enterprise considerations
What is registration, and why is it required?10DLC ExplainedPlain-language background on 10-digit long code messaging
What will this cost at my volume?SMS API PricingLine items to compare beyond the per-message rate
How do I shortlist vendors?SMS API ProvidersEvaluation criteria for choosing a provider

Put Your Messaging API Plan Into Production

If one idea from this guide sticks, make it the loop: Your request is accepted, a carrier delivers (or doesn’t), and a webhook tells you which. Sort out sender type, consent handling, and failure rules before you build, and the code will be the straightforward part.

Flowroute covers that loop as a focused SMS and MMS platform, with messaging on local and toll-free numbers in the US and Canada, callbacks for inbound messages and delivery receipts, real-time message detail records, and metered pricing. It concentrates on carrier-grade SMS and MMS, so multichannel extras such as RCS and chat-app messaging sit outside its scope. Explore Flowroute messaging services for the full picture, review the Flowroute SMS API when you’re ready to build, or contact the Flowroute team to get started.

Frequently Asked Questions

Developers new to a messaging API tend to ask the same handful of questions, so here they are in one place.

What is the difference between a messaging API and an SMS API?

An SMS API sends and receives text only. A messaging API typically covers SMS and MMS together, with a single set of endpoints and credentials. Adding media later doesn’t require a second integration. Vendors don’t all use the term the same way. Check which channels a product actually supports before assuming.

Does a successful API response mean my message was delivered?

No. It means the platform accepted your message and queued it. You’ll know it was delivered when the carrier’s delivery receipt arrives, either through your webhook or by looking up the message record.

Why do I need a webhook if my application only sends messages?

Even a send-only application has to listen. Delivery receipts come in by webhook. Replies do too, including opt-out requests that you’re obliged to honor. Without a webhook, failed sends and unsubscribes go unnoticed.

Why was I billed for more messages than I sent?

Almost always, the answer is segments. A long text is split into several parts, and each is billed as a message. Emoji and other Unicode characters cut the limit from 160 characters to 70, which can double or triple the count. Checking length and encoding before you send keeps the bill predictable.

How long does it take to launch a messaging API integration?

You can have a basic send-and-receive flow up and running in a day. Getting to production takes longer, and most of the delay is outside your code: number registration and its approval window, consent handling, and testing receipts and failure paths on real carriers.

How does an SMS/MMS messaging API differ from an in-app chat API?

An SMS/MMS messaging API connects an application to phone-number-based messaging over carrier networks. An in-app chat API supports conversations within an application or website. Some platforms combine these capabilities, so check the channels a provider actually supports rather than relying on the product name alone.