Enable or disable content protection on a channel, group or private chat.
Method schema is available as of layer 223. Switch »
| Name | Type | Description |
|---|---|---|
| flags | # | Flags, see TL conditional fields |
| peer | InputPeer | The chat or channel |
| enabled | Bool | Enable or disable content protection |
| request_msg_id | flags.0?int | Used only inside private chats to accept or refuse a request to disable content protection, see here » for more info on the full flow. |
| Code | Type | Description |
|---|---|---|
| 400 | CHAT_ADMIN_REQUIRED | You must be an admin in this chat to do this. |
| 400 | CHAT_NOT_MODIFIED | No changes were made to chat information because the new information you passed is identical to the current information. |
| 400 | PEER_ID_INVALID | The provided peer id is invalid. |
Users and bots who want to keep their messages private, as well as Group and Channel owners who want to keep their content members-only can enable content protection, which prevents screenshots, copying, disables message forwards and limits the ability to save media from posts.