Skip to main content
Baileys exposes a full set of group management methods on the sock object. Most operations that modify a group — changing its name, description, settings, or participants — require your account to be an admin of that group.
You must be a group admin to perform most of the operations on this page. Attempting them as a regular member will throw an error.

Create a group

Pass a subject (the group name) and an array of participant JIDs. The resolved value contains a gid field with the new group’s JID.

Add, remove, promote, or demote participants

groupParticipantsUpdate handles all four participant actions in a single method. Pass the group JID, an array of participant JIDs, and one of the four action strings.
The action parameter accepts 'add' | 'remove' | 'demote' | 'promote'.

Update the group subject and description

Change group settings

groupSettingUpdate controls two independent aspects: who can send messages, and who can change group settings.

Leave a group

Get the invite code

The raw code value is just the token. Prepend 'https://chat.whatsapp.com/' to build a shareable link.

Revoke the invite code

Revoking generates a new code and invalidates all previously shared links.

Join using an invite code

Pass only the raw code, not the full URL.
The code must not include the https://chat.whatsapp.com/ prefix — pass only the token portion.

Get group info from an invite code

You can inspect a group before joining it.

Join using a groupInviteMessage

When you receive an in-chat group invite message, you can accept it directly.

Query group metadata

Fetch the current participants, name, description, and other properties for any group you belong to.
The GroupMetadata object includes:

Get all participating groups

Returns a map of group JIDs to their GroupMetadata. Also emits a groups.update event internally.

Join request management

When joinApprovalMode is enabled on a group, new members must be approved before they can participate.

List pending join requests

Approve or reject requests

Toggle ephemeral (disappearing) messages

Pass 0 to disable disappearing messages, or one of the durations below to enable them.

Change who can add members

Control whether all members or only admins can add new participants to the group.

Caching group metadata

If you use groups heavily, Baileys recommends setting up a cachedGroupMetadata function on your socket config to avoid redundant network requests.
Caching group metadata significantly reduces latency and the number of IQ queries sent to WhatsApp’s servers, especially in bots that handle many groups simultaneously.