Skip to content
New Describe an automation in plain words, and AI builds it for you.
Developers

Webhooks

Get a signed HTTPS call the moment something happens, so your system can react straight away.

7 min read Admin

A webhook is an address on your server. When an event happens, such as a customer reply, Flowleb sends the details there straight away. No need to keep asking the API.

Customer Flowleb Your server
1Sends a WhatsApp message
2POST to your webhook URLmessage_received + signature
3Reply 200 OK, fastwithin 10 seconds
Your server checks the signature, answers quickly, then does its work.

Step 1 · Make an address that accepts POST

It must be a public https address, like https://yourapp.com/flowleb/webhook. The code samples in step 3 are complete, working handlers.

Step 2 · Add the webhook

  1. Open Webhooks and click New webhook

    Developer Webhooks

  2. Fill in the form

    Your URL, the events you want, and a signing secret: a long random string only you and Flowleb know.

  3. Click Test fire

    Flowleb sends a test call. Your server should answer with 200.

New webhook

1Endpoint URLhttps://yourapp.com/flowleb/webhook 2Eventsmessage_receivedmessage_deliveredmessage_failed 3Signing secret••••••••••••••••
4Test fire Save
  1. Your public HTTPS address.
  2. Pick the events you want, or all of them.
  3. A long random secret. You'll use it to check the signature.
  4. Send a test call to make sure your server answers.

Simplified drawing of the dashboard page.

Prefer code? Create it through the API:

POST /api/v1/webhooks

Leave out events (or send ["*"]) to receive everything.

cURL
curl -X POST https://flowleb.com/api/v1/webhooks \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "CRM sync",
    "url": "https://yourapp.com/flowleb/webhook",
    "events": ["message_received", "message_delivered", "message_failed"],
    "secret": "a-long-random-string-only-you-know"
  }'

What Flowleb sends

Example delivery
POST https://yourapp.com/flowleb/webhook
Content-Type: application/json
X-Flowleb-Signature: 5d41402abc4b2a76b9719d911017c592…

{
  "id": "0b8f6a52-6c1e-4b8a-9d55-0f3c5e2a7b91",
  "event": "message_received",
  "eventType": "message_received",
  "created": "2026-11-18T10:45:03+05:30",
  "timestamp": 1763442903,
  "data": {
    "message_id": 48231,
    "conversation_id": 5530,
    "from_number": "919876543210",
    "body": "Is my order on the way?",
    "media_type": null,
    "provider": "waba",
    …
  }
}
id
Unique per delivery. Save it and skip ids you have already handled.
event
Which event this is. eventType is the same value.
created · timestamp
When it happened.
data
The details. Fields depend on the event.

Step 3 · Check the signature

When you set a secret, every delivery has an X-Flowleb-Signature header: an HMAC-SHA256 of the request body made with your secret, written as hex. Make the same code yourself and compare. If they don't match, reject the call. It didn't come from Flowleb.

import express from 'express';
import crypto from 'node:crypto';

const app = express();

// Keep the RAW body: the signature is made from the exact bytes we send.
app.post('/flowleb/webhook', express.raw({ type: 'application/json' }), (req, res) => {
  const expected = crypto
    .createHmac('sha256', process.env.FLOWLEB_WEBHOOK_SECRET)
    .update(req.body)                       // Buffer, before JSON.parse
    .digest('hex');
  const got = req.get('X-Flowleb-Signature') || '';

  const ok = got.length === expected.length &&
    crypto.timingSafeEqual(Buffer.from(got), Buffer.from(expected));
  if (!ok) return res.sendStatus(401);

  const event = JSON.parse(req.body);
  res.sendStatus(200);                      // answer first…
  queue.add(event);                         // …then do the slow work
});

Events

EventFires when
message_received A customer message arrives
message_sent · message_delivered · message_read · message_failed One of your messages changes status
broadcast_created · broadcast_status_updated A broadcast is created or changes status
broadcast_message_status_updated One person's message in a broadcast changes status
campaign_created · campaign_status_updated A campaign is created or changes status
campaign_contact_status_updated One person's message in a campaign changes status
campaign_contact_replied · campaign_contact_clicked Someone replies to a campaign or clicks its link
contact_opt_in · contact_updated A contact opts in or is changed
device_status_updated A connected number goes online or offline
* Every event

Delivery rules

Answer within 10 seconds
Slower than that counts as a failure. Reply 200 first, then do slow work in the background.
Retries
Up to 3 tries in total when your server is unreachable, times out, or answers 429 or 5xx.
No retry on other 4xx
Answering 400, 401 or 404 means "rejected", so Flowleb doesn't try again.
Same event twice
Can happen after a retry. Skip any id you have already handled.
Failing hooks
After 3 failures in a row the webhook is marked Failing on the Webhooks page, with the last error, so you can fix it.

Still stuck? Ask the team, a person replies by email.