# How to check and change admin-only mode in a WhatsApp group

### Checking the current setting

Call **GET** to get group details. In the response, look for the `announcements` field:

* `"announcements": true` is present — only admins can send messages.
* The `announcements` field is absent — everyone can send messages.

API reference:\
[Get groups](https://whapi.readme.io/reference/getgroups)\
[Get group](https://whapi.readme.io/reference/getgroup)

#### Changing the setting

Call **PATCH /groups/{GroupID}** with this body:

```json
{
  "setting": "send_messages",
  "policy": "admins"
}
```

Set `"policy"` to `"admins"` to restrict messaging to admins, or `"anyone"` to let all participants write.

```bash
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"
  }'
```

Your channel must be an admin in the group to change this setting.

API reference: [Update group setting](https://whapi.readme.io/reference/updategroupsetting)
