Skip to content

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

ParameterTypeRequiredDescription
chat_idInteger/StringYesUnique identifier for the target chat or username
permissionsChatPermissionsYesDefault group permissions object

ChatPermissions Object

FieldTypeDescription
can_send_messagesBooleanWhether members can send text messages, contacts, locations, and venues
can_send_media_messagesBooleanWhether members can send audio, documents, photos, videos, video notes, and voice notes
can_send_pollsBooleanWhether members can send polls
can_send_other_messagesBooleanWhether members can send animations, games, stickers, and use inline bots
can_add_web_page_previewsBooleanWhether members can add web page link previews
can_change_infoBooleanWhether members can change the chat title, photo, and other settings
can_invite_usersBooleanWhether members can invite new users to the chat
can_pin_messagesBooleanWhether members can pin messages

Response

Returns Boolean true on success.

json
{
  "ok": true,
  "result": true
}

Error Codes

CodeDescription
400Bad request parameters, e.g. invalid permissions format
401Invalid or expired token
403Bot does not have administrator privileges or lacks permission to modify permissions