What we do
Tools
Industries
Department
How we workLet's talk →
Home/Twilio
Twilio

The Twilio API: What Has to Be in Place Before a Real Message Arrives

Twilio isn't an app you text from. It's a set of APIs your own software calls to send and receive SMS, WhatsApp messages and phone calls. The first test message is quick. The usual surprise comes after: messages that sent fine in testing don't arrive in production, because US carriers only deliver business texts from registered senders. Here's the path from trial to delivered, which Twilio product fits which job, and the part Twilio leaves to you.

Where Twilio stops

Twilio can send the text, but deciding when to send it and what it should say is a different problem.

Stuck on Twilio? Let's solve it →
Before a production SMS is delivered

Credentials: your Account SID and Auth Token are on the Console's home page. For production, create an API key and secret instead, so you can rotate it without touching the main token.

A sender: buy a phone number in the Console, or put several numbers in a Messaging Service so Twilio picks the sender for you.

US registration: texts from a regular US number (10DLC) need an approved A2P 10DLC brand and campaign, with the number attached. Unregistered traffic is blocked with error 30034, and a campaign still pending review is blocked too. Toll-free numbers and short codes have their own approval routes.

Brand Campaign Attach number Send

Off the trial: trial accounts can only reach verified numbers and add "Sent from your Twilio trial account" to each message. Upgrading removes both.

A first production text, in the order that avoids rework

  1. 1

    Upgrade and start registration on day one

    Brand and campaign review takes time and runs in parallel with your build. Write the campaign description and sample messages to match what you'll really send, including how people opt in.

    Watch for: A campaign described as "appointment reminders" that later sends promotions. Carriers filter on what you registered.

  2. 2

    Send through a Messaging Service

    Create a Messaging Service, add your number to it, and send with its SID instead of a fixed From number. Registration attaches at this level, and adding numbers later doesn't change your code.

  3. 3

    Set a status callback on every message

    Give each send a status callback URL. Twilio posts each change (queued, sent, delivered, undelivered, failed) with an error code when there is one. Without it, "sent" from the API only means Twilio accepted the request.

  4. 4

    Point the number at a webhook for replies

    Set the incoming message URL on the number or the Messaging Service. Each inbound text arrives there as a request your code answers. Our Twilio webhook setup page covers the request format and signature checking.

    Watch for: Check the X-Twilio-Signature header on every request, or anyone who finds the URL can post fake replies into your system.

  5. 5

    Respect opt-outs

    By default Twilio handles STOP and similar keywords on its standard opt-out setup, and blocks further texts to that number. Record the opt-out in your own database too, so other tools don't keep trying.

Which Twilio API for the job

What you need Use this What it leaves to you
Texts triggered by bookings, orders, invoices or job updates Programmable Messaging (SMS, MMS, WhatsApp). Deciding when to send and what each message says, from data in your other systems.
One-time codes at sign-up or login Twilio Verify, which generates, sends and checks the code. What your app does after the check passes or fails.
A phone menu, call routing or automated calls Programmable Voice with TwiML. See Twilio voice and IVR. Looking up the caller and their account so the menu knows who's calling.
A drag-and-drop call or text flow, built without much code Twilio Studio. Calls out to your real data once the built-in widgets run out.
One view of customer events across tools Segment, which Twilio owns. See Twilio Segment integration. Getting clean events in from systems without a ready-made source.

Why Twilio messages go missing

Error 30034 in the logs

How you'll know: Messages show as undelivered with 30034, often right after moving off a test setup.

Fix: The sending number isn't on an approved A2P 10DLC campaign. Finish brand and campaign registration and attach the number, or the Messaging Service it sits in.

It worked for you but not for a customer

How you'll know: Your own phone gets every test, anyone else gets nothing.

Fix: You're still on a trial account, which only reaches verified numbers. Upgrade the account.

Replies go nowhere

How you'll know: Customers say they texted back, and the only record is in the Twilio Console.

Fix: No incoming message URL is set, or it points at an endpoint that returns an error. Set it, log every request, and pass each reply to wherever someone will see it.

"Sent" in your app, never delivered

How you'll know: Your system marks the reminder done the moment the API call returns.

Fix: Track delivery from status callbacks instead, and flag undelivered messages so staff can call instead.

The part Twilio leaves to you: when to send, and where replies go

Twilio delivers what it's given. Something still has to notice that an appointment was confirmed, an order shipped or an invoice went overdue, pull the right name, time and link into the message, and send it at the right moment. That logic sits in whatever system holds the event, and it's where most of the real work in a Twilio build goes.

Replies are the other half. A customer texting "C" to confirm, or asking to move a visit, should update the booking or open a conversation in the CRM or help desk with the original message attached, not sit on a number nobody checks. The same goes for cost: Twilio bills per message and per minute, and usage from its API can feed the reporting your team already reads.

n-frames builds that layer on the Twilio API and runs it: event-triggered messages from your scheduling, order or billing system, replies routed to the right record, delivery failures flagged, and registration handled so messages actually land.

Questions people ask

What is Twilio used for?

Twilio is a cloud communications platform. Developers call its APIs to add SMS, WhatsApp, voice calls and verification codes to their own software instead of building that plumbing themselves. You don't run a business from Twilio's Console; other software, including what we build, sends through it.

How much does Twilio cost?

Twilio charges per message sent or received and per minute of call time, with rates varying by country and channel, plus a monthly fee per phone number. US 10DLC texting also carries registration fees for the brand and campaign. There's no flat license for the core APIs, so model your volume before a campaign scales up.

Can Twilio send WhatsApp messages, not just SMS?

Yes, through the Twilio API for WhatsApp, which works like programmable SMS. It needs an approved WhatsApp sender, and messages outside an open customer conversation must use templates WhatsApp has approved.

Does Twilio have a Python SDK?

Yes, and official helper libraries for Node.js, C#, Java, PHP, Ruby and Go too. Python is a common choice when the rest of a backend is already in Python, and it's what we often use in that case.

What is Twilio Verify?

Verify is Twilio's API for one-time codes by SMS, voice, email or WhatsApp, used for two-factor login or confirming a phone number at sign-up. It creates, sends and checks the code. Your app still decides when to ask for one and what happens with the result. Twilio also points to Verify for sending codes without your own 10DLC registration.

Why are my Twilio messages not being delivered in the US?

Most often the number isn't registered for A2P 10DLC, which shows as error 30034, or the account is still a trial that can only reach verified numbers. Check the message logs for the error code; each code points to a specific cause.

Who builds Twilio integrations for a business?

n-frames does. We connect Twilio to your scheduling, order, CRM or billing system, so messages go out on real events, replies land on the right customer record, and delivery failures reach a person.

Let's talk

Tell us the one thing your team does manually that eats up time. We read every message and reply within a day.