> ## Documentation Index
> Fetch the complete documentation index at: https://docs.notifique.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Groups

> Notify classes and teams on WhatsApp via the unofficial connection: list, send, invite, and manage participants.

<Tip>
  WhatsApp groups are where **classes, teams, and communities** chat together. With Notifique you send alerts to the whole group, manage participants, and share invite links, **unofficial connection only** (number paired via QR or shareable link).
</Tip>

## In brief

* **Unofficial connection only**, official (Meta) instances **cannot** send to or manage groups via API.
* Use the **same instance** you already paired for 1-to-1 sends.
* API key with **`whatsapp:groups`** scope on integrations that need it.
* Group send = same message route; only `to` changes (`...@g.us`).

<Warning>
  **Official line:** groups, participants, and invites are **not available**. Use an [unofficial connection](/en/whatsapp-api/como-funciona/modos-de-conexao) or 1-to-1 on the official line.
</Warning>

***

## When to use

| Situation                                             | Use groups via API?                                                    |
| ----------------------------------------------------- | ---------------------------------------------------------------------- |
| Alerts to **multiple classes/teams** (unofficial)     | **Yes**                                                                |
| Automate **invites** and **participants** via ERP/CRM | **Yes**                                                                |
| **Official** (Meta) instance                          | **No**, use 1-to-1 or switch to unofficial                             |
| Only **1-to-1** support                               | No. Use [standard WhatsApp](/en/whatsapp-api/como-funciona/introducao) |

Full comparison: [Connection modes](/en/whatsapp-api/como-funciona/modos-de-conexao).

***

## What you can do

<CardGroup cols={2}>
  <Card title="Send to a group" icon="paper-plane">
    `POST /v1/whatsapp/messages` with group JID in `to` (`120363...@g.us`).
  </Card>

  <Card title="List groups" icon="list">
    `GET /v1/whatsapp/instances/{id}/groups` with pagination.
  </Card>

  <Card title="Participants" icon="users">
    List, add, and remove people in allowed groups.
  </Card>

  <Card title="Invites" icon="link">
    Send invite link in DM, revoke, or fetch invite code.
  </Card>
</CardGroup>

Routes and fields: WhatsApp **API reference** (Groups section).

***

## Before you start

| Item                                 | Required    |
| ------------------------------------ | ----------- |
| **Unofficial** **ACTIVE** instance   | Yes         |
| **`whatsapp:groups`** scope on key   | Yes         |
| Number is **admin** in target groups | Recommended |

Not paired yet? [WhatsApp Quick Start](/en/whatsapp-api/como-funciona/quick-start) (**unofficial** tab). Scopes: [API Key scopes](/en/whatsapp-api/como-funciona/escopos-api-key).

Replace `sk_live_xxxxx` with your key and `{instanceId}` with the instance id. Base URL: `https://api.notifique.dev`.

<Info>
  The API Key belongs to **one** workspace. On v1 **do not send** `x-workspace-id`.
</Info>

***

## 1. List groups

Returns a **paginated** list of groups for the instance.

```http theme={null}
GET /v1/whatsapp/instances/{instanceId}/groups?page=1&limit=20
Authorization: Bearer sk_live_xxxxx
```

Optional params: `page` (default 1), `limit` (default 20, max 100).

**With groups loaded**

```json theme={null}
{
  "success": true,
  "data": [
    {
      "id": "120363295648424210@g.us",
      "name": "My Group",
      "participantsCount": 5,
      "owner": "5511999999999@s.whatsapp.net",
      "creation": 1699000000
    }
  ],
  "pagination": { "page": 1, "limit": 20, "total": 5 }
}
```

**Still syncing**

```json theme={null}
{
  "success": true,
  "loading": true,
  "message": "Group list is loading. Try again in a few seconds.",
  "data": [],
  "pagination": { "page": 1, "limit": 20, "total": 0 }
}
```

Save the **`id`** (e.g. `120363295648424210@g.us`) for the next steps.

### Group participants

```http theme={null}
GET /v1/whatsapp/instances/{instanceId}/groups/120363295648424210@g.us/participants
Authorization: Bearer sk_live_xxxxx
```

In the URL, encode `@` as `%40` if your client requires it.

```json theme={null}
{
  "success": true,
  "data": {
    "participants": [
      { "id": "5511999999999@s.whatsapp.net", "admin": "superadmin" },
      { "id": "5511888888888@s.whatsapp.net", "admin": "admin" }
    ]
  }
}
```

***

## 2. Send a message to a group

Same route as individual WhatsApp sends. Put the **group JID** in `to`.

```http theme={null}
POST /v1/whatsapp/messages
Content-Type: application/json
Authorization: Bearer sk_live_xxxxx
```

```json theme={null}
{
  "instanceId": "clxx...",
  "to": ["120363295648424210@g.us"],
  "type": "text",
  "payload": {
    "message": "Hello, group! Alert sent via API."
  }
}
```

**Response (202)**

```json theme={null}
{
  "messageIds": ["clxx1..."],
  "status": "QUEUED",
  "scheduledAt": null
}
```

**Multiple groups at once**

```json theme={null}
{
  "instanceId": "clxx...",
  "to": ["120363295648424210@g.us", "120363295648424211@g.us"],
  "type": "text",
  "payload": { "message": "Alert for several groups." }
}
```

***

## 3. Add or remove participants

```http theme={null}
POST /v1/whatsapp/instances/{instanceId}/groups/participants
Content-Type: application/json
Authorization: Bearer sk_live_xxxxx
```

**Add**

```json theme={null}
{
  "to": ["120363295648424210@g.us"],
  "action": "add",
  "participants": ["5511888888888", "5511777777777"]
}
```

**Remove**

```json theme={null}
{
  "to": ["120363295648424210@g.us"],
  "action": "remove",
  "participants": ["5511888888888"]
}
```

**Response (200), example**

```json theme={null}
{
  "success": true,
  "data": {
    "results": [
      { "groupJid": "120363295648424210@g.us", "success": true, "action": "add", "participantsCount": 2 }
    ]
  }
}
```

<Note>
  Your number must be **group admin** in WhatsApp. Otherwise the operation fails.
</Note>

***

## 4. Send invite in DM

Sends the invite link to one or more individual numbers.

```http theme={null}
POST /v1/whatsapp/instances/{instanceId}/groups/invite
Content-Type: application/json
Authorization: Bearer sk_live_xxxxx
```

```json theme={null}
{
  "groups": ["120363295648424210@g.us"],
  "to": ["5511999999999"],
  "description": "Invite to the team group"
}
```

```json theme={null}
{
  "success": true,
  "data": {
    "results": [
      {
        "groupJid": "120363130091228687@g.us",
        "success": true,
        "data": {
          "send": true,
          "inviteUrl": "https://chat.whatsapp.com/EYkW0HWQLJ7CS82xdLIu4i"
        }
      }
    ]
  }
}
```

***

## 5. Revoke or fetch invite link

**Revoke current link**

```http theme={null}
POST /v1/whatsapp/instances/{instanceId}/groups/invite/revoke
Content-Type: application/json
Authorization: Bearer sk_live_xxxxx
```

```json theme={null}
{
  "groupJid": "120363295648424210@g.us"
}
```

**Fetch current link or code**

```http theme={null}
GET /v1/whatsapp/instances/{instanceId}/groups/invite-code?groupJid=120363295648424210@g.us
Authorization: Bearer sk_live_xxxxx
```

```json theme={null}
{
  "success": true,
  "data": {
    "inviteUrl": "https://chat.whatsapp.com/Gst4H0uNCjMFEwddWjWpm9",
    "inviteCode": "Gst4H0uNCjMFEwddWjWpm9"
  }
}
```

***

## Important limits

* **Unofficial only**, official instances return `WHATSAPP_GROUPS_UNOFFICIAL_ONLY`.
* Does not create a brand-new group via API (use an existing group or create on phone first).
* Adding people requires **admin** permission in WhatsApp.
* List may return `loading: true` on first fetch, retry after a few seconds.
* **WhatsApp's own rules** still apply; the API does not replace app permissions.

***

## Common errors

| `code`                            | What to do                           |
| --------------------------------- | ------------------------------------ |
| `SCOPE_GROUPS_REQUIRED`           | Add **`whatsapp:groups`** to the key |
| `WHATSAPP_GROUPS_UNOFFICIAL_ONLY` | Use an **unofficial** instance       |
| `loading: true` on list           | Wait and call again                  |

Full catalog: [Error responses](/en/guides/conceitos/resposta-de-erros).

<AccordionGroup>
  <Accordion title="403: feature off or missing scope">
    Check that the instance is **unofficial** and the key has **`whatsapp:groups`**.
  </Accordion>

  <Accordion title="Failed to add/remove participant">
    Verify the instance number is **admin** of the group in the WhatsApp app.
  </Accordion>
</AccordionGroup>

***

## Next steps

* [Connection modes](/en/whatsapp-api/como-funciona/modos-de-conexao): official × unofficial
* [WhatsApp, Introduction](/en/whatsapp-api/como-funciona/introducao): instance, messages, webhooks
* [API Key scopes](/en/whatsapp-api/como-funciona/escopos-api-key)
