BlazeChats
Start free

Developers

Webhooks

Get incoming messages and delivery updates pushed to your server, signed with HMAC-SHA256.

Add an endpoint

  1. In the app, open Settings > Add endpoint (owners and admins).
  2. Enter an https URL on your server and pick the events you want. A workspace can have up to 5 endpoints.
  3. Copy the signing secret (whsec_…). It's shown once; the app stores it encrypted.
  4. Press Test to send a signed ping event and see the HTTP status your server returned.

Events

EventWhen
message.receivedA customer sent a message
message.statusAn outgoing message was sent, delivered, read or failed
order.createdA new order arrived from WhatsApp, Shopify, WooCommerce or the API
order.updatedAn order's status or payment changed
cart.abandonedA checkout was left unfinished
call.endedA WhatsApp call finished, was missed or was declined

message.status fires for each step Meta reports (sent, delivered, read, failed) for every outgoing message, whether it came from the inbox, a broadcast or the API, and when an API send fails before reaching Meta.

Payload

Every delivery is a JSON POST with the same envelope:

message.received
{
  "id": "6f0c1a52-1b5e-4c55-9d1e-0c8f7f1f2a10",
  "type": "message.received",
  "created_at": "2026-11-25T06:31:12.000Z",
  "workspace_id": "3d6f…",
  "data": {
    "conversation_id": "a1b2…",
    "message": { "id": "…", "direction": "in", "type": "text", "text": "Is my order shipped?", "status": "received", "created_at": "…" },
    "contact": { "id": "…", "phone": "919876543210", "name": "Asha Verma", "opted_out": false, "tags": ["vip"] }
  }
}
message.status
{
  "id": "…",
  "type": "message.status",
  "created_at": "2026-11-25T06:31:40.000Z",
  "workspace_id": "3d6f…",
  "data": {
    "message_id": "…",
    "wa_message_id": "wamid.HBgM…",
    "status": "delivered",
    "error": null,
    "conversation_id": "…",
    "contact_id": "…",
    "timestamp": "2026-11-25T06:31:39.000Z"
  }
}

The message and contact objects have the same fields as the Message and Contact API objects. Headers include X-BlazeChats-Event, X-BlazeChats-Delivery (unique per delivery, use it to de-duplicate) and X-BlazeChats-Signature.

Verify signatures

X-BlazeChats-Signature looks like t=1764052272,v1=5f2b…. Compute HMAC-SHA256 of <t>.<raw body> with your secret, compare it to v1 in constant time, and reject timestamps older than five minutes. Use the raw request body, before any JSON parsing.

Node.js
import { createHmac, timingSafeEqual } from "node:crypto";

export function verifyWebhook(rawBody: string, header: string, secret: string) {
  const parts = Object.fromEntries(header.split(",").map((p) => p.split("=")));
  const t = Number(parts.t);
  if (!t || Math.abs(Date.now() / 1000 - t) > 300) return false;
  const expected = createHmac("sha256", secret).update(`${t}.${rawBody}`).digest();
  const given = Buffer.from(parts.v1 ?? "", "hex");
  return given.length === expected.length && timingSafeEqual(given, expected);
}
Python
import hmac, hashlib, time

def verify_webhook(raw_body: bytes, header: str, secret: str) -> bool:
    parts = dict(p.split("=", 1) for p in header.split(","))
    t = int(parts.get("t", "0"))
    if abs(time.time() - t) > 300:
        return False
    expected = hmac.new(secret.encode(), f"{t}.".encode() + raw_body, hashlib.sha256).hexdigest()
    return hmac.compare_digest(expected, parts.get("v1", ""))

Retries and timeouts

  • Respond with any 2xx within 10 seconds. Do slow work after responding.
  • Timeouts, network errors and non-2xx responses are retried up to 6 attempts with exponential backoff. Redirects are not followed.
  • Deliveries can arrive more than once or out of order. De-duplicate on X-BlazeChats-Delivery and compare timestamps.
  • The endpoint list shows the last delivery time and result. Pause an endpoint to stop deliveries without deleting it.