Skip to main content

Webhook Events & Payloads

This page shows the exact JSON payload format for each webhook event type.

Message status events

These events fire when an outbound message changes status: message.sent, message.delivered, message.read, message.failed, button.clicked.

{
"event": "message.delivered",
"timestamp": "2024-06-15T10:05:00",
"campaign_id": "507f1f77bcf86cd799439060",
"campaign_name": "Summer Promo",
"message": {
"message_id": "507f1f77bcf86cd799439070",
"contact_phone": "911234567890",
"contact_name": "John Doe",
"status": "delivered",
"previous_status": "sent",
"status_timestamp": "2024-06-15T10:05:00"
}
}

Fields

FieldTypeDescription
eventstringEvent type (e.g., message.delivered)
timestampstringISO 8601 timestamp of the event
campaign_idstring | nullCampaign ID (null if sent via API or chat)
campaign_namestring | nullCampaign name
message.message_idstringInternal message ID
message.contact_phonestringRecipient's phone number
message.contact_namestring | nullRecipient's display name
message.statusstringNew status
message.previous_statusstring | nullPrevious status
message.status_timestampstringWhen the status changed

Additional fields for message.failed

When a message fails, the payload includes two extra fields:

FieldTypeDescription
message.error_messagestringHuman-readable error description
message.error_codenumberWhatsApp error code
{
"event": "message.failed",
"timestamp": "2024-06-15T10:05:00",
"campaign_id": "507f1f77bcf86cd799439060",
"campaign_name": "Summer Promo",
"message": {
"message_id": "507f1f77bcf86cd799439070",
"contact_phone": "911234567890",
"contact_name": "John Doe",
"status": "failed",
"previous_status": "sent",
"status_timestamp": "2024-06-15T10:05:00",
"error_message": "Message undeliverable",
"error_code": 131026
}
}

Inbound message event

Fires when a contact sends you a new message: message.received.

{
"event": "message.received",
"timestamp": "2024-06-15T10:15:00",
"message": {
"message_id": "wamid.HBgNOTE4MDMxMjM0NTY3OQ==",
"contact_phone": "911234567890",
"contact_name": "John Doe",
"content": "Hi, I have a question",
"message_type": "text",
"timestamp": "2024-06-15T10:15:00",
"waba_phone_id": "123456789012345",
"is_reply": false,
"is_from_ad": false
}
}

Fields

FieldTypeDescription
message.message_idstringWhatsApp message ID
message.contact_phonestringSender's phone number
message.contact_namestring | nullSender's display name
message.contentstringMessage text content
message.message_typestringtext, image, video, audio, document, sticker, location, etc.
message.timestampstringWhen the message was received
message.waba_phone_idstringWhich WhatsApp number received the message
message.is_replybooleanWhether this is a reply to one of your messages
message.original_message_idstringOriginal message ID (only when is_reply is true)
message.media_urlstringMedia URL (only for media messages)
message.is_from_adbooleanWhether the message came from an ad click
message.referralobjectAd referral data (only when is_from_ad is true)

Reply event

Fires when a contact replies to one of your outbound messages: message.reply.

{
"event": "message.reply",
"timestamp": "2024-06-15T10:10:00",
"campaign_id": "507f1f77bcf86cd799439060",
"campaign_name": "Summer Promo",
"original_message": {
"message_id": "507f1f77bcf86cd799439070",
"contact_phone": "911234567890",
"contact_name": "John Doe",
"sent_at": "2024-06-15T10:00:00"
},
"reply": {
"message_id": "507f1f77bcf86cd799439071",
"contact_phone": "911234567890",
"contact_name": "John Doe",
"content": "Yes, I'd like to know more!",
"message_type": "text",
"timestamp": "2024-06-15T10:10:00"
}
}

Fields

FieldTypeDescription
original_message.message_idstringID of the outbound message being replied to
original_message.contact_phonestringRecipient's phone number
original_message.contact_namestring | nullRecipient's display name
original_message.sent_atstringWhen the original message was sent
reply.message_idstringReply message ID
reply.contact_phonestringReplier's phone number
reply.contact_namestring | nullReplier's display name
reply.contentstringReply text content
reply.message_typestringtext, image, video, audio, document
reply.timestampstringWhen the reply was received
reply.media_urlstringMedia URL (only for media replies)

Test event

Sent when you click Test in the dashboard: webhook.test.

{
"event": "webhook.test",
"timestamp": "2024-06-15T10:00:00",
"message": "Test webhook message",
"endpoint_id": "507f1f77bcf86cd799439080",
"endpoint_name": "My Endpoint",
"user_id": "507f1f77bcf86cd799439090"
}