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

# Groups

> List, create, and manage WhatsApp groups with the PHP SDK

Use `$vzaps->groups()` for WhatsApp group operations on an instance.

Common fields on all calls:

| Field           | Type     | Required | Description     |
| --------------- | -------- | -------- | --------------- |
| `instanceId`    | `string` | Yes      | Instance ID.    |
| `instanceToken` | `string` | Yes      | Instance token. |

Operations on a specific group also require `groupId` in the payload.

## `groups()->list($request)`

Lists groups with pagination.

```php theme={null}
$groups = $vzaps->groups()->list([
    'instanceId' => 'VZ...',
    'instanceToken' => 'instance-token',
    'page' => 1,
    'pageSize' => 20,
]);

print_r($groups);
```

**Return:** envelope `{ code, success, data.groups[] }` with pagination when applicable.

## `groups()->get($request)`

Gets group metadata.

```php theme={null}
$group = $vzaps->groups()->get([
    'instanceId' => 'VZ...',
    'instanceToken' => 'instance-token',
    'groupId' => '120363012345678901@g.us',
]);

print_r($group);
```

**Return:** envelope `{ code, success, data }` with group metadata (`jid`, `name`, `topic`, participants, etc.).

## `groups()->inviteLink($request)`

Gets or resets the invite link.

```php theme={null}
$invite = $vzaps->groups()->inviteLink([
    'instanceId' => 'VZ...',
    'instanceToken' => 'instance-token',
    'groupId' => '120363012345678901@g.us',
    'reset' => false,
]);

print_r($invite);
```

**Return:** envelope `{ code, success, data.invite_link }`.

With reset:

```php theme={null}
$newInvite = $vzaps->groups()->inviteLink([
    'instanceId' => 'VZ...',
    'instanceToken' => 'instance-token',
    'groupId' => '120363012345678901@g.us',
    'reset' => true,
]);
```

## `groups()->setPhoto($request)`

Changes group photo. Accepts a public URL or base64 data URL.

```php theme={null}
$vzaps->groups()->setPhoto([
    'instanceId' => 'VZ...',
    'instanceToken' => 'instance-token',
    'groupId' => '120363012345678901@g.us',
    'image' => 'https://cdn.example.com/groups/photo.jpg',
]);
```

**Return:** envelope `{ code, success, data.details }` confirming the change.

## `groups()->setName($request)`

Changes group name.

```php theme={null}
$vzaps->groups()->setName([
    'instanceId' => 'VZ...',
    'instanceToken' => 'instance-token',
    'groupId' => '120363012345678901@g.us',
    'name' => 'VIP Support',
]);
```

**Return:** envelope `{ code, success, data.details }` confirming the change.

## `groups()->setDescription($request)`

Changes group description.

```php theme={null}
$vzaps->groups()->setDescription([
    'instanceId' => 'VZ...',
    'instanceToken' => 'instance-token',
    'groupId' => '120363012345678901@g.us',
    'description' => 'Official support channel',
]);
```

**Return:** envelope `{ code, success, data.details }` confirming the change.

## `groups()->setSettings($request)`

Changes group settings.

```php theme={null}
$vzaps->groups()->setSettings([
    'instanceId' => 'VZ...',
    'instanceToken' => 'instance-token',
    'groupId' => '120363012345678901@g.us',
    'adminOnlyMessage' => true,
    'adminOnlySettings' => false,
    'delayMessage' => 0,
]);
```

**Return:** envelope `{ code, success, data.details }` confirming the change.

## `groups()->create($request)`

Creates a group with participants.

```php theme={null}
$vzaps->groups()->create([
    'instanceId' => 'VZ...',
    'instanceToken' => 'instance-token',
    'groupName' => 'VIP Support',
    'groupDescription' => 'Support channel',
    'groupImage' => 'https://cdn.example.com/groups/photo.jpg',
    'participants' => ['5511999999999', '5511888888888'],
]);
```

**Return:** envelope `{ code, success, data }` with created group fields.

## `groups()->addAdmin($request)`

Promotes participants to admin.

```php theme={null}
$vzaps->groups()->addAdmin([
    'instanceId' => 'VZ...',
    'instanceToken' => 'instance-token',
    'groupId' => '120363012345678901@g.us',
    'participants' => ['5511999999999'],
]);
```

**Return:** envelope `{ code, success, data.details }` confirming the change.

## `groups()->removeAdmin($request)`

Removes admins from the group.

```php theme={null}
$vzaps->groups()->removeAdmin([
    'instanceId' => 'VZ...',
    'instanceToken' => 'instance-token',
    'groupId' => '120363012345678901@g.us',
    'participants' => ['5511999999999'],
]);
```

**Return:** envelope `{ code, success, data.details }` confirming the change.
