Admin-only mode and other group permissions: how to check and change them
You can use the Whapi.Cloud API to check whether a group is in admin-only mode (only admins can send messages, also called announcement mode) and to turn it on or off.
Checking the current setting
Call GET /groups/{GroupID} and look for the announcements field in the response:
"announcements": true— only admins can send messages.No
announcementsfield — everyone can send messages.
API reference: Get group, Get groups
Changing the setting
Call PATCH /groups/{GroupID} with this body:
{
"setting": "send_messages",
"policy": "admins"
}Set policy to admins to restrict messaging to admins, or to anyone to let all participants write.
curl --request PATCH \
--url https://gate.whapi.cloud/groups/{GroupID} \
--header 'accept: application/json' \
--header 'authorization: Bearer YOUR_API_TOKEN' \
--header 'content-type: application/json' \
--data '{"setting": "send_messages", "policy": "admins"}'API reference: Update group setting
Other group permissions
The group object has more permission fields. The Values column shows how each one reads: most are present only while the restriction is on, while joinApprovalMode is always returned as true or false. To change them, use the same PATCH request with a different setting:
Restriction
Field in the GET response
Values
setting in PATCH
Only admins can send messages
announcements
true — on; field missing — off
send_messages
Only admins can add participants
adminAddMemberMode
true — on; field missing — off
add_participants
Only admins can edit group info (subject, description, icon)
restricted
true — on; field missing — off
edit_group_info
Admins must approve new members who join via the invite link
joinApprovalMode
true — on; false — off
approve_participants
policy is admins or anyone for all of them.
Last updated