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

# Manage groups

> List groups, create groups, manage participants, settings, invites, and membership requests.

## List groups

```http theme={null}
GET /api/v1/sessions/{sessionId}/groups
Authorization: Bearer <api_key>
```

## Get group metadata

```http theme={null}
GET /api/v1/sessions/{sessionId}/groups/{groupJid}
Authorization: Bearer <api_key>
```

## Create a group

```http theme={null}
POST /api/v1/sessions/{sessionId}/groups
Authorization: Bearer <api_key>
Content-Type: application/json
```

```json theme={null}
{
  "subject": "Customer updates",
  "participants": ["15551234567@s.whatsapp.net"],
  "description": "Order and delivery updates"
}
```

## Update profile

```http theme={null}
PATCH /api/v1/sessions/{sessionId}/groups/{groupJid}/profile
Authorization: Bearer <api_key>
Content-Type: application/json
```

```json theme={null}
{
  "subject": "Priority customers",
  "description": "High-priority support updates"
}
```

## Update participants

```http theme={null}
POST /api/v1/sessions/{sessionId}/groups/{groupJid}/participants
Authorization: Bearer <api_key>
Content-Type: application/json
```

```json theme={null}
{
  "action": "add",
  "participants": ["15551234567@s.whatsapp.net"]
}
```

`action` can be `add`, `remove`, `promote`, or `demote`.

## Update settings

```http theme={null}
PATCH /api/v1/sessions/{sessionId}/groups/{groupJid}/settings
Authorization: Bearer <api_key>
Content-Type: application/json
```

Boolean setting example:

```json theme={null}
{
  "setting": "announcement",
  "enabled": true
}
```

Mode examples:

```json theme={null}
{ "memberAddMode": "admin_add" }
```

```json theme={null}
{ "memberLinkMode": "all_member_link" }
```

```json theme={null}
{ "memberShareGroupHistoryMode": "all_member_share" }
```

Disappearing messages:

```json theme={null}
{
  "ephemeralDurationSeconds": 604800
}
```

## Invites

Preview an invite:

```http theme={null}
POST /api/v1/sessions/{sessionId}/groups/invite/preview
Authorization: Bearer <api_key>
Content-Type: application/json
```

Join by invite:

```http theme={null}
POST /api/v1/sessions/{sessionId}/groups/join
Authorization: Bearer <api_key>
Content-Type: application/json
```

```json theme={null}
{ "code": "AbCdEfGhIjK" }
```

Fetch or rotate an invite code:

```http theme={null}
GET /api/v1/sessions/{sessionId}/groups/{groupJid}/invite-code
POST /api/v1/sessions/{sessionId}/groups/{groupJid}/invite/revoke
Authorization: Bearer <api_key>
```

## Membership requests

```http theme={null}
GET /api/v1/sessions/{sessionId}/groups/{groupJid}/membership-requests
Authorization: Bearer <api_key>
```

```http theme={null}
POST /api/v1/sessions/{sessionId}/groups/{groupJid}/membership-requests
Authorization: Bearer <api_key>
Content-Type: application/json
```

```json theme={null}
{
  "action": "approve",
  "participants": ["15551234567@s.whatsapp.net"]
}
```

`action` can be `approve`, `reject`, or `cancel`.

## Leave groups

```http theme={null}
POST /api/v1/sessions/{sessionId}/groups/leave
Authorization: Bearer <api_key>
Content-Type: application/json
```

```json theme={null}
{
  "groupJids": ["120363000000000000@g.us"]
}
```
