TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/wppconnect-team/wa-js/llms.txt
Use this file to discover all available pages before exploring further.
WPP.group module wraps WhatsApp Web’s group management internals. Group IDs use the @g.us suffix (e.g. 120363000000000001@g.us), while participant IDs use @c.us. All async functions return Promises and should be awaited. Many participant-accepting functions take either a single ID string or an array of strings.
You must be a group admin to perform most write operations (add/remove/promote/demote participants, change settings). The
iAmAdmin function lets you check your role before attempting privileged actions.Creating, joining, and leaving groups
WPP.group.create(groupName, participantsIds, parentGroup?)
Creates a new group and returns its ID together with per-participant result codes.
The display name (subject) for the new group.
One or more
@c.us WIDs to add at creation time.Pass a community’s
@g.us WID to create the group as a linked subgroup inside that community.WPP.group.join(inviteCode)
Joins a group using an invite code or a full invite URL. The function strips common URL prefixes automatically.
The invite code (e.g.
AbCdEf123456) or a full URL (https://chat.whatsapp.com/AbCdEf123456).WPP.group.leave(groupId)
Leaves a group.
The
@g.us WID of the group to leave.Managing participants
WPP.group.addParticipants(groupId, participantsIds)
Adds one or more participants to a group. Returns a per-participant result map.
The
@g.us WID of the target group.One or more
@c.us WIDs to add.| Code | Meaning |
|---|---|
200 | Added successfully |
403 | Contact restricted this group from adding them |
409 | Contact is already a member |
421 | Awaiting admin approval (join requests enabled) |
WPP.group.removeParticipants(groupId, participantsIds)
Removes one or more participants from a group.
The
@g.us WID of the group.One or more
@c.us WIDs to remove.WPP.group.getParticipants(groupId)
Returns all current group participants as an array of ParticipantModel objects.
The
@g.us WID of the group.WPP.group.getPastParticipants(groupId)
Returns participants who have previously left or been removed from the group.
The
@g.us WID of the group.Admin roles
WPP.group.promoteParticipants(groupId, participantsIds)
Promotes one or more participants to group admin. Throws if any participant is already an admin.
The
@g.us WID of the group.One or more
@c.us WIDs to promote.WPP.group.demoteParticipants(groupId, participantsIds)
Removes admin status from one or more participants. Throws if any participant is not currently an admin.
The
@g.us WID of the group.One or more
@c.us WIDs to demote.Permission checks
These functions check whether the current account has permission to perform specific actions in a group. They all return aboolean.
WPP.group.canAdd(groupId)
Checks if the current account is allowed to add new participants.
WPP.group.canPromote(groupId, participantsIds)
Checks if the current account can promote the specified participants.
WPP.group.canDemote(groupId, participantsIds)
Checks if the current account can demote the specified participants.
WPP.group.canRemove(groupId, participantsIds)
Checks if the current account can remove the specified participants.
Self-role checks
These three functions check the current account’s own membership role. They take only agroupId and return a boolean.
WPP.group.iAmMember(groupId)
Returns true if the current account is a member of the group.
WPP.group.iAmAdmin(groupId)
Returns true if the current account is an admin.
WPP.group.iAmSuperAdmin(groupId)
Returns true if the current account is the group creator (super admin).
WPP.group.iAmRestrictedMember(groupId)
Returns true if the current account is a restricted member (cannot send messages in announcement groups).
Group info
WPP.group.getAllGroups()
Returns all groups the current account belongs to.
WPP.group.getGroupSizeLimit()
Returns the maximum number of participants allowed in a group on the current WhatsApp Web version.
Invite links
WPP.group.getInviteCode(groupId)
Returns the current invite code for a group (without the full URL prefix). Requires admin access.
The
@g.us WID of the group.WPP.group.revokeInviteCode(groupId)
Revokes the current invite code and generates a new one. Old links will stop working immediately.
The
@g.us WID of the group.WPP.group.getGroupInfoFromInviteCode(inviteCode)
Fetches group metadata (name, description, participant list, owner) from an invite code — without actually joining the group.
An invite code or a full invite URL.
Membership requests
When a group has “Approval required to join” enabled, new members must be approved by an admin before they can participate.WPP.group.getMembershipRequests(groupId)
Returns all pending join requests for a group.
The
@g.us WID of the group.WPP.group.approve(groupId, membershipIds)
Approves one or more pending membership requests.
WPP.group.reject(groupId, membershipIds)
Rejects one or more pending membership requests.
Group settings
WPP.group.setSubject(groupId, subject)
Changes the group name. Requires admin access.
WPP.group.setDescription(groupId, description)
Sets the group description. Requires admin access.
WPP.group.setIcon(groupId, content)
Sets the group profile picture. The image is automatically resized to 96×96 (thumbnail) and 640×640 (full). Returns upload metadata on success.
The
@g.us WID of the group.A base64-encoded data URL of the image (e.g.
data:image/jpeg;base64,....).WPP.group.removeIcon(groupId)
Removes the group profile picture. Returns true on success.
WPP.group.setProperty(groupId, property, value)
Configures a group policy setting. Requires admin access.
The
@g.us WID of the group.The setting to change. One of
'announcement', 'restrict', or 'ephemeral'.The new value. For
announcement and restrict, pass a boolean. For ephemeral, pass a duration in seconds.GroupProperty values and their effects:
announcement — send-message permissions
announcement — send-message permissions
Controls who can send messages in the group.
restrict — edit-info permissions
restrict — edit-info permissions
Controls who can change the group subject, description, and icon.
ephemeral — disappearing messages
ephemeral — disappearing messages
Sets how long messages remain before auto-deletion. Pass
0 to disable.