Skip to content
Chatwise
Skip to Content
Developer docs
Events

webhook.test

You sent a test event, from the dashboard or with the API.

View as Markdown

Sent when someone sends a test from the dashboard or calls Send a test event, also to a paused endpoint. Endpoints don't subscribe to it.

It is signed like every event. It is sent once: it isn't retried, and it isn't in the delivery log. Its X-Chatwise-Delivery header is always wd_test.

Headers

HeaderDescriptionExample
webhook-idThe event's id, the same on every retry and redelivery. Dedupe on it.evt_01JE2Z3QK4T8M6N2R5S7V9W1X3
webhook-timestampWhen this attempt was signed, in Unix seconds.1794475538
webhook-signatureOne or more signatures, separated by spaces: v1, and the base64 HMAC-SHA256 of <webhook-id>.<webhook-timestamp>.<body>.v1,<base64>
X-Chatwise-EventThe event's name.webhook.test
X-Chatwise-DeliveryThe delivery's id.wd_test
User-AgentAlways Chatwise-Webhooks/1.0.Chatwise-Webhooks/1.0

Payload

{
  "id": "evt_01JE2Z3QK4T8M6N2R5S7V9W1X3",
  "type": "webhook.test",
  "timestamp": "2026-11-12T09:25:36.000Z",
  "apiVersion": "2026-12-01",
  "workspaceId": "42",
  "data": {
    "endpointId": "we_01JE2Z3K8Q9V7W5X4Y3Z2A1B0C",
    "message": "This is a test event from Chatwise."
  }
}
FieldTypeDescription
idstringThe event's id, the same on every retry and redelivery. Also the webhook-id header.
typestringThe event's name. Also the X-Chatwise-Event header. Always webhook.test.
timestampstringWhen the event happened. The same on every retry. ISO 8601, in UTC.
apiVersionstringThe payload format, as a date.
workspaceIdstringThe workspace the event happened in.
dataobjectWhat happened.
data.endpointIdstringThe endpoint the test was sent to.
data.messagestringA fixed sentence.

Verify it

Check the signature against the raw body before you trust the event. Verify signatures explains each step and has a complete server.

verify.mjs
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. A test that fails isn't retried.

On this page