Skip to content
Astrafolio logoastrafolio
Ask anything about our services, in your language.

AI Automation

Twilio WhatsApp API: How It Works for Your Business

The Twilio WhatsApp API explained for owners: how sending and webhooks work, templates and the 24-hour window, the sandbox, and Twilio vs Meta's Cloud API.

AI Automation9 min readWritten by the Astrafolio team in NoidaTalk to us about this
Cover for the article: Twilio WhatsApp API: How It Works for Your Business

The short answer

The Twilio WhatsApp API lets your own software send and receive WhatsApp messages. Your server calls Twilio to send a message, and Twilio calls your server (a "webhook") when a customer replies. WhatsApp's rules still apply: messages you start need a template approved by Meta, and free-form chat is only allowed within 24 hours of the customer's last message. Twilio is one way in. The other is going direct to Meta's own WhatsApp Cloud API.

If you keep hearing "just use Twilio" and want to understand it before you pay anyone, this guide is for you. We checked every rule below against Twilio's and Meta's own documentation as of October 2026. They change often, so treat the links as the final word.

What is Twilio?

Twilio is a company that sells communication building blocks to developers: APIs for text messages, phone calls, WhatsApp and login codes. An API is simply a doorway that lets one piece of software ask another to do something. You do not get an app with a chat screen. You get the plumbing.

The parts most businesses meet are:

That is why people recommend it: one account, several channels.

How the Twilio WhatsApp API sends and receives messages

Sending and receiving work in opposite directions. To send, your server makes a request to Twilio. To receive, Twilio makes a request to your server. Hold that picture and most of the jargon falls into place.

Sending: your server calls Twilio

When a form is filled or a booking made, your code asks Twilio to send a message. In Twilio's WhatsApp API docs, WhatsApp numbers are written with a prefix, like whatsapp:+9198XXXXXXXX, so Twilio knows to use WhatsApp rather than SMS. Twilio accepts the message, queues it and can send status updates back to your system as it moves along.

Receiving: Twilio calls your server

When a customer replies, Twilio forwards the message to a web address you give it. Twilio defines a webhook as an HTTP request it sends to a URL you provided after certain events. That address belongs to your website or app, which decides what to do: save the message, alert a person, or pass it to an AI assistant to draft a reply.

This is the part owners often miss. Twilio does not "answer" anything. Your software does. If nobody builds that software, messages arrive and go nowhere.

WhatsApp's rules: templates and the 24-hour window

Twilio cannot bend WhatsApp's rules, because they are Meta's rules. Two of them shape everything you build: messages you start need an approved template, and free-form replies are only allowed within 24 hours of the customer's last message.

The customer service window. Meta's pricing documentation says a 24-hour window opens when a user messages or calls the business, and each new message from them resets it. Inside it, you can reply freely. Twilio's docs say the same: to message someone outside that window, you must use a pre-approved message template.

Templates. A template is a message you write in advance, such as "Hi {{1}}, your appointment is on {{2}}. Reply YES to confirm." Meta reviews each one, and only approved templates can be sent. Every template sits in one of three categories: marketing, utility or authentication. The category affects review and price. On Twilio, you build these in its Content Template Builder.

Opt-in. Meta also expects people to have agreed to hear from you before you send templates. We cover opt-in, and the WhatsApp Business app versus the API, in our guide to WhatsApp Business app vs API. If you are still deciding whether you need the API at all, read that first.

Testing for free: the Twilio Sandbox

The Twilio Sandbox for WhatsApp is a shared test number for trying messages before you register your own. Twilio says it is for testing and discovery purposes only. According to its docs:

  • Everyone shares one Twilio number, and only testers who send your "join" code can receive messages.
  • A tester's session ends three days after joining.
  • You cannot use your own templates, only three test ones (appointment reminders, order notifications and verification codes).

It is a good way for a developer to show you a working flow quickly. It is not something to launch on.

Going live: registering your own WhatsApp sender

To message real customers, you register your own number as a WhatsApp sender. On Twilio this is a self sign-up flow that links your number to a WhatsApp Business Account through a Meta pop-up, using a Meta Business Portfolio you are an admin of. Points from Twilio's docs:

  1. The number must not already be registered with WhatsApp. If your shop number runs the WhatsApp Business app today, plan for that.
  2. It must be able to receive an SMS or call for verification.
  3. Meta reviews your display name. If it is rejected, the number is limited to 250 business-initiated messages per 24 hours.
  4. Meta business verification is free but can take several weeks. Start it early. It raises your messaging limits.

Twilio vs WhatsApp Cloud API: which should you use?

Meta offers its own WhatsApp Cloud API, which developers can use directly: API calls to send, webhooks to receive. So the real choice is whether to add Twilio in the middle. Going direct means one less company and one less fee. Twilio means one account for WhatsApp, SMS and voice.

Twilio WhatsApp APIMeta WhatsApp Cloud API (direct)
Who you deal withTwilio, which connects to Meta for youMeta only
Message feesTwilio's per-message fee plus Meta's fee, passed through by TwilioMeta's fee only, per Meta's pricing page
Other channelsSMS, voice and Verify on the same accountWhatsApp only
TestingShared sandboxTest setup in a Meta app, per Meta's get-started guide
Templates and 24-hour windowSame Meta rulesSame Meta rules
Best fitYou also need SMS, calls or OTPs, or your developer knows Twilio wellWhatsApp is your only channel and you want fewer moving parts

Our opinion: if WhatsApp is your only channel, ask your developer why not go direct. There may be a good reason, such as needing SMS fallback next year. "Everyone uses Twilio" is not one.

What it costs, in plain words

Both routes charge per message, and prices change. As of October 2026, Meta charges per delivered message, with the rate set by the message category and the recipient's country. Its page notes that from 1 October 2026 it resumed charging for some messages that had been free, while each business number keeps 1,000 free service messages a month. It also says Indian messaging accounts must move to INR billing by 31 December 2026. Twilio adds its own fee on each inbound and outbound message. We will not quote rates, because they move. Check Meta's pricing and Twilio's WhatsApp pricing on the day you decide.

Not sure which route fits? Talk it through with Astra, our AI assistant, by voice or text, any time.

SMS in India: DLT registration first

If Twilio is also pitched to you for SMS in India, know that commercial SMS must be registered on the mobile operators' DLT system first. DLT (distributed ledger technology) is the shared registry operators use under TRAI's rules against unsolicited messages.

TRAI's advice to senders says every business sending bulk messages must, under TCCCPR 2018, register as a Principal Entity, get a header (sender name) assigned and register its content templates, plus a consent template where needed. Twilio's India SMS guidelines say domestic delivery needs your company and sender ID registered in the operators' DLT portal. WhatsApp messages are not SMS, so DLT does not apply to them, but Meta's template and opt-in rules do.

Three real ways businesses use it

None of these need anything exotic.

  1. Lead alerts to your team. A visitor fills your website form, your site calls Twilio, and your sales person gets the name, number and enquiry on WhatsApp within seconds. Staff are WhatsApp users too, so this needs one approved utility template.
  2. Appointment reminders. Your booking system sends a template reminder the day before with "Reply YES to confirm". The reply opens the 24-hour window, so staff can chat freely to reschedule.
  3. An AI receptionist. Incoming messages hit your webhook, an AI model answers routine questions (hours, location, booking) and anything sensitive goes to a person. We covered the limits in AI receptionist for clinics. The same idea works on calls with Twilio Voice, which is how many AI voice agents are built.

A simple step-by-step for a non-developer

You do not need to code to manage this well. You need the right order and the right questions.

  1. Pick the one job to automate first. "Send new website leads to my phone" beats "automate WhatsApp".
  2. Choose the route. WhatsApp only: ask about Meta direct. WhatsApp plus SMS or calls: Twilio makes sense.
  3. Start Meta business verification now, while the rest is built.
  4. Choose a number that is not on the WhatsApp app, or plan the move.
  5. Draft short, useful templates. Your developer submits them for approval.
  6. Test with two or three staff phones.
  7. Collect opt-in on your forms before messaging customers.
  8. Go live with one flow, watch it for two weeks, then add the next.

Make sure the Twilio or Meta account is in your company's name with you as an admin, so the number and templates stay with you.

Your next step

It is normal to feel wary here. A "WhatsApp integration" is only plumbing until someone builds what sits behind it: what gets logged, who gets alerted, when the AI steps back for a human. That is what our WhatsApp chatbot service builds, on Twilio or directly on Meta. AI automation projects start from $2,500 (INR 30,000), with the price agreed in writing first, and you own the accounts and code.

Book a free 30-minute call and tell us the one job you want off your plate. We will tell you honestly whether Twilio, Meta direct or simply the WhatsApp Business app fits. We reply within 12 hours, Monday to Saturday, 09:00 to 21:00 IST.

Frequently asked questions

What is the Twilio WhatsApp API?

It lets your software send and receive WhatsApp messages. Your server calls Twilio to send, and Twilio passes replies to your server through a webhook. Meta's template and 24-hour rules still apply.

Is Twilio better than the WhatsApp Cloud API?

Neither is better for everyone. Twilio suits you if you also need SMS, calls or login codes on one account. If WhatsApp is your only channel, going direct to Meta avoids Twilio's extra per-message fee.

Can I send WhatsApp messages from my website with Twilio?

Yes. Your website's server calls Twilio when something happens, such as a form submission. If you start the conversation, it must be an approved template sent to someone who opted in.

How much does the Twilio WhatsApp API cost?

You pay Twilio's per-message fee plus Meta's, which Twilio passes through. Meta's rate depends on the message category and the recipient's country, and both change. Check both official pricing pages before you commit.

Can I use the Twilio WhatsApp Sandbox for real customers?

No. Twilio says the sandbox is for testing only. It uses a shared number, testers must join with a code and sessions end after three days. For real customers, register your own sender.

Do I need DLT registration to use Twilio in India?

For domestic SMS in India, yes: your company and sender ID must be registered on the operators' DLT portal. WhatsApp messages do not go through DLT, but follow Meta's template and opt-in rules.

Written byAstrafolio Team, senior web, SEO and AI specialists in Noida, India.

Next step

Want this working in your business?

A 30-minute call is enough for us to tell you what would move the needle first, what it costs and how long it takes.

Book a discovery call

More reading

You may also like

Cover for the article: AI Receptionist for Clinics: What It Can Do
AI Automation8 min read

AI Receptionist for Clinics: What It Can Do

An AI receptionist for clinics answers after-hours chats, takes booking requests and passes anything clinical to your staff. See limits, safety and costs.

Read

Free audit

Get a free 10-point website and SEO audit

Send us your website address. We go through it point by point and send you what we find, in plain words, within 2 working days. No obligation.

Contact

Drop us a note

Tell us what you are building and what success looks like. A real person replies within 12 hours with next steps, not an automated sequence.

Prefer to talk first?

Pick a 30-minute slot in your time zone. No preparation needed.

Book a discovery call
What do you need? (tap any)

Takes under a minute. A real person replies within 12 hours, and we only use your details to reply. Privacy policy