Chats
Get latest chats & messages
Returns the most-recent non-archived chats (pinned first), each with its latest messages (newest-first).
One call — no per-chat round-trips. Requires chats:read.
Request
curl -X GET "https://api.blueticks.co/v1/latest-chats"{
"success": true,
"data": {
"chats": [
{
"chatId": "string",
"name": "string",
"chatType": "contact",
"pinned": true,
"archived": true,
"lastMessageAt": "2019-08-24T14:15:22Z",
"unreadCount": 0,
"markedUnread": true,
"lastMessageText": "string",
"lastMessageFromMe": true,
"messages": [
{
"waMessageKey": {
"fromMe": true,
"remote": "string",
"id": "string",
"_serialized": "string",
"participant": "string"
},
"chatId": "string",
"from": "string",
"author": "string",
"senderName": "string",
"timestamp": "2019-08-24T14:15:22Z",
"text": "string",
"type": "string",
"waType": "string",
"interactive": {
"kind": "buttons",
"options": [
{
"id": "string",
"title": "string",
"description": "string",
"section": "string"
}
],
"selectedId": "string",
"selectedTitle": "string",
"quotedId": "string"
},
"fromMe": true,
"ack": 0,
"mediaUrl": "string",
"filename": "string",
"linkPreview": {
"title": "string",
"description": "string",
"canonicalUrl": "string",
"thumbnail": "string"
},
"quotedMessage": {
"waMessageKey": {
"fromMe": true,
"remote": "string",
"id": "string",
"_serialized": "string",
"participant": "string"
},
"text": "string",
"type": "string",
"author": "string"
},
"reactions": [
{
"emoji": "string",
"senderId": "string",
"fromMe": true,
"timestamp": "2019-08-24T14:15:22Z"
}
],
"source": "vault",
"secret": "string"
}
]
}
],
"totalChats": 0,
"numberOfChats": 0,
"numberOfMessages": 0
}
}{
"success": false,
"error": {
"code": "string",
"message": "string",
"request_id": "string",
"requestId": "string",
"details": [
{
"path": "string",
"code": "string",
"message": "string"
}
],
"upgrade": {
"url": "string",
"text": "string",
"reset_time": "string",
"seconds_remaining": 0,
"plan": {}
}
}
}Query Parameters
engine?string
Force the read to a specific engine TYPE: "gateway" (server-side pod, e.g. Baileys) or "regular" (browser extension). Overrides the default dual-engine read preference. 409 ENGINE_NOT_ONLINE if none of that type is online.
Value in
"gateway" | "regular"engineId?string
Exact engine clientId to target (from the engine status id); wins over engine. 409 ENGINE_NOT_ONLINE if not online.
Length
1 <= length <= 200numberOfChats?integer
Total chats to return, pinned first then most-recent (1-200, default 50).
Default
50Range
1 <= value <= 200numberOfMessages?integer
Latest messages to include per chat, newest-first (0-100, default 20).
Default
20Range
0 <= value <= 100Response
Response Body
application/json
application/json