Skip to main content
POST
/
chats
/
{chatId}
/
messages
Request on-demand message history
curl --request POST \
  --url https://wsapi.chat/chats/{chatId}/messages \
  --header 'Content-Type: application/json' \
  --header 'X-Api-Key: <api-key>' \
  --header 'X-Instance-Id: <x-instance-id>' \
  --data '
{
  "lastMessageId": "3EB0A0B0C1D2E3F4",
  "lastMessageSenderId": "1234567890",
  "count": 50
}
'
{
  "status": "ok"
}

Authorizations

X-Api-Key
string
header
required

Instance or customer-level API key. Either the instance's own API key or the customer's API key is accepted. Must be paired with the X-Instance-Id header to identify the target instance.

Headers

X-Instance-Id
string
default:{{instanceId}}
required

The ID of the WhatsApp instance to use

Path Parameters

chatId
string
required

Chat JID (user or group)

Body

application/json
lastMessageId
string
required

ID of the last known message in the chat

lastMessageSenderId
string
required

Phone number or JID of the sender of the last known message

count
integer
default:50

Number of messages to request (default 50, max 500)

Required range: 1 <= x <= 500

Response

History sync request accepted

status
string
Example:

"ok"