For developers searching "WhatsApp API for developers", here's a practical walkthrough: three available paths, official providers vs unofficial libraries, real costs and minimal-friction setup. Code samples in TypeScript, Python and cURL throughout.
The 3 WhatsApp APIs for developers
- Hosted by Meta, no infrastructure to run
- You handle tokens, template approval, webhook signing
- Best when: you want maximum control and have dedicated devops
2. Business API via official BSP (Zavu, Twilio, etc.)
- BSPs abstract Meta's complexity
- SDK in multiple languages
- Best for: 99% of use cases
3. Unofficial libraries (avoid)
- Reverse-engineer WhatsApp Web
- Risk of permanent ban
- Best for: nothing in production
Quickstart via official BSP
bash
npm install @zavudev/sdk # or: pip install zavudev
typescript
import Zavu from "@zavudev/sdk"
const zavu = new Zavu({ apiKey: process.env.ZAVU_API_KEY })
await zavu.messages.send({
to: "+14155551234",
channel: "whatsapp",
text: "Hello from the API!"
})
That's it — first message in < 30 seconds of code.
The 24h service window
Critical rule:
- Customer messages you → 24h window opens → send anything free
- 24h passes → template only
Design your flows around this. Use templates for proactive outbound (order confirmations, OTPs, reminders), free text inside the window.
Message types
Text
typescript
await zavu.messages.send({ to, channel: "whatsapp", text: "Hi" })
Template (outside 24h window)
typescript
await zavu.messages.send({
to, channel: "whatsapp", messageType: "template",
content: { templateId: "tpl_order_confirmed", templateVariables: { "1": "John" } }
})
typescript
await zavu.messages.send({
to, channel: "whatsapp", messageType: "image",
content: { mediaUrl: "https://..." }
})
typescript
await zavu.messages.send({
to, channel: "whatsapp", messageType: "buttons",
text: "Choose option",
content: { buttons: [{ id: "1", title: "Buy" }, { id: "2", title: "Support" }] }
})
Webhooks for receiving
typescript
export async function POST(req: Request) {
const event = await req.json()
if (event.type === "message.inbound") {
await zavu.messages.send({
to: event.message.from,
channel: "whatsapp",
text: "Got it"
})
}
return new Response("ok")
}
Event types:
message.inbound — customer sentmessage.delivered — deliveredmessage.read — readmessage.failed — failed (with reason)button.reply — customer pressed a buttontemplate.status_changed — template approved/rejected
Common pitfalls
Webhook timeout: Meta retries if you don't respond 200 in 2 seconds. Acknowledge fast, process async.
Template rejection cycles: Meta rejects templates that look promotional in Utility category. Read the
template guidelines carefully.
Quality score degradation: high block rates throttle your number. Verify opt-ins, respect STOP requests.
Rate limits: Meta enforces messaging tiers (250/day → 1k → 10k → 100k). Verify business to increase.
Pricing snapshot (US, 2026)
| Category | Cost per 24h conversation |
|---|
| Service (customer-initiated) | $0.00 |
|---|
| Authentication | $0.005 |
|---|
| Utility | $0.015 |
|---|
| Marketing | $0.025 |
|---|
Full pricing breakdown.
Choosing a BSP
| Provider | Markup | Setup | Contract | Best for |
|---|
| Zavu | 0% | $0 | Month-to-month | Multi-channel devs |
|---|
| Twilio | 5-20% | $0 | Month-to-month | Voice + SMS too |
|---|
| MessageBird | Variable | $600 | 3 months | Enterprise |
|---|
| Gupshup | 10-25% | $0 | Month-to-month | India-focused |
|---|
Conclusion
The WhatsApp API in 2026 is mature and accessible. Pick a BSP without markup or contract, use templates for outbound, free text inside the 24h window, and instrument with webhooks.
Zavu free tier covers your first 2,000 messages — no card needed.