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

# WhatsApp Groups

> Manage WhatsApp groups, send messages, and control participants

# WhatsApp Groups

The Groups API lets you manage WhatsApp groups directly through your connected sessions. You can list groups, send messages, manage participants, and configure group settings.

## Listing Groups

List all WhatsApp groups your session is subscribed to:

```bash theme={null}
curl -X GET "https://api.wazzapi.com/api/v1/groups?session_name=my-session&limit=50" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

## Sending Messages to Groups

Send text or media messages to a WhatsApp group:

```bash theme={null}
curl -X POST https://api.wazzapi.com/api/v1/groups/send \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "session_name": "my-session",
    "group_jid": "120363023605733675@g.us",
    "text": "Hello everyone!"
  }'
```

The API looks up the group name from the WhatsApp backend and stores it with the message record, so message history displays "Super Group" instead of the raw JID.

### Supported Message Types

| Type         | Endpoint                  | Supported |
| ------------ | ------------------------- | --------- |
| Text         | `POST /groups/send`       | ✅         |
| Image        | `POST /groups/send/media` | ✅         |
| Video        | `POST /groups/send/media` | ✅         |
| Voice        | `POST /groups/send/media` | ✅         |
| Document     | `POST /groups/send/media` | ✅         |
| Template     | —                         | ❌         |
| Interactive  | —                         | ❌         |
| Location     | —                         | ❌         |
| Contact card | —                         | ❌         |

## Group Management

### Participants

Add, remove, promote, or demote participants:

```bash theme={null}
curl -X POST https://api.wazzapi.com/api/v1/groups/participants \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "session_name": "my-session",
    "group_jid": "120363023605733675@g.us",
    "action": "add",
    "participants": ["6281234567890@s.whatsapp.net"]
  }'
```

### Group Settings

Update group name, topic, photo, and permissions:

```bash theme={null}
# Set group name
curl -X POST https://api.wazzapi.com/api/v1/groups/120363023605733675@g.us/name \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "session_name": "my-session",
    "name": "New Group Name"
  }'

# Lock group (admins only)
curl -X POST https://api.wazzapi.com/api/v1/groups/120363023605733675@g.us/locked \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "session_name": "my-session",
    "locked": true
  }'
```

### Invite Links

Get or use invite links:

```bash theme={null}
# Get invite link
curl -X POST "https://api.wazzapi.com/api/v1/groups/120363023605733675@g.us/invite-link?session_name=my-session" \
  -H "Authorization: Bearer YOUR_API_KEY"

# Join via invite link
curl -X POST https://api.wazzapi.com/api/v1/groups/join \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "session_name": "my-session",
    "invite_link": "https://chat.whatsapp.com/HffXhYmzzyJGec61oqMXiz"
  }'
```

## Message History

Messages sent to groups include group metadata in the response:

```json theme={null}
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "phone_number": "120363023605733675@g.us",
  "chat_type": "group",
  "group_jid": "120363023605733675@g.us",
  "group_name": "Super Group",
  "content": "Hello everyone!",
  "status": "sent",
  "direction": "outbound"
}
```

| Field        | Description                                        |
| ------------ | -------------------------------------------------- |
| `chat_type`  | `individual` or `group`                            |
| `group_jid`  | The group's WhatsApp JID                           |
| `group_name` | Human-readable group name (looked up at send time) |
