Events
comment.received
Coming soon, not sent yet. Someone commented on a post of a connected Instagram account.
Coming soon
Endpoints can subscribe to this event, but nothing is sent for it yet. Its payload may change before it is.
Channels: Instagram.
Headers
| Header | Description | Example |
|---|---|---|
webhook-id | The event's id, the same on every retry and redelivery. Dedupe on it. | evt_01JE2Z3QK4T8M6N2R5S7V9W1X3 |
webhook-timestamp | When this attempt was signed, in Unix seconds. | 1794475538 |
webhook-signature | One or more signatures, separated by spaces: v1, and the base64 HMAC-SHA256 of <webhook-id>.<webhook-timestamp>.<body>. | v1,<base64> |
X-Chatwise-Event | The event's name. | comment.received |
X-Chatwise-Delivery | The delivery's id. | wd_3f1c0a9b5d7e42688c1f0e2d4b6a8c90 |
User-Agent | Always Chatwise-Webhooks/1.0. | Chatwise-Webhooks/1.0 |
Payload
The contents of data aren't decided yet. The outer fields are the same as every event's.
{
"id": "evt_01JE2Z3QK4T8M6N2R5S7V9W1X3",
"type": "comment.received",
"timestamp": "2026-11-12T09:25:36.000Z",
"apiVersion": "2026-12-01",
"workspaceId": "42",
"data": {}
}| Field | Type | Description |
|---|---|---|
id | string | The event's id, the same on every retry and redelivery. Also the webhook-id header. |
type | string | The event's name. Also the X-Chatwise-Event header. Always comment.received. |
timestamp | string | When the event happened. The same on every retry. ISO 8601, in UTC. |
apiVersion | string | The payload format, as a date. |
workspaceId | string | The workspace the event happened in. |
data | object | What happened. |
Fields are only ever added within an apiVersion, so ignore the ones you don't know.
Verify it
Check the signature against the raw body before you trust the event. Verify signatures explains each step and has a complete server.
import { createHmac, timingSafeEqual } from "node:crypto";
const FIVE_MINUTES = 5 * 60;
// rawBody is the request body exactly as received (a Buffer or a string).
// headers has lowercase names, as Node's request.headers does.
export function verifyChatwiseWebhook(rawBody, headers, secret, now = Date.now() / 1000) {
const id = headers["webhook-id"];
const timestamp = headers["webhook-timestamp"];
const signatures = headers["webhook-signature"];
if (!id || !timestamp || !signatures) return false;
// Refuse old requests, so a captured one can't be sent again later.
if (!(Math.abs(now - Number(timestamp)) <= FIVE_MINUTES)) return false;
const key = Buffer.from(secret.slice("whsec_".length), "base64");
const expected = createHmac("sha256", key).update(`${id}.${timestamp}.`).update(rawBody).digest();
// While a secret is being rotated there are two signatures. One match is enough.
return signatures.split(" ").some((signature) => {
const [version, value = ""] = signature.split(",");
const received = Buffer.from(value, "base64");
return version === "v1" && received.length === expected.length && timingSafeEqual(received, expected);
});
}Answer it
Answer with any 2xx status within 10 seconds, and do the work afterwards. The same event can arrive more than once, so skip a webhook-id you already handled. What other answers do is in delivery and retries.