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.
Create a group
Pass a subject (the group name) and an array of participant JIDs. The resolved value contains agid 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.
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
Invite links
Get the invite code
The rawcode 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.GroupMetadata object includes:
Get all participating groups
Returns a map of group JIDs to theirGroupMetadata. Also emits a groups.update event internally.
Join request management
WhenjoinApprovalMode 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
Pass0 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 acachedGroupMetadata function on your socket config to avoid redundant network requests.