Loading...
Tutorials 3 min read

WhatsApp API with Webhooks: How to Send and Receive Messages

How a WhatsApp API works: tokens, sending messages, webhooks for real-time events, and how to connect everything to Zapier, Make or n8n.

Also available in: PT ES
WhatsApp API with Webhooks: How to Send and Receive Messages

Short answer: a WhatsApp API works in two directions. To send, your system makes an authenticated POST with the recipient and message. To receive, you register a webhook URL and the platform POSTs to it on every incoming message or status change (sent, delivered, read).

How sending works

In Zapini, generate an API token in the dashboard and call the send endpoint for the instance (number) you want:

curl -X POST https://zapini.app/api/v1/instances/{id}/send-message \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"recipient": "+15551234567", "message": "Hi! Your order is out for delivery."}'

Exact fields, media, voice notes and Cloud API templates are in the developer docs.

How receiving works (webhooks)

  1. Register your system’s public URL as the instance webhook.
  2. On each event, the platform sends JSON with the event type, sender, content and message ID.
  3. Your endpoint returns 200 quickly and processes the work in a queue.

Best practices

  • Respond fast: return 200 and process later; slow webhooks cause retries.
  • Idempotency: use the message ID so the same event is never processed twice.
  • Security: HTTPS, a secret token on the webhook, and never expose your API token in front-end code.
  • Limits: follow WhatsApp’s rules; bulk sends without consent get numbers banned.

No code: Zapier, Make and n8n

Want to send webhooks in Zaps? Use the Webhooks by Zapier trigger (or the Make/n8n equivalent) as the instance’s webhook URL to receive messages, and an HTTP request action to call the send endpoint. That connects WhatsApp to spreadsheets, ERPs and email without writing code.

Common use cases

  • Order confirmations and delivery tracking;
  • Appointment and payment reminders;
  • Website leads routed straight to a sales rep’s WhatsApp;
  • Syncing conversations with your CRM (here’s how).

Frequently asked questions

Do I need Meta’s official API to use the API?

No. In Zapini the API works with numbers connected by QR Code or the official Cloud API. For templates and high volume, the Cloud API is recommended.

What is the difference between an API and a webhook?

Your system calls the API (you ask for something). The platform calls the webhook (it tells you something happened).

Can I get read receipts?

Yes. Status events tell you when a message was sent, delivered and read.

Try it yourself

Zapini brings WhatsApp (QR Code or the official Cloud API), AI agents, a Kanban CRM, flows and an API into one platform. Create your account and set up your first flow today.

Share:
1 Views

Related Posts