Webhook Event: message.received
Real-Time EventJSON payload schema dispatched by Wahide to your destination server whenever an incoming 1-on-1 private WhatsApp message (text, image, or PDF document) is received by your device.
Incoming Direct Chat Event
This event is triggered strictly by 1-on-1 direct customer chats. Group chats, status stories, public channels, and voice call signals are filtered out at the edge to optimize your server resources.
HTTP Endpoint
Authentication
| Header Key | Value | Required |
|---|---|---|
| Content-Type | application/json | Required |
| X-Wahide-Secret | whsec_live_... | Required |
| X-Wahide-Delivery-ID | 01JPLAN0000000000000000099 | Required |
| X-Wahide-Event | message.received | Required |
| X-Wahide-Device-ID | 01JPLAN0000000000000000001 | Required |
| X-Wahide-Timestamp | 1725845000 | Required |
| User-Agent | Wahide-WhatsApp-Webhook-Engine/2.0 | Required |
Request Parameters
The request body must be formatted as JSON with the following parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
event | string | Required | Event identifier. For incoming messages, value is always 'message.received'. example: message.received |
device_id | string | Required | Unique WhatsApp device slot ID in Wahide that received the message. example: 01JPLAN0000000000000000001 |
timestamp | integer | Required | Unix epoch timestamp in seconds when the event was dispatched by Wahide. example: 1725845000 |
data | object | Required | Structured container object holding message details. |
data.message_id | string | Required | Unique WhatsApp message identifier (WhatsApp Message ID). example: 3EB0A1B2C3D4E5F6 |
data.sender | string | Required | Normalized sender phone number in E.164 format without special characters. example: 6281234567890 |
data.sender_jid | string | Required | Official WhatsApp Jabber ID of the sender (e.g. 6281234567890@s.whatsapp.net). example: 6281234567890@s.whatsapp.net |
data.push_name | string | Optional | WhatsApp profile display name configured by the sender. example: John Doe |
data.text | string | Required | Text body content or image/document caption sent by the customer. example: Please check the attached payment proof |
data.has_media | boolean | Required | Indicates whether the message includes an attachment (Photo or PDF Document). example: true |
data.media | object | Optional | Decrypted media object stored in Cloudflare R2 (null if no media or rejected). |
data.media.type | string | Optional | Media category: 'image' for JPEG/PNG/WebP photos, or 'document' for PDF files. example: image |
data.media.url | string | Optional | Direct public Cloudflare R2 CDN URL to download the attachment ($0 egress fee). example: https://pub-r2.wahide.com/tmp/whatsapp-media/01JPLAN000/2026/09/01JPLANXYZ123456.jpg |
data.media.file_name | string | Optional | Original filename or generated filename with appropriate extension. example: payment_receipt.jpg |
data.media.mime_type | string | Optional | Standard MIME type of the file (e.g. image/jpeg, image/png, application/pdf). example: image/jpeg |
data.media.file_size | integer | Optional | Size of the downloaded attachment in bytes (maximum 1 MB). example: 245120 |
data.media_error | string | Optional | Diagnostic error code if attachment was skipped ('file_size_exceeded_1mb', 'unsupported_media_type', 'storage_unavailable'). example: file_size_exceeded_1mb |
data.timestamp | integer | Required | Unix epoch timestamp when the message was sent by the customer. example: 1725844998 |
Code Examples
curl -X POST https://api.your-business.com/webhook \
-H "Content-Type: application/json" \
-H "X-Wahide-Secret: whsec_live_9f8e7d6c5b4a3210fedcba9876543210" \
-H "User-Agent: Wahide-WhatsApp-Webhook-Engine/2.0" \
-d '{
"event": "message.received",
"device_id": "01JPLAN0000000000000000001",
"timestamp": 1725845000,
"data": {
"message_id": "3EB0A1B2C3D4E5F6",
"sender": "6281234567890",
"sender_jid": "6281234567890@s.whatsapp.net",
"push_name": "John Doe",
"text": "Please check the attached payment proof",
"has_media": true,
"media": {
"type": "image",
"url": "https://pub-r2.wahide.com/tmp/whatsapp-media/01JPLAN000/2026/09/01JPLANXYZ123456.jpg",
"file_name": "payment_receipt.jpg",
"mime_type": "image/jpeg",
"file_size": 245120
},
"timestamp": 1725844998
}
}'Response Formats
Mandatory HTTP acknowledgment response required from your server to confirm successful event receipt.
Response Attributes Breakdown
| Attribute | Type | Description |
|---|---|---|
status | string | Receipt acknowledgment status indicator. |