Skip to main content

Message Event

Triggered when a new message is received on your WhatsApp instance. This includes all message types: text, media, polls, calls, reactions, and more.

Event Type

message

Payload Structure

{
"event": "message",
"instanceId": "instance-uuid",
"data": {
"id": "message-db-id",
"messageId": "whatsapp-message-id",
"messageType": "text",
"instanceId": "instance-uuid",
"connectedNumber": "5511999999999",
"timestamp": 1702500000,
"fromMe": false,
"viewOnce": false,
"status": "RECEIVED",
"chat": {
"id": "chat-id",
"jid": "[email protected]",
"lid": null,
"profilePictureUrl": "https://...",
"name": "John Doe",
"isGroup": false,
"isLid": false
},
"sender": {
"id": "sender-id",
"jid": "[email protected]",
"lid": null,
"name": "John Doe",
"profilePictureUrl": "https://..."
},
// Message type specific fields...
}
}

Base Message Fields

All message types include these base fields:

FieldTypeDescription
idstringInternal database message ID
messageIdstringWhatsApp message ID
messageTypestringType of message (see Message Types)
instanceIdstringInstance that received the message
connectedNumberstringPhone number connected to the instance
timestampnumberUnix timestamp (seconds)
fromMebooleanWhether the message was sent by the connected number
viewOnceboolean | nullWhether this is a view-once message
statusstringMessage status (see Status Values)
chatobjectChat information
senderobjectSender information
quotedMessageobject | undefinedQuoted/replied message (if any)

Chat Object

FieldTypeDescription
idstringInternal chat ID
jidstring | nullWhatsApp JID ([email protected])
lidstring | nullWhatsApp LID (local identifier)
profilePictureUrlstring | nullProfile picture URL
namestring | nullChat name
isGroupbooleanWhether this is a group chat
isLidbooleanWhether using LID identifier

Sender Object

FieldTypeDescription
idstringInternal sender ID
jidstring | nullWhatsApp JID
lidstring | nullWhatsApp LID
namestring | nullSender name
profilePictureUrlstring | nullProfile picture URL

Status Values

StatusDescription
UNKNOWNStatus unknown
ERRORMessage failed to send
PENDINGMessage is pending
SENTMessage sent to server
RECEIVEDMessage delivered to recipient
READMessage read by recipient
PLAYEDAudio/video played by recipient

Message Types

Text Message

{
"messageType": "text",
"text": "Hello, world!"
}
FieldTypeDescription
textstringMessage text content

Image Message

{
"messageType": "image",
"mediaUrl": "https://storage.example.com/image.jpg",
"thumbnailUrl": "https://storage.example.com/thumb.jpg",
"mimetype": "image/jpeg",
"filename": "photo.jpg",
"fileSize": 102400,
"caption": "Check this out!",
"width": 1920,
"height": 1080
}
FieldTypeDescription
mediaUrlstring | nullURL to download the media
thumbnailUrlstring | nullURL to thumbnail image
mimetypestringMIME type of the file
filenamestring | nullOriginal filename
fileSizenumber | nullFile size in bytes
captionstring | nullImage caption
widthnumber | nullImage width in pixels
heightnumber | nullImage height in pixels

Video Message

{
"messageType": "video",
"mediaUrl": "https://storage.example.com/video.mp4",
"thumbnailUrl": "https://storage.example.com/thumb.jpg",
"mimetype": "video/mp4",
"filename": "video.mp4",
"fileSize": 5242880,
"duration": 30,
"caption": "Watch this!",
"width": 1280,
"height": 720,
"gifPlayback": false
}
FieldTypeDescription
mediaUrlstring | nullURL to download the video
thumbnailUrlstring | nullURL to thumbnail image
mimetypestringMIME type
filenamestring | nullOriginal filename
fileSizenumber | nullFile size in bytes
durationnumber | nullDuration in seconds
captionstring | nullVideo caption
widthnumber | nullVideo width in pixels
heightnumber | nullVideo height in pixels
gifPlaybackboolean | nullWhether to play as GIF

Audio Message

{
"messageType": "audio",
"mediaUrl": "https://storage.example.com/audio.ogg",
"mimetype": "audio/ogg; codecs=opus",
"fileSize": 51200,
"duration": 15,
"voiceNote": true
}
FieldTypeDescription
mediaUrlstring | nullURL to download the audio
mimetypestringMIME type
fileSizenumber | nullFile size in bytes
durationnumber | nullDuration in seconds
voiceNoteboolean | nullWhether this is a voice note (PTT)

Document Message

{
"messageType": "document",
"mediaUrl": "https://storage.example.com/document.pdf",
"thumbnailUrl": "https://storage.example.com/thumb.jpg",
"mimetype": "application/pdf",
"filename": "report.pdf",
"fileSize": 1048576,
"caption": "Here's the report",
"pageCount": 10
}
FieldTypeDescription
mediaUrlstring | nullURL to download the document
thumbnailUrlstring | nullURL to thumbnail
mimetypestringMIME type
filenamestring | nullOriginal filename
fileSizenumber | nullFile size in bytes
captionstring | nullDocument caption
pageCountnumber | nullNumber of pages (PDF)

Sticker Message

{
"messageType": "sticker",
"mediaUrl": "https://storage.example.com/sticker.webp",
"mimetype": "image/webp",
"fileSize": 20480,
"width": 512,
"height": 512
}
FieldTypeDescription
mediaUrlstring | nullURL to download the sticker
mimetypestringMIME type
fileSizenumber | nullFile size in bytes
widthnumber | nullSticker width in pixels
heightnumber | nullSticker height in pixels

Location Message

{
"messageType": "location",
"latitude": -23.550520,
"longitude": -46.633308,
"name": "São Paulo",
"address": "São Paulo, SP, Brazil",
"thumbnailUrl": "https://..."
}
FieldTypeDescription
latitudenumberLatitude coordinate
longitudenumberLongitude coordinate
namestring | nullLocation name
addressstring | nullLocation address
thumbnailUrlstring | nullMap thumbnail URL

Live Location Message

{
"messageType": "live_location",
"latitude": -23.550520,
"longitude": -46.633308,
"accuracy": 10,
"speed": 5.5,
"degrees": 180,
"caption": "On my way!",
"sequenceNumber": 1,
"timeOffset": 3600
}
FieldTypeDescription
latitudenumberLatitude coordinate
longitudenumberLongitude coordinate
accuracynumber | nullAccuracy in meters
speednumber | nullSpeed in m/s
degreesnumber | nullHeading in degrees
captionstring | nullLocation caption
sequenceNumbernumber | nullUpdate sequence number
timeOffsetnumber | nullSeconds remaining for live location

Contact Message

{
"messageType": "contact",
"contacts": [
{
"name": "John Doe",
"number": "5511999999999",
"vcard": "BEGIN:VCARD..."
}
]
}
FieldTypeDescription
contactsarrayArray of contact objects
contacts[].namestringContact name
contacts[].numberstringPhone number
contacts[].vcardstring | nullFull vCard data

Reaction Message

{
"messageType": "reaction",
"reaction": "👍",
"targetMessageId": "3EB0..."
}
FieldTypeDescription
reactionstringEmoji reaction (empty string to remove)
targetMessageIdstringID of the message being reacted to

Edited Message

{
"messageType": "edited",
"editedContent": "Updated message text",
"originalMessageId": "3EB0..."
}
FieldTypeDescription
editedContentstring | nullNew message content
originalMessageIdstring | nullID of the original message

Deleted Message

{
"messageType": "deleted",
"originalMessageId": "3EB0..."
}
FieldTypeDescription
originalMessageIdstringID of the deleted message

Poll Message

{
"messageType": "poll",
"pollName": "What's your favorite color?",
"options": [
{ "id": "opt1", "name": "Red" },
{ "id": "opt2", "name": "Blue" },
{ "id": "opt3", "name": "Green" }
],
"selectableCount": 1
}
FieldTypeDescription
pollNamestringPoll question
optionsarrayArray of poll options
options[].idstringOption ID
options[].namestringOption text
selectableCountnumberMax selections (0 = unlimited, 1 = single choice)
messageSecretstring | undefinedBase64 encoded secret for vote decryption

Poll Vote Message

{
"messageType": "poll_vote",
"pollMessageId": "3EB0...",
"pollChatJid": "[email protected]",
"voterJid": "[email protected]",
"selectedOptions": ["Red", "Blue"],
"previousSelectedOptions": ["Green"]
}
FieldTypeDescription
pollMessageIdstringID of the poll message
pollChatJidstringJID of the chat containing the poll
voterJidstringJID of the voter
selectedOptionsstring[]Currently selected option names
previousSelectedOptionsstring[] | undefinedPrevious selections (for vote changes)

Call Message

{
"messageType": "call",
"callId": "call-uuid",
"callStatus": "missed",
"isVideo": false,
"isGroupCall": false,
"duration": 0
}
FieldTypeDescription
callIdstringUnique call identifier
callStatusstringCall status: offer, ringing, reject, accept, timeout, missed
isVideobooleanWhether this is a video call
isGroupCallbooleanWhether this is a group call
durationnumber | undefinedCall duration in seconds

Unsupported Message

{
"messageType": "unsupported",
"originalType": "protocolMessage",
"reason": "Message type not supported"
}
FieldTypeDescription
originalTypestringOriginal WhatsApp message type
reasonstringReason why it's unsupported

Quoted Messages

When a message is a reply to another message, the quotedMessage field is included:

{
"quotedMessage": {
"id": "quoted-message-id",
"sender": {
"id": "sender-id",
"jid": "[email protected]",
"lid": null,
"name": "Jane Doe",
"profilePictureUrl": "https://..."
},
"message": {
// Full message object of the quoted message
}
}
}