UpdateGroupSettings#
The method is intended for changing the group settings.
The method uses limits on the request rate per second.
Request#
To change the group settings, you need to execute a request at:
POST
{{apiUrl}}/waInstance{{idInstance}}/updateGroupSettings/{{apiTokenInstance}}
To get the apiUrl, idInstance and apiTokenInstance request parameters, refer to the Before you start section.
Request parameters#
Request parameters#
| Parameter | Type | Required | Description |
|---|---|---|---|
chatId | string | Yes | Group chat identifier |
allowParticipantsSendMessages | boolean | No | Allow participants to send text messages, true / false |
allowParticipantsSendMedia | boolean | No | Allow participants to send media files (photos, videos, documents, voice and video messages), true / false |
allowParticipantsSendPolls | boolean | No | Allow participants to send polls, true / false |
allowParticipantsSendOtherMessages | boolean | No | Allow participants to send other messages (stickers, GIF animations, etc.), true / false |
allowParticipantsAddWebPagePreviews | boolean | No | Allow generating link previews in messages (Rich Link Previews), true / false |
allowParticipantsEditGroupSettings | boolean | No | Allow participants to change the group settings (name, photo, description), true / false |
allowParticipantsAddMembers | boolean | No | Allow participants to add new users to the group, true / false |
allowParticipantsPinMessages | boolean | No | Allow participants to pin messages in the group, true / false |
Request body example#
{
"chatId": "-1001234567890",
"allowParticipantsSendMessages": true,
"allowParticipantsSendMedia": true,
"allowParticipantsSendPolls": false,
"allowParticipantsSendOtherMessages": true,
"allowParticipantsAddWebPagePreviews": true,
"allowParticipantsEditGroupSettings": false,
"allowParticipantsAddMembers": true,
"allowParticipantsPinMessages": false
}
Response#
Response fields#
| Parameter | Type | Description |
|---|---|---|
updateGroupSettings | boolean | Flag that the group settings are changed |
reason | string | Reason for the request error (only when "updateGroupSettings": false) |
Response body example#
{
"updateGroupSettings": true
}
Errors#
For the list of errors common to all methods, see the Common errors section
| HTTP code | Error identifier | Description |
|---|---|---|
| 200 | "updateGroupSettings" false"reason": "NOT_ENOUGH_RIGHTS" | Not enough rights to change the settings |
| 200 | "updateGroupSettings" false"reason": "FORBIDDEN" | The number was removed from the group |
| 200 | "updateGroupSettings" false"reason": "NOT_FOUND" | The specified group is not in the number's group list |
| 400 | Bad Request Validation failed | Incorrect chatId value |
Code examples#
import requests
url = "{{apiUrl}}/waInstance{{idInstance}}/updateGroupSettings/{{apiTokenInstance}}"
payload = {
"chatId": -10000000000000,
"allowParticipantsEditGroupSettings": true,
"allowParticipantsAddMembers": true,
"allowParticipantsPinMessages": false,
}
headers = {
'Content-Type': 'application/json'
}
response = requests.post(url, json=payload, headers=headers)
print(response.text.encode('utf8'))
curl --location -g --request POST '{{apiUrl}}/waInstance{{idInstance}}/updateGroupSettings/{{apiTokenInstance}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"chatId": -10000000000000,
"allowParticipantsEditGroupSettings": true,
"allowParticipantsAddMembers": true,
"allowParticipantsPinMessages": true
}'
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.post("{{apiUrl}}/waInstance/{{idInstance}}/updateGroupSettings/{{apiTokenInstance}}")
.header("Content-Type", "application/json")
.body("{\r\n \"chatId\": \"-10000000000000\",\r\n \"allowParticipantsEditGroupSettings\": true,\r\n}")
.asString();