Skip to content
Chatwise
Skip to Content
Developer docs
Events

message.delivered

Coming soon, not sent yet. The channel reported an outgoing message was delivered.

View as Markdown

Coming soon

Endpoints can subscribe to this event, but nothing is sent for it yet. Its payload may change before it is.

Channels: WhatsApp and Messenger.

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.message.delivered
X-Chatwise-DeliveryThe delivery's id.wd_3f1c0a9b5d7e42688c1f0e2d4b6a8c90
User-AgentAlways Chatwise-Webhooks/1.0.Chatwise-Webhooks/1.0

Payload

This payload isn't final, so don't build on it yet.

{
  "id": "evt_01JE2Z3QK4T8M6N2R5S7V9W1X3",
  "type": "message.delivered",
  "timestamp": "2026-11-12T09:25:36.000Z",
  "apiVersion": "2026-12-01",
  "workspaceId": "42",
  "data": {
    "message": {
      "id": "5680",
      "conversationId": "1234",
      "channel": "WHATSAPP",
      "direction": "outbound",
      "type": "text",
      "text": "Yes, in two shades of blue.",
      "sentAt": "2026-11-12T09:31:02.000Z",
      "ingestedAt": "2026-11-12T09:31:02.350Z",
      "replyToMessageId": null,
      "attachments": []
    },
    "conversation": {
      "id": "1234",
      "channel": "WHATSAPP",
      "status": "open",
      "participant": {
        "name": "Jordan Example",
        "channelId": "12025550147",
        "phoneNumber": "12025550147",
        "instagramUsername": null
      },
      "createdAt": "2026-11-01T09:12:00.000Z",
      "lastMessageAt": "2026-11-12T09:25:36.000Z"
    },
    "account": {
      "id": "11",
      "channel": "WHATSAPP"
    }
  }
}
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 message.delivered.
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.messageobjectThe message, as the API returns it.
data.message.idstringThe message's id.
data.message.conversationIdstringThe conversation the message is in.
data.message.channelstringThe channel the message is on. One of WHATSAPP, INSTAGRAM, MESSENGER, WEBSITE_CHAT.
data.message.directionstringinbound from the customer, outbound from the workspace.
data.message.typestringThe message's type, such as text, image, audio, interactive or whatsapp_template.
data.message.textstring or nullThe text or caption. For other types, text that Chatwise makes of the message, such as JSON for a location or contacts. Null for WhatsApp authentication templates, so a one-time code is never returned.
data.message.sentAtstringWhen the message was sent. ISO 8601, in UTC.
data.message.ingestedAtstringWhen Chatwise stored the message. ISO 8601, in UTC.
data.message.replyToMessageIdstring or nullThe message this one replies to, if any and still visible.
data.message.attachmentsarray of objectsThe message's attachments, at most 10. Always empty on Messenger and Website Chat, and for WhatsApp authentication templates.
data.message.attachments[].typestringThe attachment's type, such as image, video, audio or document.
data.message.attachments[].mediaIdstring or nullThe channel's id for the media, when Chatwise has it: usually on Instagram only.
data.conversationobjectIts conversation, as the API returns it.
data.conversation.idstringThe conversation's id.
data.conversation.channelstringThe channel the conversation is on. One of WHATSAPP, INSTAGRAM, MESSENGER, WEBSITE_CHAT.
data.conversation.statusstringWhether the conversation is open or resolved in the inbox. One of open, resolved.
data.conversation.participantobjectThe customer.
data.conversation.participant.namestring or nullThe customer's name. A placeholder, or on Website Chat their email, when Chatwise doesn't know it.
data.conversation.participant.channelIdstring or nullThe customer's id on the channel: the WhatsApp number, or an Instagram or Messenger id. Null on Website Chat.
data.conversation.participant.phoneNumberstring or nullThe customer's phone number, digits only, on WhatsApp. Null on other channels, and when WhatsApp doesn't show it.
data.conversation.participant.instagramUsernamestring or nullThe customer's Instagram username, when known. Null on WhatsApp.
data.conversation.createdAtstringWhen the conversation was created in Chatwise. ISO 8601, in UTC.
data.conversation.lastMessageAtstring or nullWhen the latest message was sent. Null before the first one. ISO 8601, in UTC.
data.accountobject or nullThe account the conversation is on, such as a WhatsApp number or an Instagram account.
data.account.idstringThe account's id. The same as in accountIds.
data.account.channelstringThe account's channel. One of WHATSAPP, INSTAGRAM, MESSENGER, WEBSITE_CHAT.

Fields are only ever added within an apiVersion, so ignore the ones you don't know. data.message and data.conversation are the objects get a message and get a conversation return.

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, 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.

On this page