Skip to content

List groups ​

Returns the WhatsApp groups the channel's number is a member of, sorted by name, without the member lists. Use List group participants for those.

GET/api/user/whatsapp-qr/channels/{channel}/groups
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/groups?limit=50&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/groups?limit=50&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/groups?limit=50&offset=0', {
  method: 'GET',
  headers: {
    Authorization: 'Bearer $TOKEN',
    Accept: 'application/json'
  }
});

const data = await res.json();

Example response

{
  "status": true,
  "code": 200,
  "validation": [],
  "message": "Groups",
  "data": {
    "120363025988123456@g.us": {
      "id": "120363025988123456@g.us",
      "subject": "Sales team",
      "subjectOwner": "201142407509@s.whatsapp.net",
      "subjectTime": 1700000000,
      "size": 12,
      "creation": 1700000000,
      "owner": "201142407509@s.whatsapp.net",
      "desc": "Daily leads and follow-ups",
      "restrict": true,
      "announce": false
    }
  }
}

data is an object keyed by group id

Groups are returned as an object whose keys are the group ids, not as an array. Iterate over its values, e.g. Object.values(data) in JavaScript or array_values($data) in PHP.

Main response fields ​

FieldTypeDescription
idstringGroup chat id (…@g.us). Use it as chat_id to send to the group.
subjectstringGroup name
descstring | nullGroup description
sizeintegerNumber of members
creationintegerUnix timestamp when the group was created
ownerstringWhatsApp id of the group's creator
announcebooleantrue when only admins can send messages
restrictbooleantrue when only admins can edit the group's info