{
"messages": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"messageid": "<string>",
"chatid": "<string>",
"sender": "<string>",
"senderName": "<string>",
"isGroup": false,
"fromMe": false,
"messageType": "<string>",
"source": "<string>",
"messageTimestamp": 0,
"status": "<string>",
"text": "",
"quoted": "",
"edited": "",
"reaction": "",
"vote": "",
"convertOptions": "",
"buttonOrListid": "",
"owner": "",
"error": "",
"content": {},
"wasSentByApi": true,
"pinned": true,
"sendFunction": "<string>",
"sendPayload": {},
"fileURL": "<string>",
"callPeer": {
"jid": "<string>",
"name": "<string>",
"imagePreviewUrl": "<string>"
},
"send_folder_id": "<string>",
"track_source": "<string>",
"track_id": "<string>",
"ai_metadata": {
"agent_id": "<string>",
"turn": "<string>",
"flow_id": "<string>",
"request": {
"messages": "<array>",
"tools": "<array>",
"options": {
"model": "<string>",
"temperature": 123,
"maxTokens": 123,
"topP": 123,
"frequencyPenalty": 123,
"presencePenalty": 123
}
},
"response": {
"choices": "<array>",
"toolResults": "<array>",
"error": "<string>"
},
"outcome": {
"status": "sent",
"texts": 123,
"audio": true,
"menus": 123,
"files": 123,
"handoff": "<string>",
"lead": [
"<string>"
],
"detail": "<string>"
}
},
"sender_pn": "<string>",
"sender_lid": "<string>",
"sender_image_preview_url": "<string>"
}
],
"pagination": {
"limit": 123,
"offset": 123,
"hasMore": true,
"nextOffset": 123
}
}Search messages in a chat
Searches messages with multiple available filters. This endpoint allows:
- Search by specific ID: Use
idto find an exact message - Filter by chat: Use
chatidfor messages from a specific conversation - Filter by tracking: Use
track_sourceandtrack_idfor messages with tracking data - Call history: Use only
messageType: call,limitandoffsetto list the most recent calls. The response may includecallPeer(known contact identity) andcontent.isVideo. - Contact Status: Use
chatid: status@broadcastfor received Status updates, even without thestatus_postswebhook. Without thischatid, the search does not return Status updates. They are kept for 24 hours, as in WhatsApp (cleanup runs once a day, so filter bymessageTimestampif you need the exact cutoff), and a Status deleted by its author is removed from the list. Each one comes with the author insender_pn,sender_lidandsender_image_preview_url(photo, when known) and, for image, video or link Status updates, with the thumbnail incontent.JPEGThumbnail. Download the media via/message/download. A Status that could not be opened comes withmessageType: errorand only the ID, author and time. Group Status updates (sent and received) are stored in each group’s conversation withmessageType: GroupStatusMessageand the text intext: list them all withmessageType: GroupStatusMessage, withoutchatid. They expire after 24 hours, like the other Status updates. - Limit results: Use
limitto control how many messages to return - Sorting: Results sorted by date (most recent first)
Apart from Status updates, stored messages only include in content the
base64 thumbnails that have no copy on the server (link preview without
a copy, location, ad, invites); those of media that can be downloaded
again (JPEGThumbnail and similar) arrive only in the webhook, at the time of the message.
For messages sent through the API in the last 7 days, sendPayload contains the
send request, without base64 files (links are included). After sending (in
individual conversations, 1 hour later), the stored base64 file becomes the
text [arquivo removido após o envio: tipo, N bytes].
{
"messages": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"messageid": "<string>",
"chatid": "<string>",
"sender": "<string>",
"senderName": "<string>",
"isGroup": false,
"fromMe": false,
"messageType": "<string>",
"source": "<string>",
"messageTimestamp": 0,
"status": "<string>",
"text": "",
"quoted": "",
"edited": "",
"reaction": "",
"vote": "",
"convertOptions": "",
"buttonOrListid": "",
"owner": "",
"error": "",
"content": {},
"wasSentByApi": true,
"pinned": true,
"sendFunction": "<string>",
"sendPayload": {},
"fileURL": "<string>",
"callPeer": {
"jid": "<string>",
"name": "<string>",
"imagePreviewUrl": "<string>"
},
"send_folder_id": "<string>",
"track_source": "<string>",
"track_id": "<string>",
"ai_metadata": {
"agent_id": "<string>",
"turn": "<string>",
"flow_id": "<string>",
"request": {
"messages": "<array>",
"tools": "<array>",
"options": {
"model": "<string>",
"temperature": 123,
"maxTokens": 123,
"topP": 123,
"frequencyPenalty": 123,
"presencePenalty": 123
}
},
"response": {
"choices": "<array>",
"toolResults": "<array>",
"error": "<string>"
},
"outcome": {
"status": "sent",
"texts": 123,
"audio": true,
"menus": 123,
"files": 123,
"handoff": "<string>",
"lead": [
"<string>"
],
"detail": "<string>"
}
},
"sender_pn": "<string>",
"sender_lid": "<string>",
"sender_image_preview_url": "<string>"
}
],
"pagination": {
"limit": 123,
"offset": 123,
"hasMore": true,
"nextOffset": 123
}
}Authorizations
Body
Specific message ID for exact search
"user123:r3EB0538"
Chat ID in international format
"5511999999999@s.whatsapp.net"
Message type. Use call with limit and offset for the call history.
"call"
Tracking source to filter messages
"chatwoot"
Tracking ID to filter messages
"msg_123456789"
Maximum number of messages to return (default 100, no maximum). For many messages, prefer pages of up to 1000 and advance with pagination.nextOffset.
x >= 120
Offset for pagination (0 returns the most recent messages)
