--- title: WhatsApp API for Developers: Complete 2026 Guide description: Practical WhatsApp API guide for developers in 2026: Cloud API vs Business API vs unofficial, pricing, requirements and code in multiple languages. date: 2026-05-17 author: Victor Villalobos locale: en source: https://www.zavu.dev/en/blog/api-whatsapp-desarrolladores tags: WhatsApp, API, Developers, Tutorial --- # WhatsApp API for Developers: Complete 2026 Guide 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 ### 1. WhatsApp Cloud API (Meta, direct) - 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" } } }) ``` ### Media ```typescript await zavu.messages.send({ to, channel: "whatsapp", messageType: "image", content: { mediaUrl: "https://..." } }) ``` ### Interactive (buttons, lists) ```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 // Next.js / Hono / Express endpoint export async function POST(req: Request) { const event = await req.json() if (event.type === "message.inbound") { // Reply await zavu.messages.send({ to: event.message.from, channel: "whatsapp", text: "Got it" }) } return new Response("ok") } ``` Event types: - `message.inbound` — customer sent - `message.delivered` — delivered - `message.read` — read - `message.failed` — failed (with reason) - `button.reply` — customer pressed a button - `template.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](https://developers.facebook.com/docs/whatsapp/business-management-api/message-templates) 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](/en/blog/whatsapp-business-api-pricing). ## Choosing a BSP | Provider | Markup | Setup | Contract | Best for | |---|---|---|---|---| | [Zavu](https://www.zavu.dev/en) | 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 | ## Related resources - [WhatsApp Cloud API tutorial](/en/blog/whatsapp-cloud-api-tutorial) - [How to build a WhatsApp chatbot](/en/blog/como-crear-chatbot-whatsapp) - [WhatsApp Business API pricing](/en/blog/whatsapp-business-api-pricing) - [Zavu vs Twilio comparison](/en/vs/twilio) - [Full technical documentation](https://docs.zavu.dev/quickstart) ## 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](/en/whatsapp-business-api) free tier covers your first 2,000 messages — no card needed.