Skip to main content
POST

Authorizations

token
string
header
required

Body

application/json
number
string
required

Full chat JID.

Example:

"5511999999999@s.whatsapp.net"

messageid
string

ID of the reference message used to fetch older messages from the chat.

Example:

"3EB01234567890ABCDEF"

count
integer
default:50

Desired number of messages in the sync.

Required range: 1 <= x <= 100
Example:

20

timestamp
integer

Timestamp of the reference message, in milliseconds or seconds. Optional; it comes in next_request so the reference works even before the message is saved.

Example:

1706350400000

fromMe
boolean

Indicates whether the reference message was sent by the connected account. Optional; comes in next_request.

Example:

false

requestId
string

Optional identifier chosen by the client; when omitted, the API generates a UUID. Returned as request_id. Use a new id per request: an id already in use receives 409.

Example:

"5f0c2a8e-6d1b-4c3a-9e7f-1a2b3c4d5e6f"

fallbackMode
enum<string>
default:try_alternates

Where the request is sent. try_alternates (default): in an individual conversation, sends via the chat's number and LID, because the phone stores each conversation under one of the two addresses and ignores the request sent via the other; the response arrives only once. exact: sends only via the chat's preferred address (the LID, when known). In groups, the request always goes only to the group.

Available options:
try_alternates,
exact
sync
boolean
default:false

Holds the response until the request result, for up to timeoutMs. See "Synchronous mode".

timeoutMs
integer
default:25000

Only with sync: true: maximum wait in milliseconds. Larger values become 25000.

Required range: x <= 25000

Response

Request sent successfully. Messages and the result arrive later via webhook/SSE. With sync: true, it also returns the messages and the request result.

success
boolean
Example:

true

request_id
string

Identifies the request. Appears in the correlated messages and in the final webhook/SSE history status.

Example:

"5f0c2a8e-6d1b-4c3a-9e7f-1a2b3c4d5e6f"

message
string
Example:

"History sync request sent. Messages will be received as history sync events."

details
object

Additional operation metadata

sync
boolean

true when the response waited for the result (sync: true).

status
enum<string>

Synchronous mode only: request result; pending when it has not arrived yet and will come via webhook/SSE; blocked when the phone indicates more messages but did not deliver a page that advances (the reason comes in error).

Available options:
completed,
timeout,
pending,
blocked
request_chat
string

Synchronous mode only: chat of the request.

has_more
boolean | null

Synchronous mode only: what the phone declared. true there are more messages, false start of the conversation, null not confirmed. Some devices declare true in every on-demand response, even an empty one: with them, pagination ends in blocked with pagination_no_progress, never in has_more: false.

history_access
enum<string>

Synchronous mode only: unavailable when there are more messages without access.

Available options:
available,
unavailable,
unknown
received_messages
integer

Synchronous mode only: number of messages in messages.

next_request
object | null

Synchronous mode only: body ready to request the previous messages, or null.

received
boolean

Synchronous mode only: messages arrived or the request was completed.

timed_out
boolean

Synchronous mode only: the timeoutMs deadline expired.

partial
boolean

Synchronous mode only: there may still be more messages (has_more other than false).

messages
object[]

Synchronous mode only: messages of the request, in the history event format.

error
enum<string>

With status: "blocked" (and success: false): why there is no next_request. pagination_no_progress: from the same anchor, the phone did not deliver a page that advances even at the largest count (on each page without progress, next_request doubles count, up to 100): it came back empty, without a message usable as an anchor, or repeated. This is the end of what the phone delivers from that anchor, but WhatsApp does not confirm that it is the start of the conversation; repeating the request gives the same result; anchor_unavailable: the reference message is no longer available, request with another one; history_access_unavailable: the rest is not accessible; cursor_lookup_failed: failed to build the next request, try again.

Available options:
pagination_no_progress,
anchor_unavailable,
history_access_unavailable,
cursor_lookup_failed