Read a chat's recent messages
get_chat_historyThe latest messages of one chat, newest first: what your number received, what it sent from the phone or through us, and what WhatsApp sent when the phone was linked. Each message has the shape the message.created webhook delivers, so the same code reads both, and a webhook your server missed can be read back here.
We keep the latest 100 messages of each chat unless you change the number's historyPerChat with update_number; 0 keeps none. Media comes as its details, never the file. Free.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"chat": "<chat>"
},
"name": "get_chat_history"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chat | Yes | The chat: a phone number in international format (+5511988887777), or the address a webhook gave you for a group or for a contact whose number is hidden (…@g.us, …@lid). | |
| limit | No | How many to return, newest first. Up to 100; 50 when left out. | |
| number | No | Which of your numbers kept the chat: its id or its phone. Optional when you have only one. |