List all known chats
curl --request GET \
--url https://api.wsapi.chat/chats \
--header 'X-Api-Key: <api-key>' \
--header 'X-Instance-Id: <x-instance-id>'import requests
url = "https://api.wsapi.chat/chats"
headers = {
"X-Instance-Id": "<x-instance-id>",
"X-Api-Key": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'X-Instance-Id': '<x-instance-id>', 'X-Api-Key': '<api-key>'}
};
fetch('https://api.wsapi.chat/chats', 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/chats");
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.GetAsync(request);
Console.WriteLine("{0}", response.Content);
[
{
"id": "1234567890@s.whatsapp.net",
"lid": "222424242@lid",
"isGroup": true,
"isArchived": true,
"isPinned": true,
"isMuted": true,
"muteEndTime": "2023-11-07T05:31:56Z",
"pushName": "<string>",
"businessName": "<string>",
"fullName": "<string>",
"lastActivity": "2023-11-07T05:31:56Z"
}
]{
"status": 401,
"detail": "unauthorized"
}{
"status": 409,
"detail": "device not paired"
}{
"status": 503,
"detail": "instance not available"
}Chats
List all known chats
Returns all known chats for the instance, enriched with contact info (pushName, businessName, fullName) and chat settings (pinned, archived, muted). Sorted by last activity descending.
GET
/
chats
List all known chats
curl --request GET \
--url https://api.wsapi.chat/chats \
--header 'X-Api-Key: <api-key>' \
--header 'X-Instance-Id: <x-instance-id>'import requests
url = "https://api.wsapi.chat/chats"
headers = {
"X-Instance-Id": "<x-instance-id>",
"X-Api-Key": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'X-Instance-Id': '<x-instance-id>', 'X-Api-Key': '<api-key>'}
};
fetch('https://api.wsapi.chat/chats', 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/chats");
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.GetAsync(request);
Console.WriteLine("{0}", response.Content);
[
{
"id": "1234567890@s.whatsapp.net",
"lid": "222424242@lid",
"isGroup": true,
"isArchived": true,
"isPinned": true,
"isMuted": true,
"muteEndTime": "2023-11-07T05:31:56Z",
"pushName": "<string>",
"businessName": "<string>",
"fullName": "<string>",
"lastActivity": "2023-11-07T05:31:56Z"
}
]{
"status": 401,
"detail": "unauthorized"
}{
"status": 409,
"detail": "device not paired"
}{
"status": 503,
"detail": "instance not available"
}Authorizations
Response
List of chats
⌘I