Skip to main content

messages.received event

Fired when a message is received.
Besides messages received from contacts (fromMe: false), this event also fires for messages sent by your own number from another device or phone, with fromMe: true. Messages sent through the D-API API trigger the messages.sent event, not messages.received.

Payload

string
required
Always "messages.received"
string
required
ID of the session that received the message
string
required
ISO 8601 timestamp of receipt
string
required
Unique ID for tracing
object
required

Examples by type

When someone edits a message that was already sent, WhatsApp does not update the original message: it sends a new event. That is why the edit arrives as a regular messages.received, with type: "edited_message".data.id is the ID of the edit event. The message that was edited is in data.data.original_message_id — use it to update the record in your database.Media caption edits (image, video, document) also arrive here, with the new caption in message.

Identifying types


Media URLs

Media files are automatically saved to S3 and made available in data.media_url.