> ## 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 TypeScript SDK

Use `vzaps.groups` for WhatsApp group operations on an instance.

Common fields on every call:

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

Group-specific operations also require `groupId` in the payload.

## `groups.list(request)`

Lists groups with pagination.

```ts theme={null}
const groups = await vzaps.groups.list({
  instanceId: 'VZ...',
  instanceToken: 'instance-token',
  page: 1,
  pageSize: 20,
});

console.dir(groups, { depth: null });
```

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

## `groups.get(request)`

Gets group metadata.

```ts theme={null}
const group = await vzaps.groups.get({
  instanceId: 'VZ...',
  instanceToken: 'instance-token',
  groupId: '120363012345678901@g.us',
});

console.dir(group, { depth: null });
```

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

## `groups.inviteLink(request)`

Gets or resets the invite link.

```ts theme={null}
const invite = await vzaps.groups.inviteLink({
  instanceId: 'VZ...',
  instanceToken: 'instance-token',
  groupId: '120363012345678901@g.us',
  reset: false,
});

console.dir(invite, { depth: null });
```

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

With reset:

```ts theme={null}
const newInvite = await vzaps.groups.inviteLink({
  instanceId: 'VZ...',
  instanceToken: 'instance-token',
  groupId: '120363012345678901@g.us',
  reset: true,
});
```

## `groups.setPhoto(request)`

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

```ts theme={null}
await 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 the group name.

```ts theme={null}
await 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 the group description.

```ts theme={null}
await 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.

```ts theme={null}
await 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.

```ts theme={null}
await 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.

```ts theme={null}
await 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.

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

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