How WhatsApp works on Twilio today
According to Twilio's official pages, the model is:
- Official API. Sending uses Meta's WhatsApp Business Platform. You enable WhatsApp on a Twilio number by creating a WhatsApp Business Account (WABA) linked to Meta Business Manager, and the docs state that only one WABA is allowed per Twilio account.
- Same messaging API. WhatsApp goes through Twilio's messaging resource, authenticated with Account SID and Auth Token, and numbers use the
whatsapp:prefix followed by the E.164 format. - SDKs. There are libraries for Node.js, Python, C#/.NET, Java, Go, PHP and Ruby, plus a CLI.
- Status callbacks. Twilio calls a URL of yours on every message status change.
- Pricing. According to the Twilio WhatsApp pricing page, checked on September 27, 2026, Twilio charges $0.005 per message, inbound or outbound, plus Meta's per-template-message fee, passed through to the customer. Meta's fee depends on the message category (utility, authentication, marketing), the recipient's country and whether the conversation is inside the 24-hour customer service window.
It's a solid design for teams that already use other Twilio products and want everything in one place. The search for an alternative comes from specific needs, listed below.
Two situations where Twilio stops being a fit
You also need the unofficial connection
The official API requires an approved template to start a conversation and can't connect a WhatsApp number already in use by QR code. Many products need both: official for notifications to larger customers, unofficial for customers who want to connect the number they already use every day. Without both at the same provider, the team maintains two integrations. The differences are detailed in official vs unofficial WhatsApp API.
Per-message cost doesn't fit your model
If your SaaS product charges customers a fixed monthly price, a variable per-message cost eats into the margin on heavy users. On D-API's unofficial connection, billing is per connection, with no per-message charge, and the price per connection drops as your base grows. On the official connection, Meta's per-template charge still applies, because Meta sets it; on D-API it stays with the end customer, and D-API charges a platform fee per connection. See how that compares in WhatsApp API pricing.
Twilio and D-API side by side
| Criteria | Twilio | D-API |
|---|---|---|
| Official API (WhatsApp Business Platform) | Yes | Yes, cloud_api session |
| Unofficial connection by QR code | Check with the vendor | Yes, in the same API |
| Pricing | Per Twilio message plus Meta's fee, passed through | Per connection; on the official API, Meta's fee stays with the end customer |
| Authentication | Account SID and Auth Token | API key in the Authorization header |
| SDKs | Node.js, Python, C#/.NET, Java, Go, PHP and Ruby | Node.js; REST with Swagger for other languages |
On SDKs, Twilio covers more languages. If your backend isn't Node.js, integrating with D-API is plain HTTP, which is usually a thin layer.
Migration guide from Twilio to D-API
The concepts map like this:
| On Twilio | On D-API |
|---|---|
| Account SID and Auth Token | API key in the Authorization header |
Sender number in From with the whatsapp: prefix | sessionId of the connection, created with type cloud_api or unofficial |
To with whatsapp: and E.164 format | to with digits only, like 14155550123 |
| Status Callback URL | Session webhook, with events such as message.delivered and message.read |
| Template message | POST /api/v1/messages/send/template with name, language and variables |
With an official connection created, sending a template looks like this. The template name and variables are illustrative; use the ones already approved in your Meta account:
curl -X POST https://api.d-api.cloud/api/v1/messages/send/template \
-H "Authorization: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"sessionId": "official-connection",
"to": "14155550123",
"template": {
"name": "order_confirmed",
"language": "en_US",
"bodyVariables": ["Maria", "#48213"]
}
}'Free-form text messages, inside the customer service window, use the same route as the unofficial connection: POST /api/v1/messages/send/text. If a customer later prefers to connect by QR code, you create an unofficial session and call the same route, with no new code.
Suggested order
- Create a test account and connect an unofficial number to validate sending and webhooks.
- Switch your system's sending layer to call D-API, keeping Twilio as a fallback.
- Adapt the callback receiver to the D-API envelope, with
eventanddata. - Plan the official connection with your Meta account and confirm which templates you'll use.
- Turn off WhatsApp on Twilio once all volume is going through D-API.
D-API is a WhatsApp API that brings both worlds together. Learn about the official WhatsApp API and the unofficial WhatsApp API, or compare with the Z-API alternative. Start with a 3-day free trial, no credit card, and support in English.
