Reading
Groups
GET
/v1/groupsRead the groups your number is in, and manage their members. A group's id is its JID, ending in @g.us. The number must be connected, or you get 503.
List groups
GET https://api.api-supp.com/v1/groups
| Param | Type | Notes |
|---|---|---|
q | string | Optional. Part of the group name |
json
{
"groups": [{
"jid": "120363012345678901@g.us",
"subject": "Class parents",
"size": 31,
"announce": false,
"restrict": false,
"is_community": false,
"owner": "14155550132@s.whatsapp.net",
"is_admin": true
}],
"count": 1
}size: the number of membersannounce: only admins can send messagesrestrict: only admins can change the group's settingsis_admin: your number is an admin of the group
One group
GET https://api.api-supp.com/v1/groups/:jid returns the group with its description and every member. 400 if the id doesn't end in @g.us.
json
{
"jid": "120363012345678901@g.us",
"subject": "Class parents",
"description": "Updates for the parents of class 3",
"owner": "14155550132@s.whatsapp.net",
"addressing_mode": "lid",
"announce": false,
"restrict": false,
"size": 31,
"participants": [
{ "jid": "133144455962747@lid", "phone": "14155550187", "lid": "133144455962747", "admin": null }
]
}participants[].jid: how WhatsApp addresses the member. Pass it back to remove themparticipants[].admin:admin,superadminornulladdressing_mode: whether WhatsApp lists members by LID (lid) or phone (pn)
Add or remove members
POST https://api.api-supp.com/v1/groups/:jid/participants
Your number must be an admin of the group.
| Field | Type | Notes |
|---|---|---|
action | string | add (the default), remove, promote (make admin) or demote |
participants | string or string[] | Required. Phone numbers or JIDs |
json
{ "action": "remove", "participants": ["14155550187"] }You get 200 when every member succeeded and 207 when at least one failed. results has one row per member you sent:
json
{
"jid": "120363012345678901@g.us",
"action": "remove",
"results": [
{ "input": "14155550187", "jid": "133144455962747@lid", "status": 200, "ok": true }
]
}status | Meaning |
|---|---|
200 | Done |
403 | Your number isn't an admin of the group |
404 | Not a member of the group (for remove, promote and demote) |
408 | The number isn't on WhatsApp |
409 | Already in the group, or WhatsApp wants an invite link instead |
The request itself fails with 400 for an unknown action, an empty participants, a participant that isn't a phone number or JID, or a group id that doesn't end in @g.us, and with 502 if WhatsApp doesn't answer.