Inbox WebhooksFacebook + Instagram · DM & comments

Get notified the moment a customer messages you

An inbox webhook sends a real-time HTTP POST to your server, n8n, Make or Zapier every time a customer sends a Facebook or Instagram message, or comments on one of your posts. Use it to auto-reply, alert your team, or log the conversation in your CRM — without polling the inbox API every few minutes.

What an inbox webhook does

When a customer sends a Facebook or Instagram message, or comments on one of your posts, Neeflow saves it in your Inbox and — if the channel has an active inbox webhook — immediately POSTs a notification ping to your receiver URL. The ping carries identifiers (channel, conversation, message), the sender, and a short preview of the message. It does not carry the full message text: your receiver fetches the complete conversation through the Inbox API (see Fetch the full message). No customer message content is ever sent anywhere except the ≤120-character preview.

Real-time

POSTed within seconds of the message arriving — no polling.

Signed

Every delivery carries an HMAC-SHA256 signature you verify with your secret.

Retried

Up to 5 attempts with exponential backoff if your receiver is down.

Four events, inbound only. Inbox webhooks fire for inbound Facebook and Instagram messages and comments — one event per kind, so you can tell them apart (see the events table). Outbound messages sent by your Page never trigger a webhook.

The four events

Every inbox activity that triggers a webhook has its own event name — the platform and the kind are baked into the name, so your receiver can route on event alone. When you create a subscription you pick which of the four it receives (all four by default). The payload shape is identical for all four — only event, data.platform and data.type differ.

EventPlatformTypeTriggered when
inbox.facebook.message.receivedfacebookmessageA customer sends a Facebook DM
inbox.instagram.message.receivedinstagrammessageA customer sends an Instagram DM
inbox.facebook.comment.receivedfacebookcommentSomeone comments on a Facebook post
inbox.instagram.comment.receivedinstagramcommentSomeone comments on an Instagram post

For comments, data.externalUserId is post_<postId> and data.messagePreview is the comment text — fetch the conversation through the Inbox API for the full thread, same as for DMs.

Create one in the dashboard

1

Open Integrations → Webhooks, then the Inbox tab

From your dashboard, go to Integrations → Webhooks and switch to the Inbox tab. Pick the channel first — inbox webhooks belong to one channel. Only channel Owners and Admins can create them.

2

Paste your receiver URL

The URL must start with https:// — paste the webhook URL from n8n, Make, Zapier, or your own server. See receiver setup below if you do not have a URL yet.

3

Set a signing secret — or leave it empty

The secret (at least 16 characters) signs every delivery so your receiver can prove the POST really came from Neeflow. Leave the field empty and Neeflow generates a secure one for you. Either way, save it now — it is shown exactly once, right after creation, and never again. If you lose it, delete the subscription and create a new one.

4

Send a test event, then save

After creating, click Send Test on the subscription. Neeflow POSTs a clearly-marked sample payload (test: true) for the subscription's first selected event to your URL and shows which event was sent, the HTTP status and the round-trip time. A 2xx answer means your receiver is wired up correctly.

Prefer the API? The same subscriptions are available as GET/POST /api/v1/channels/{id}/inbox/webhooks (ADMIN API key). The dashboard and the API manage the same subscriptions.

Receiver setup: n8n, Make, Zapier

You do not need your own server. Any of these no-code tools gives you a webhook URL in about a minute — paste it into the dashboard as the receiver URL.

n8n

  1. Create a workflow and add a Webhook node.
  2. Set HTTP Method to POST and Respond to Immediately (so Neeflow gets its 2xx fast).
  3. Copy the Production URL and paste it as the receiver URL in Neeflow.
  4. Add the next nodes (Telegram, Slack, OpenAI, your CRM…) using data.conversationId and data.messagePreview from the payload.

To verify the signature in n8n, add a Code node after the Webhook node:

n8n — Code node (signature check)
// n8n — Code node after the Webhook node (verify + reply fast)
// The Webhook node already captured the raw body for you.
const signature = $input.first().headers['x-neeflow-signature'];
const secret = $env.NEEFLOW_WEBHOOK_SECRET;
const expected = 'sha256=' + require('crypto')
    .createHmac('sha256', secret)
    .update($input.first().json._rawBody || JSON.stringify($input.first().json))
    .digest('hex');
if (signature !== expected) throw new Error('Bad signature');
return [{ json: $input.first().json }];

Make (formerly Integromat)

  1. Create a scenario and add the Webhooks → Custom Webhook trigger module.
  2. Click Add, name it, and copy the generated URL.
  3. Paste the URL as the receiver URL in Neeflow, then click Send Test in Neeflow — Make will capture the sample payload and show its fields.
  4. Map the fields (data.conversationId, data.messagePreview) into the next modules.

Zapier

  1. Create a Zap with the Webhooks by Zapier → Catch Hook trigger.
  2. Copy the webhook URL Zapier shows and paste it as the receiver URL in Neeflow.
  3. Click Send Test in Neeflow, then in Zapier click Test Trigger — the sample payload appears as fields you can use in later steps.

If you run your own server, it only needs one thing: an HTTPS endpoint that accepts POST with a JSON body and answers 2xx quickly. Verify the signature (next sections) before trusting the payload.

Payload reference

Every delivery is a JSON POST with this exact shape. deliveryId is the same as data.messageId — use it to deduplicate on your side. messagePreview is at most 120 characters (or [image] / [video] when the message has media but no text). hasUnreplied is always true for this event — the newest message in the conversation is inbound and unanswered.

POST body — inbox.facebook.message.received
{
  "event": "inbox.facebook.message.received",
  "version": 1,
  "deliveryId": "cmwoinbox0001msg0001abc",
  "timestamp": "2026-11-27T12:00:00.000Z",
  "data": {
    "channelId": "cytpir5zjd8f1ioj7hnvs3609",
    "conversationId": "cmwoinbox0001conv0001abc",
    "platform": "facebook",
    "type": "message",
    "externalUserId": "123456789012345",
    "externalUserName": "Nguyen Van A",
    "sentAt": "2026-11-27T12:00:00.000Z",
    "hasUnreplied": true,
    "unreadCount": 2,
    "messageId": "cmwoinbox0001msg0001abc",
    "messagePreview": "Hello, I would like to ask about your service..."
  }
}

Route by event. In n8n, add an IF or Switch node on event — e.g. DMs go to your auto-reply flow, comments go to a moderation queue. In Make/Zapier, use a filter/router on the same field. The X-Neeflow-Event header always matches the event in the body, so you can route on either.

Headers sent with every delivery

HeaderValue
Content-Typeapplication/json
X-Neeflow-Eventinbox.facebook.message.received (or one of the other 3 events)
X-Neeflow-Delivery-Id<same as data.messageId>
X-Neeflow-Signaturesha256=<hmac-sha256 hex>
X-Neeflow-Timestamp<unix seconds, e.g. 1795468800>

Verify the signature (HMAC-SHA256)

Anyone who knows your receiver URL could POST fake payloads to it. Verify every delivery before acting on it: recompute sha256= + HMAC-SHA256(secret, raw request body) and compare it with the X-Neeflow-Signature header using a constant-time comparison. Two things most people get wrong:

  • Use the raw request bytes. Do not parse the JSON and re-stringify it — key order and spacing change the signature.
  • Compare in constant time (timingSafeEqual / hmac.compare_digest), never with ===.
Node.js (Express)
const crypto = require('crypto');

// Express: use express.raw({ type: 'application/json' }) so you can
// verify against the EXACT bytes Neeflow sent. Do NOT re-stringify
// req.body — JSON key order and spacing change the signature.
function verifyNeeflowWebhook(rawBody, signatureHeader, secret) {
    const expected = 'sha256=' + crypto
        .createHmac('sha256', secret)
        .update(rawBody)
        .digest('hex');
    return crypto.timingSafeEqual(
        Buffer.from(signatureHeader),
        Buffer.from(expected)
    );
}

app.post('/neeflow-inbox', express.raw({ type: 'application/json' }), (req, res) => {
    const signature = req.headers['x-neeflow-signature'];
    if (!verifyNeeflowWebhook(req.body, signature, process.env.NEEFLOW_WEBHOOK_SECRET)) {
        return res.status(401).send('Bad signature');
    }
    const payload = JSON.parse(req.body.toString('utf8'));
    console.log('New inbox event:', payload.event, payload.data.conversationId);
    res.status(200).send('ok'); // reply 2xx fast — see Retries below
});
Python (FastAPI)
import hashlib
import hmac

def verify_neeflow_webhook(raw_body: bytes, signature_header: str, secret: str) -> bool:
    # raw_body must be the EXACT bytes received — do not re-serialize
    # parsed JSON, key order and spacing change the signature.
    expected = "sha256=" + hmac.new(
        secret.encode("utf-8"), raw_body, hashlib.sha256
    ).hexdigest()
    return hmac.compare_digest(signature_header, expected)

# FastAPI example
@app.post("/neeflow-inbox")
async def inbox_webhook(request: Request):
    raw = await request.body()
    signature = request.headers.get("x-neeflow-signature", "")
    if not verify_neeflow_webhook(raw, signature, NEEFLOW_WEBHOOK_SECRET):
        return Response(status_code=401, content="Bad signature")
    payload = await request.json()
    print("New inbox event:", payload["event"], payload["data"]["conversationId"])
    return {"ok": True}  # reply 2xx fast — see Retries below

Fetch the full message

The webhook is a ping, not the message. To read the full conversation, call the Inbox API with an API key (see the API Reference for authentication). Use data.conversationId from the payload:

bash
# List messages in the conversation (newest last)
curl https://neeflow.com/api/v1/channels/<CHANNEL_ID>/inbox/conversations/<CONVERSATION_ID>/messages \
  -H "x-api-key: <YOUR_API_KEY>"

# Or list conversations first, e.g. only ones with unreplied messages
curl "https://neeflow.com/api/v1/channels/<CHANNEL_ID>/inbox/conversations?hasUnreplied=true" \
  -H "x-api-key: <YOUR_API_KEY>"

To reply from your receiver, POST to the same conversation's /messages endpoint — the send is queued and rate-limited, and Facebook's 24-hour messaging window still applies.

Retries, dedup & limits

Delivery. A delivery counts as successful on any 2xx response. Your receiver has 15 seconds to answer; slower than that counts as a failure.

Retries. A 5xx, 429 or network error is retried up to 5 attempts with exponential backoff starting at 60 seconds. A 4xx (except 429) means your receiver rejected the payload — it is marked failed immediately and never retried. Reply 2xx fast and do slow work (AI replies, CRM writes) afterwards.

Dedup. Each (subscription, message) pair is delivered at most once — Neeflow stores one delivery row per pair, so a re-enqueued message never double-notifies. On your side, dedup by deliveryId if you process deliveries in parallel.

Limits. Inbound only — Facebook and Instagram, messages and comments. Four events (see the events table). Outbound messages sent by your Page never fire. Message preview is capped at 120 characters. Pausing a subscription stops new deliveries; deleting one only deactivates it (history is kept).

Secret handling

  • The signing secret is stored encrypted in Neeflow and never returned by any API — it appears exactly once, right after creation.
  • Save it in your receiver's environment or secret store (NEEFLOW_WEBHOOK_SECRET), never in source code or chat.
  • To rotate a secret, delete the subscription and create a new one — there is no in-place rotation, by design.
  • Your receiver URL must stay https://. Neeflow never follows redirects to plain http://.

See a test event in your receiver? Check the Delivery Log on the subscription — it shows every attempt, error and timestamp.