Get All List groups

Retrieve a list of all groups the instance is a member of.

GET
https://api.wawp.net/v2/groups?access_token=123456789&instance_id=123456789

Authentication Required

Login to swap the placeholders with your real Instance ID and Access Token.

Log In
Test /v2/groups endpoint
GET
GET

No query parameters required

This endpoint doesn't expect data in the URL.

Best practices

  • Run this once at startup, then rely on webhooks for incremental updates.

  • Filter out 'Announce' groups if your bot needs two-way communication.

  • Periodically reconcile this list with your database to find 'Ghost Groups'.

Global Inventory: The Strategic Audit of Your Group Footprint

In a high-scale WhatsApp deployment, your business account doesn't just manage individual messages; it manages an entire ecosystem of communities. The Get All Groups endpoint is your primary tool for Conversational Resource Management. It provides a top-down, panoramic view of every shared state—every "War Room," every "Customer Onboarding Group," and every "Marketing Cohort"—that your instance is currently a part of. This endpoint is the foundation for ecosystem auditing, bulk state synchronization, and long-term conversational hygiene.

For developers and architects, "Listing Groups" is not just about showing a table of names; it is about Inventorying Business Assets and identifying where your automated presence is most active—and where it might be lingering beyond its useful life.


🏗️ Architectural Philosophy: The Macro-View of Shared State

Whereas the Get Group endpoint provides high-fidelity depth for a single community, the Get All Groups endpoint provides the breadth required for systemic management.

Key Architectural Objectives:

  • Contextual Inventory: This endpoint returns an array of metadata for every group associated with the instance. This is critical for "Bootstrapping" your internal CRM. When you first connect a WhatsApp account to your platform, you use this endpoint to map the pre-existing reality of the account into your database, ensuring that no "Legacy Group" is left un-managed.
  • Orphaned Flow Detection: In complex automation environments, a group might be created but, due to a bug or a missing business trigger, it might never be correctly linked to a customer record. By fetching the full list of groups, your system can perform a "Reconciliation Audit"—comparing the list of active WhatsApp groups against your internal database. Any group found on WhatsApp but not in your database is an "Orphaned State" that requires manual review or automated cleanup.
  • Permission Census: This endpoint provides a quick snapshot of the instance's role in each community. By auditing the participants array across all groups, your system can identify which communities it still controls as an Admin and which ones it has been demoted in. This "Permission Awareness" is vital for prioritizing where your bots can execute governance and where they are restricted to mere observation.

🚀 Strategic Operational patterns: Ecosystem Hygiene

A healthy WhatsApp account is one that is lean and purposeful. The Get All Groups endpoint is the engine behind your Decommissioning Workflows.

1. The Rolling Archive Protocol

Professional enterprises implement a "Rolling Audit" every 7 to 30 days. Your system fetches the full list of groups and maps them to their last interaction timestamps. Any group that has had zero activity for more than 90 days—and is not marked as a "Permanent VIP Channel" in your CRM—becomes a candidate for the Delete Group endpoint. This "Conversational Pruning" keeps your agent's interface focused on active leads and reduces the long-term data footprint on your servers.

2. Multi-Instance Load Balancing

If your enterprise uses multiple WhatsApp instances to manage a massive community (e.g., thousands of property tenants), the Get All Groups endpoint allows you to track the Distribution of Responsibility. By auditing the group counts across different instances, your system can decide which instance has the most "headroom" to create the next new group, preventing any single account from hitting Meta's undocumented saturation limits.

3. Identity Resolution for Manual Creations

Agents often create groups manually via the mobile WhatsApp app to handle ad-hoc customer requests. These groups are "Invisible" to your automation until identified. By periodically calling Get All Groups, your system can "Discover" these manually created communities, parse their names for Project IDs, and automatically import them into your official CRM flow, ensuring that manual agent work is captured in your high-level business analytics.


🔐 Security & Governance: Auditing the Membership List

Groups are inherently high-trust, but they are also potential data leak points. The Get All Groups endpoint allows for Global Compliance Auditing.

Participant Sentiment & Prohibited Presence

For highly regulated industries (such as Banking or Insurance), your system must ensure that no unauthorized JIDs are present in your business groups. By fetching the participant list for all groups in bulk, you can run a "Compliance Scan" against your global blacklist. If an instance of an unauthorized number is found in any group, your system can trigger an immediate alert to your security team or execute an automated removal.

Tracking the "Administrative Footprint"

Managing the number of admins in your ecosystem is a critical security task. Too many admins increases the risk of accidental group deletion or unauthorized settings changes. This endpoint allows you to audit the "Admin Density" across your entire account. If a regular project member has been promoted to admin without a corresponding approval in your internal HR system, your system can automatically demote them back to member status, maintaining a "Strict Governance" posture.


⚙️ Performance & Scaling: Batching vs. Real-Time Sync

Fetching all groups can be a relatively "Expensive" operation for accounts that are members of hundreds or thousands of communities. To maintain a high-performance system, follow these principles:

  1. Avoid Excessive Polling: Never call this endpoint in a tight loop. Instead, use a scheduled background job (e.g., once every 6-24 hours) to perform the "Global Reconciliation."
  2. Rely on Event-Driven Updates: For real-time changes, always prioritize the group.update and group.participants.update webhooks. The Get All Groups endpoint should be seen as the "Self-Correction" mechanism that runs periodically to catch any events that might have been missed due to network instability.
  3. Pagination & Metadata Filtering: When processing the results, prioritize the id and subject fields first. Only dig into the full participants array for groups that your internal audit has flagged as "High Priority" or "Compliance Vulnerable."

🎯 Conclusion: Mastering the Landscape of Shared State

The Get All Groups endpoint is your primary instrument for architectural discipline. It allows you to move beyond the management of individual threads and start managing the Total Landscape of Your Presence. By implementing robust reconciliation, decommissioning, and discovery workflows around this endpoint, you ensure that your WhatsApp infrastructure remains optimized, governed, and perfectly synchronized with your business's strategic objectives. You turn a crowded inbox into a highly structured, metadata-driven community engine.

Request Parameters

Configure the parameters required to interact with this endpoint. All query and body arguments are listed below with their details.

URL Parameters

Passed in the URL query string
string

Your unique WhatsApp Instance ID

Example:
string

Your API Access Token

Example:

Request Samples

Use these ready-to-go code snippets to integrate our API into your project quickly and efficiently. Choose your preferred language and library.

1const baseUrl = "https://api.wawp.net";
2const endpoint = "/v2/groups";
3const params = new URLSearchParams({
4 "instance_id": "123456789",
5 "access_token": "123456789"
6}).toString();
7
8
9fetch(`${baseUrl}${endpoint}${params ? '?' + params : ''}`, {
10 method: "GET",
11 headers: { "Content-Type": "application/json" },
12
13})
14 .then(async (response) => {
15 if (response.ok) {
16 const data = await response.json();
17 console.log("Success:", data);
18 return data;
19 }
20
21 // Error Handling
22 if (response.status === 401) {
23 console.error("Error 401: Unauthorized - Invalid or Missing Access Token");
24 }
25 if (response.status === 500) {
26 console.error("Error 500: Internal Server Error - Unexpected Failure");
27 }
28
29 const errorText = await response.text();
30 console.error(`Error ${response.status}: ${errorText}`);
31 })
32 .catch((error) => console.error("Network Error:", error));
Interactive Samples
Ln 32, Col 1javascript

Expected Responses

Explore all possible responses and outcomes from the server. We have documented each status code with data examples to make success and error handling easier.

List of groups retrieved successfully
application/json
object *

Example

{
"0": {
  "id": "1234567890@g.us",
  "name": "Project Team",
  "participants": {
    }
  }
}
Unauthorized - Invalid or Missing Access Token
Internal Server Error - Unexpected Failure
Previous TopicGroups Overview
Next TopicCreate group

Command Palette

Search for a command to run...