> ## Documentation Index
> Fetch the complete documentation index at: https://developer.rocket.chat/llms.txt
> Use this file to discover all available pages before exploring further.
# Set Group as Encrypted
> Set a private channel as encrypted. Learn about end-to-end encryption here. Permission required: `edit-room`
### Changelog
| Version | Description |
| ------- | ----------- |
| 3.13.0 | Added |
## OpenAPI
````json POST /api/v1/groups.setEncrypted
{
"openapi": "3.0.0",
"info": {
"version": "1.0.0",
"title": "Rooms"
},
"servers": [
{
"url": "https://apiexplorer.support.rocket.chat"
}
],
"tags": [
{
"name": "Channels"
},
{
"name": "Directory"
},
{
"name": "Groups"
},
{
"name": "Rooms"
},
{
"name": "Teams"
},
{
"name": "Room Invites"
},
{
"name": "Subscriptions"
},
{
"name": "ABAC"
}
],
"paths": {
"/api/v1/groups.setEncrypted": {
"post": {
"tags": [
"Groups"
],
"summary": "Set Group as Encrypted",
"description": "Set a private channel as encrypted. Learn about end-to-end encryption here. Permission required: `edit-room`\n\n### Changelog\n| Version | Description |\n| ------- | ----------- |\n| 3.13.0 | Added |",
"operationId": "post-api-v1-groups.setEncrypted",
"parameters": [
{
"$ref": "#/components/parameters/Auth-Token"
},
{
"$ref": "#/components/parameters/UserId"
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"encrypted": {
"type": "boolean",
"description": "Whether or not to encrypt the room."
},
"roomId": {
"type": "string",
"description": "The group ID. Alternatively, use the `roomName` parameter and enter the group name."
}
},
"required": [
"encrypted",
"roomId"
]
},
"examples": {
"Example": {
"value": {
"encrypted": false,
"roomId": "JZ8Y2dLfYhsg323Rf"
}
}
}
}
}
},
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"group": {
"type": "object",
"properties": {
"_id": {
"type": "string"
},
"fname": {
"type": "string"
},
"description": {
"type": "string"
},
"broadcast": {
"type": "boolean"
},
"encrypted": {
"type": "boolean"
},
"teamMain": {
"type": "boolean"
},
"name": {
"type": "string"
},
"t": {
"type": "string"
},
"msgs": {
"type": "integer"
},
"usersCount": {
"type": "integer"
},
"u": {
"type": "object",
"properties": {
"_id": {
"type": "string"
},
"username": {
"type": "string"
}
}
},
"ts": {
"type": "string"
},
"ro": {
"type": "boolean"
},
"teamId": {
"type": "string"
},
"_updatedAt": {
"type": "string"
}
}
},
"success": {
"type": "boolean"
}
}
},
"examples": {
"Success": {
"value": {
"group": {
"_id": "JZ8Y2dLfYhsg323Rf",
"fname": "test",
"description": "",
"broadcast": false,
"encrypted": false,
"teamMain": true,
"name": "test",
"t": "p",
"msgs": 0,
"usersCount": 1,
"u": {
"_id": "d26x6zSkaPSe5gCyy",
"username": "rodriq"
},
"ts": "2021-10-22T11:59:17.029Z",
"ro": false,
"teamId": "6172a795c563fc000acc4629",
"_updatedAt": "2021-10-22T12:00:11.496Z"
},
"success": true
}
}
}
}
}
},
"400": {
"description": "Bad Request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean"
},
"error": {
"type": "string"
},
"errorType": {
"type": "string"
}
}
},
"examples": {
"Invalid RoomId or RoomName": {
"value": {
"success": false,
"error": "The required \"roomId\" or \"roomName\" param provided does not match any group [error-room-not-found]",
"errorType": "error-room-not-found"
}
},
"No RoomId or Roomname": {
"value": {
"success": false,
"error": "The parameter \"roomId\" or \"roomName\" is required [error-room-param-not-provided]",
"errorType": "error-room-param-not-provided"
}
}
}
}
}
},
"401": {
"$ref": "#/components/responses/authorizationError"
}
}
}
}
},
"components": {
"parameters": {
"Auth-Token": {
"name": "X-Auth-Token",
"in": "header",
"description": "The `authToken` of the authenticated user.",
"required": true,
"schema": {
"type": "string"
},
"example": "RScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f"
},
"UserId": {
"name": "X-User-Id",
"in": "header",
"description": "The `userId` of the authenticated user.",
"required": true,
"schema": {
"type": "string"
},
"example": "rbAXPnMktTFbNpwtJ"
}
},
"responses": {
"authorizationError": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"status": {
"type": "string"
},
"message": {
"type": "string"
}
}
},
"examples": {
"Authorization Error": {
"value": {
"status": "error",
"message": "You must be logged in to do this."
}
}
}
}
}
}
}
}
}
````