Skip to content
WhatSync/DocsAPI v1

List my WhatsApp groups

List the groups the user's linked WhatsApp account is in, with each group's name and ID.

POST/api/v1/tools/list_groupsRead
Key permissions
Read chats and messages + Manage groups
Authentication
Authorization: Bearer $WHATSYNC_API_KEY
How keys work

How it works

  • Use the ID with get_group or the other group tools.
  • Returns one page at a time.
  • With several numbers it lists the groups of every linked number, and each group's whatsapp_numbers says which numbers are in it; fromNumber lists one number only.

Body parameters

afterstringoptional

Lower date boundary or pagination value. Keep the same filters between pages.

limitintegeroptional

Maximum results per page. See the schema for bounds and defaults.

fromNumberstringoptional

Which of the account's WhatsApp numbers acts, with country code, as listed in whatsapp_numbers from get_account_context. Only matters when the account has several numbers. Omit to list every number's groups.

Conditions and pagination

  • Pass the returned next_cursor (next_after for forms) as after. Stop when that value is null.

Response

HTTP 200 returns this tool's JSON directly, without an MCP content wrapper. Optional provider fields may be absent or null; check pagination and coverage before treating a page as complete.

Every response includes X-Request-Id. Errors use the shared error format and retry rules.

Schemas

Input JSON Schema
Input JSON Schema
{
  "type": "object",
  "properties": {
    "after": {
      "type": "string",
      "pattern": "^\\d[\\d-]*@g\\.us$"
    },
    "limit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 100
    },
    "fromNumber": {
      "type": "string",
      "minLength": 7,
      "maxLength": 30,
      "description": "Which of the account's WhatsApp numbers acts, with country code, as listed in whatsapp_numbers from get_account_context. Only matters when the account has several numbers. Omit to list every number's groups."
    }
  },
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Response JSON Schema
Response JSON Schema
{
  "type": "object",
  "properties": {
    "groups": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "jid": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [],
        "additionalProperties": true
      }
    },
    "next_cursor": {
      "type": [
        "string",
        "null"
      ]
    }
  },
  "required": [],
  "additionalProperties": true
}