Skip to content

List chats ​

Returns the channel's chats (people and groups), most recent first, with their last message.

GET/api/user/whatsapp-qr/channels/{channel}/chats
Required scope: whatsapp-qr:read
Path parameters
integer
Query parameters
integer
integer
curl -X GET "https://loopx-console.test/api/user/whatsapp-qr/channels/105/chats?limit=20&offset=0" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Accept: application/json"
<?php

use GuzzleHttp\Client;

$client = new Client();
$response = $client->request('GET', 'https://loopx-console.test/api/user/whatsapp-qr/channels/105/chats?limit=20&offset=0', [
    'headers' => [
        'Authorization' => 'Bearer $TOKEN',
        'Accept'        => 'application/json',
    ]
]);

$data = json_decode($response->getBody(), true);
const res = await fetch('https://loopx-console.test/api/user/whatsapp-qr/channels/105/chats?limit=20&offset=0', {
  method: 'GET',
  headers: {
    Authorization: 'Bearer $TOKEN',
    Accept: 'application/json'
  }
});

const data = await res.json();

Example response

{
  "status": true,
  "code": 200,
  "validation": [],
  "message": "Chats",
  "data": [
    {
      "id": "201066278084@c.us",
      "name": "Mahmoud Ahmed",
      "picture": "https://pps.whatsapp.net/v/t61.24694-24/…",
      "lastMessage": {
        "id": "false_201066278084@c.us_3AEF0449C153977B1897",
        "timestamp": 1791204698,
        "from": "201066278084@c.us",
        "fromMe": false,
        "source": "app",
        "body": "Is the offer still available?",
        "hasMedia": false,
        "ack": 2,
        "ackName": "DEVICE"
      },
      "_chat": {
        "id": "201066278084@c.us",
        "unreadCount": 1,
        "conversationTimestamp": 1791204698
      }
    }
  ]
}

Response fields ​

FieldTypeDescription
idstringChat id. It ends in @g.us for groups. Use it in List messages and the send endpoints.
namestring | nullContact or group name
picturestring | nullProfile picture URL
lastMessageobject | nullThe latest message, in the same shape as List messages
_chatobjectRaw chat data from WhatsApp