Groups
List and create groups, manage participants and admins, invite links, settings, join requests and the group picture.
These routes are under the Groups tag in the API Reference tab. To send a message to a group, use the group id as to in any send route.
Group ids
A group id looks like 120363000000000000@g.us. In the path ({gid}), you can send it whole or just the digits. An invalid id answers 400 grupo_invalido.
Routes
| Route | What it does |
|---|---|
GET /groups | The groups the number is in. |
POST /groups | Create a group with name and participants. Answers 201. |
GET /groups/{gid} | One group. |
GET /groups/{gid}/participants | Its participants. |
POST /groups/{gid}/participants/add | Add participants. |
POST /groups/{gid}/participants/remove | Remove participants. |
POST /groups/{gid}/admins/promote | Make participants admins. |
POST /groups/{gid}/admins/demote | Remove admin rights from participants. |
GET /groups/{gid}/invite | The invite link (invite_code, invite_url). |
PUT /groups/{gid}/subject | Change the name (subject, up to 100 characters). |
PUT /groups/{gid}/description | Change the description (description, up to 2,048 characters; empty clears it). |
POST /groups/{gid}/leave | The number leaves the group. |
GET /groups/{gid}/settings | The four security settings. |
PATCH /groups/{gid}/settings | Change some of them. |
GET /groups/{gid}/join-requests | People waiting for approval to join. |
POST /groups/{gid}/join-requests/approve | Approve participants. |
POST /groups/{gid}/join-requests/reject | Reject participants. |
GET /groups/{gid}/picture | The group picture (url, or null). |
PUT /groups/{gid}/picture | Change the picture (JPEG, by url or base64). |
DELETE /groups/{gid}/picture | Remove the picture. |
GET /groups/join-info?code=... | See an invite's group (name, description, size) without joining. |
POST /groups/join | Join through an invite code or link. |
Create a group
curl -X POST https://app.wappfy.io/api/v1/groups \
-H "X-Api-Key: wpf_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{ "name": "VIP Customers", "participants": ["5581999999999", "5581988888888"] }'participantstakes phone numbers or chat IDs, up to 256. Each Brazilian number is checked on WhatsApp, and one number without WhatsApp refuses the whole request (422 numero_sem_whatsapp). A group in the list answers400 participante_invalido.GET /groups,POST /groups,GET /groups/{gid}, the participant list, and adding or removing participants return the data as WhatsApp gives it, unchanged. Its fields may vary: read only what you need.
Admins and invite link
curl -X POST https://app.wappfy.io/api/v1/groups/120363000000000000@g.us/admins/promote \
-H "X-Api-Key: wpf_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{ "participants": ["5581999999999"] }'
curl https://app.wappfy.io/api/v1/groups/120363000000000000@g.us/invite \
-H "X-Api-Key: wpf_YOUR_KEY"{
"data": {
"id": "120363000000000000@g.us",
"invite_code": "AbCdEf123456",
"invite_url": "https://chat.whatsapp.com/AbCdEf123456"
}
}The number must be a group admin to promote, demote, get the invite link, change settings and handle join requests. Otherwise WhatsApp refuses with 403 sem_permissao and nothing is done.
Settings
curl -X PATCH https://app.wappfy.io/api/v1/groups/120363000000000000@g.us/settings \
-H "X-Api-Key: wpf_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{ "messages_admin_only": true, "member_add_mode": "admin_add" }'| Setting | Meaning |
|---|---|
info_admin_only | true: only admins change the name, description and picture. |
messages_admin_only | true: only admins send messages. |
member_add_mode | all_member_add: any member adds people; admin_add: only admins. |
membership_approval | true: people joining by link wait for an admin's approval. |
The PATCH changes only the settings in the body, one at a time, and answers with the ones it changed. If one fails midway, the earlier ones already took effect: repeating the same request is safe. In GET responses a setting is null when WhatsApp didn't report it.
Join requests
With membership_approval on, GET /groups/{gid}/join-requests lists who is waiting (chat_id, phone, method, requested_at). Approve or reject with their phone or chat_id:
curl -X POST https://app.wappfy.io/api/v1/groups/120363000000000000@g.us/join-requests/approve \
-H "X-Api-Key: wpf_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{ "participants": ["5581999999999"] }'The response lists each participant with the success WhatsApp returned (null when it didn't say).
Join through an invite
# see the group first (URL-encode the link)
curl "https://app.wappfy.io/api/v1/groups/join-info?code=https%3A%2F%2Fchat.whatsapp.com%2FAbCdEf123456" \
-H "X-Api-Key: wpf_YOUR_KEY"
# join
curl -X POST https://app.wappfy.io/api/v1/groups/join \
-H "X-Api-Key: wpf_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{ "code": "https://chat.whatsapp.com/AbCdEf123456" }'code takes the invite code or the whole link; anything else answers 400 convite_invalido. Joining returns the group_id. If the group requires approval, the number waits in line until an admin approves it.
Group events
Changes in groups arrive on your webhook: group.participants (joins, leaves, promotions, demotions) and group.updated (name, description and settings). Group messages arrive as message.received with is_group: true, where from is the participant who wrote.

