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

RouteWhat it does
GET /groupsThe groups the number is in.
POST /groupsCreate a group with name and participants. Answers 201.
GET /groups/{gid}One group.
GET /groups/{gid}/participantsIts participants.
POST /groups/{gid}/participants/addAdd participants.
POST /groups/{gid}/participants/removeRemove participants.
POST /groups/{gid}/admins/promoteMake participants admins.
POST /groups/{gid}/admins/demoteRemove admin rights from participants.
GET /groups/{gid}/inviteThe invite link (invite_code, invite_url).
PUT /groups/{gid}/subjectChange the name (subject, up to 100 characters).
PUT /groups/{gid}/descriptionChange the description (description, up to 2,048 characters; empty clears it).
POST /groups/{gid}/leaveThe number leaves the group.
GET /groups/{gid}/settingsThe four security settings.
PATCH /groups/{gid}/settingsChange some of them.
GET /groups/{gid}/join-requestsPeople waiting for approval to join.
POST /groups/{gid}/join-requests/approveApprove participants.
POST /groups/{gid}/join-requests/rejectReject participants.
GET /groups/{gid}/pictureThe group picture (url, or null).
PUT /groups/{gid}/pictureChange the picture (JPEG, by url or base64).
DELETE /groups/{gid}/pictureRemove the picture.
GET /groups/join-info?code=...See an invite's group (name, description, size) without joining.
POST /groups/joinJoin 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"] }'
  • participants takes 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 answers 400 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.
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" }'
SettingMeaning
info_admin_onlytrue: only admins change the name, description and picture.
messages_admin_onlytrue: only admins send messages.
member_add_modeall_member_add: any member adds people; admin_add: only admins.
membership_approvaltrue: 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.

On this page