Docs

Webhooks and events

Receive WhatsApp messages, statuses and events in real time at your URL, with metadata to route them in your system.

Set the URL

PUT /instances/{id}

curl -X PUT https://api.zapzapapi.com/api/v1/instances/{id} \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "x-api-secret: YOUR_API_SECRET" \
  -d '{"webhook_url":"https://mysite.com/webhook","metadata":{"customer":"123"}}'

Receive the events

Every incoming message or status change arrives as a POST to your URL. Reply 2xx fast:

Node.js (Express)

// Minimal handler in Node.js (Express)
app.post("/webhook", (req, res) => {
  res.sendStatus(200);          // reply 2xx fast
  const event = req.body;       // incoming message, status, etc.
  // process outside the response path (queue, worker, etc.)
});

Frequently asked questions

How do I receive WhatsApp messages through a webhook?

Set the instance's webhook_url with a PUT to /api/v1/instances/{id}. From then on, every incoming message, delivery status and event arrives as a POST to your URL, over HTTPS.

What is the webhook metadata?

A free-form JSON you attach to the instance (for example the customer ID or the plan). It is included automatically in the webhooks you receive, which makes it easy to route the event in your system.

How should I respond to the webhook?

Reply 2xx as fast as possible and do the heavy work outside the response path (queue or worker). A webhook that takes too long to respond is treated as problematic.

Do I need HTTPS?

Yes. The webhook_url must be HTTPS and reachable from the internet so ZapZap can deliver the events.

Start now

Create your account, connect a number in minutes and test the API with warm-up and anti-ban. R$15 per active number/month, prepaid, no lock-in.