Groups
Manage WhatsApp groups with Wazend: create, list, join, add or remove participants, admins, security, picture and more.
Manage WhatsApp groups with the API.
{session}— your session name (shown in the Dashboard, for exampleS0001).{groupId}— group ID in the format123123123123@g.us.
Info
If you see @lid in the participant list, see the Contacts page.
Create a new group
POST /api/{session}/groups{
"name": "Mi grupo",
"participants": [
{ "id": "5215551234567@c.us" },
{ "id": "5219999999999@c.us" }
]
}Get all groups
GET /api/{session}/groupsThe response depends on the engine you use.
Query parameters:
GET /api/{session}/groups?limit=20&offset=0&sortBy=subject&sortOrder=desc-
limit=10— limits the number of groups to return. -
offset=0— skips N groups from the start. -
sortBy— sort by field:sortBy=id— by group ID.sortBy=subject— by group subject.
-
sortOrder=desc|asc— order:desc— descending (newest first, A–Z).asc— ascending (oldest first, Z–A).
-
exclude=participants— excludes participant data from the response.
Tip
If you see timeout or the request takes too long, use limit to fetch the objects in smaller chunks.
Warning
If you see the rate-overlimit error with the NOWEB engine, try enabling NOWEB Store.
Get the number of groups
GET /api/{session}/groups/count{ "count": 10 }Join a group
If you have the invite link, join using the code or the full URL:
POST /api/{session}/groups/join{
"code": "https://chat.whatsapp.com/INVITECODE"
}{ "id": "5215551234567@g.us" }Get group invite info
GET /api/{session}/groups/join-info?code=invitecodeOr using the full link (remember to encode the URL):
GET /api/{session}/groups/join-info?code=https%3A%2F%2Fchat.whatsapp.com%2FinvitecodeRefresh groups
POST /api/{session}/groups/refreshWarning
Don't call it frequently, it can cause a rate-overlimit error. Usually the groups API already has up-to-date information.
Get the group
GET /api/{session}/groups/{groupId}Delete the group
DELETE /api/{session}/groups/{groupId}Leave the group
POST /api/{session}/groups/{groupId}/leaveGroup picture
Remember to encode the @ symbol in the ID as %40 (e.g. 5215551234567%40g.us).
Get picture
GET /api/{session}/groups/{ID}/picture?refresh=false{ "url": "https://ejemplo.com/foto.jpg" }url can be null if the group has no picture. Use refresh=true to force a refresh (by default it's cached for 24 hours; don't refresh frequently to avoid rate-overlimit).
Change picture
PUT /api/{session}/groups/{ID}/picture{
"file": {
"url": "https://ejemplo.com/foto.jpg"
}
}Or with base64 data:
{
"file": {
"data": "BASE64_DE_LA_IMAGEN"
}
}Delete picture
DELETE /api/{session}/groups/{ID}/pictureChange the group subject
PUT /api/{session}/groups/{groupId}/subject{ "subject": "Nuevo asunto" }Returns true if it was updated successfully. It can return false if you don't have the required permissions.
Change the group description
PUT /api/{session}/groups/{groupId}/description{ "description": "New description" }Returns true if it was updated successfully. It can return false if you don't have the required permissions.
Security · admins only edit info
Allows only admins to edit the group information (title, description, picture).
GET /api/{session}/groups/{groupId}/settings/security/info-admin-onlyPUT /api/{session}/groups/{groupId}/settings/security/info-admin-only{ "adminsOnly": true }Returns true if it was updated successfully. It can return false if you don't have the required permissions.
Security · admins only messages
Allows only admins to send messages.
GET /api/{session}/groups/{groupId}/settings/security/messages-admin-onlyPUT /api/{session}/groups/{groupId}/settings/security/messages-admin-only{ "adminsOnly": true }Returns true if it was updated successfully. It can return false if you don't have the required permissions.
Security · who can add members
Controls whether all members or only admins can add new members.
GET /api/{session}/groups/{groupId}/settings/security/member-add-modePUT /api/{session}/groups/{groupId}/settings/security/member-add-mode{
"membersCanAddNewMember": true
}Returns true if it was updated successfully. It can return false if you don't have the required permissions.
Participants
Get participants
GET /api/{session}/groups/{groupId}/participants[
{ "id": "5215551234567@c.us", "role": "participant" },
{ "id": "5219999999999@c.us", "role": "admin" }
]Also available with an almost identical response across engines:
GET /api/{session}/groups/{groupId}/participants/v2Possible roles: left, participant, admin, superadmin.
Add participants
POST /api/{session}/groups/{groupId}/participants/add{
"participants": [
{ "id": "5215551234567@c.us" }
]
}Remove participants
POST /api/{session}/groups/{groupId}/participants/remove{
"participants": [
{ "id": "5215551234567@c.us" }
]
}Admins
Promote to admin
POST /api/{session}/groups/{groupId}/admin/promote{
"participants": [
{ "id": "5215551234567@c.us" }
]
}Demote to regular user
POST /api/{session}/groups/{groupId}/admin/demote{
"participants": [
{ "id": "5215551234567@c.us" }
]
}Invite code
Get code
With the code you can build the link https://chat.whatsapp.com/{inviteCode} to share it with your contacts.
GET /api/{session}/groups/{groupId}/invite-codeRevoke code
Invalidates the current invite code and generates a new one.
POST /api/{session}/groups/{groupId}/invite-code/revokeEvents
Receive group events through Events: group.v2.join, group.v2.leave, group.v2.participants and group.v2.update. See the payload details on the Events page.