Skip to content

Events Reference

Watzy emits two event types on your registered webhook endpoints.


message.received

Fired when a WhatsApp user sends a message to one of your connected phone numbers.

Payload

json
{
  "event": "message.received",
  "timestamp": "2024-06-06T14:30:00+00:00",
  "data": {
    "account_id": 1,
    "from": "201234567890",
    "message_id": "wamid.HBgLMjAxMjM0NTY3ODkVAgASGCA...",
    "type": "text",
    "body": "Hi, I'd like to track my order.",
    "media_id": null,
    "timestamp": "1717681800"
  }
}

Data fields

FieldTypeDescription
account_idintegerYour Watzy account ID the message arrived on
fromstringSender's phone number (no + prefix)
message_idstringWhatsApp message ID
typestringMessage type — see table below
bodystringText content or a label for media messages
media_idstring | nullMeta media ID (present for image/video/audio/document)
timestampstringUnix timestamp from WhatsApp

Message types

typebody valuemedia_id
textThe text the user typednull
imageCaption or [Image]Media ID
videoCaption or [Video]Media ID
audio[Audio]Media ID
documentCaption or [Document]Media ID
sticker[Sticker]Media ID
buttonThe button text the user tappednull
(other)[<type> message]null

message.status_update

Fired when a message you sent has a delivery status change.

Payload

json
{
  "event": "message.status_update",
  "timestamp": "2024-06-06T14:31:05+00:00",
  "data": {
    "message_id": "wamid.HBgLMjAxMjM0NTY3ODkVAgARGCA...",
    "status": "delivered",
    "errors": [],
    "timestamp": "1717681865"
  }
}

Data fields

FieldTypeDescription
message_idstringThe WAMID returned by the send endpoint
statusstringCurrent status — see table below
errorsarrayNon-empty when status is failed
timestampstringUnix timestamp from WhatsApp

Status progression

Statuses follow this precedence (highest wins — a message will never downgrade):

sent → delivered → read

A message can also end in failed if Meta could not deliver it.

StatusMeaning
sentAccepted by Meta, en route to the device
deliveredArrived on the recipient's device
readRecipient opened the message
failedDelivery failed — check errors for the reason

Error object (when status is failed)

json
{
  "errors": [
    {
      "code": 131047,
      "message": "Re-engagement message: message failed to send because more than 24 hours have passed since the customer last replied."
    }
  ]
}

ping

Sent when you click Test on a webhook endpoint in the dashboard. Use it to confirm your server is reachable and responding correctly.

json
{
  "event": "ping",
  "timestamp": "2024-06-06T14:00:00+00:00",
  "data": {
    "message": "Webhook test from Watzy"
  }
}

Built with ❤️ on top of the WhatsApp Business API.