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",
"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"
}
}
]
}
],
"totalChats": 0,
"numberOfChats": 0,
"numberOfMessages": 0
}
}{
"success": false,
"error": {
"code": "string",
"message": "string",
"requestId": "string",
"details": [
{
"path": "string",
"code": "string",
"message": "string"
}
]
}
}Query Parameters
numberOfChats?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