Flush cached history sync messages
curl --request POST \
--url https://api.wsapi.chat/session/flush-history \
--header 'X-Api-Key: <api-key>' \
--header 'X-Instance-Id: <x-instance-id>'import requests
url = "https://api.wsapi.chat/session/flush-history"
headers = {
"X-Instance-Id": "<x-instance-id>",
"X-Api-Key": "<api-key>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Instance-Id': '<x-instance-id>', 'X-Api-Key': '<api-key>'}
};
fetch('https://api.wsapi.chat/session/flush-history', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));using RestSharp;
var options = new RestClientOptions("https://api.wsapi.chat/session/flush-history");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("X-Instance-Id", "<x-instance-id>");
request.AddHeader("X-Api-Key", "<api-key>");
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
{
"status": "ok"
}{
"status": 400,
"detail": "invalid request body"
}{
"status": 401,
"detail": "unauthorized"
}{
"status": 503,
"detail": "instance not available"
}Session
Flush cached history sync messages
Returns 202 Accepted immediately, then asynchronously publishes cached history sync
messages as message_history_sync events (one per chat, chunked at 500 messages).
The consumer should call this endpoint after receiving the initial_sync_finished event,
which is only emitted when historySync is enabled and fires after the RECENT history
sync completes and all messages have been cached.
Requires the instance to have historySync enabled and the device to be paired.
Cached messages expire after 1 hour.
POST
/
session
/
flush-history
Flush cached history sync messages
curl --request POST \
--url https://api.wsapi.chat/session/flush-history \
--header 'X-Api-Key: <api-key>' \
--header 'X-Instance-Id: <x-instance-id>'import requests
url = "https://api.wsapi.chat/session/flush-history"
headers = {
"X-Instance-Id": "<x-instance-id>",
"X-Api-Key": "<api-key>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Instance-Id': '<x-instance-id>', 'X-Api-Key': '<api-key>'}
};
fetch('https://api.wsapi.chat/session/flush-history', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));using RestSharp;
var options = new RestClientOptions("https://api.wsapi.chat/session/flush-history");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("X-Instance-Id", "<x-instance-id>");
request.AddHeader("X-Api-Key", "<api-key>");
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
{
"status": "ok"
}{
"status": 400,
"detail": "invalid request body"
}{
"status": 401,
"detail": "unauthorized"
}{
"status": 503,
"detail": "instance not available"
}Authorizations
⌘I