setChatPermissions
Set the default permissions for all members in a group. The Bot must have administrator privileges to perform this action.
Request
POST /:token/setchatpermissions
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| chat_id | Integer/String | Yes | Unique identifier for the target chat or username |
| permissions | ChatPermissions | Yes | Default group permissions object |
ChatPermissions Object
| Field | Type | Description |
|---|---|---|
| can_send_messages | Boolean | Whether members can send text messages, contacts, locations, and venues |
| can_send_media_messages | Boolean | Whether members can send audio, documents, photos, videos, video notes, and voice notes |
| can_send_polls | Boolean | Whether members can send polls |
| can_send_other_messages | Boolean | Whether members can send animations, games, stickers, and use inline bots |
| can_add_web_page_previews | Boolean | Whether members can add web page link previews |
| can_change_info | Boolean | Whether members can change the chat title, photo, and other settings |
| can_invite_users | Boolean | Whether members can invite new users to the chat |
| can_pin_messages | Boolean | Whether members can pin messages |
Response
Returns Boolean true on success.
json
{
"ok": true,
"result": true
}Error Codes
| Code | Description |
|---|---|
| 400 | Bad request parameters, e.g. invalid permissions format |
| 401 | Invalid or expired token |
| 403 | Bot does not have administrator privileges or lacks permission to modify permissions |
