Adding and removing participants
ThegroupParticipantsUpdate function handles all participant management operations:
The group JID
Array of participant JIDs to update (must use
@s.whatsapp.net format)The action to perform:
'add', 'remove', 'promote', or 'demote'Participant actions
Adding members
Add new participants to the group:'200'- Successfully added'403'- Forbidden (user privacy settings may prevent adding)'408'- Request timeout- Other error codes indicate various failure reasons
Users with strict privacy settings may not be added to groups by non-contacts. In such cases, you’ll receive a
'403' status code and the user won’t be added.Removing members
Remove participants from the group:Promoting to admin
Grant admin privileges to regular members:- Add/remove participants (if group settings allow)
- Promote/demote other members
- Change group subject and description
- Modify group settings
- Manage invite codes
Only existing group admins can promote members to admin status.
Demoting admins
Remove admin privileges from group admins:Handling results
All participant update operations return an array of results showing the outcome for each participant:Common error codes
Common error codes
- 200 - Success
- 403 - Forbidden (privacy settings, not enough permissions, etc.)
- 404 - User not found
- 408 - Request timeout
- 409 - Conflict (e.g., user already in group for ‘add’ action)
- 500 - Internal server error
Batch operations
You can update multiple participants in a single call for better performance:Batch operations are processed as a single request to WhatsApp’s servers, making them more efficient than individual calls.
Permission requirements
Different actions have different permission requirements:| Action | Required Role | Notes |
|---|---|---|
| Add participants | Admin* | Depends on group’s member add mode setting |
| Remove participants | Admin | Cannot remove the owner |
| Promote to admin | Admin | Only admins can promote |
| Demote admin | Admin | Cannot demote the owner |
memberAddMode is set to 'all_member_add', regular members can also add participants. See group settings for more details.
Best practices
Check permissions first
Before attempting participant updates, verify that your bot/user has admin privileges by checking the group metadata.
Handle errors gracefully
Always check the status codes in the response to handle failures appropriately.
Respect privacy settings
Be prepared for some users to have privacy settings that prevent them from being added to groups.