---
title: "Set Group as Encrypted"
slug: "set-group-as-encrypted"
updated: 2026-06-08T12:46:40Z
published: 2026-06-08T12:46:40Z
stale: true
---

> ## 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

Post/api/v1/groups.setEncrypted

Set a private channel as encrypted. Learn about [end-to-end encryption here](https://docs.rocket.chat/v1/docs/end-to-end-encryption-user-guide). Permission required: `edit-room`

### Changelog

| Version | Description |
| --- | --- |
| 3.13.0 | Added |

Header parametersX-Auth-TokenstringRequired

The `authToken` of the authenticated user.

ExampleRScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f
X-User-IdstringRequired

The `userId` of the authenticated user.

ExamplerbAXPnMktTFbNpwtJ

Body parameters<select class='api-response-data' aria-label='Media type'><option value='298cc5dd-ef40-48f2-8eac-ea0d2005ed2e'>application/json</option>
</select><select class='select-example' aria-label='Media type'><option value='a7277050-f4c8-459f-9d33-71b990ab29cc'>Example</option>
</select>Example

```json
{
  "encrypted": false,
  "roomId": "JZ8Y2dLfYhsg323Rf"
}
```

object  encryptedboolean    Required

Whether or not to encrypt the room.

roomIdstring    Required

The group ID. Alternatively, use the `roomName` parameter and enter the group name.

Responses200

OK

<select class='api-response-data' aria-label='Media type'><option value='1fb2457a-89a3-4a5b-ae96-662eb84366d5'>application/json</option>
</select><select class='select-example' aria-label='Media type'><option value='ee3c3e0e-4f18-4166-bd5a-22ecf1d0d25f'>Success</option>
</select>Success

```json
{
  "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
}
```

Expand Allobject  groupobject  _idstring    
fnamestring    
descriptionstring    
broadcastboolean    
encryptedboolean    
teamMainboolean    
namestring    
tstring    
msgsinteger    
usersCountinteger    
uobject  _idstring    
usernamestring    

tsstring    
roboolean    
teamIdstring    
_updatedAtstring    

successboolean    

400

Bad Request

<select class='api-response-data' aria-label='Media type'><option value='ad85cb4a-7a4e-44ce-9e73-6a1d201fdd4b'>application/json</option>
</select><select class='select-example' aria-label='Media type'><option value='c6d3e5a6-b32f-47aa-b155-948cb2153828'>Invalid  RoomId or RoomName</option>
<option value='6f5bca4e-3868-470f-a84a-f8ef5a6b45be'>No RoomId or Roomname</option>
</select>Invalid  RoomId or RoomName

```json
{
  "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

```json
{
  "success": false,
  "error": "The parameter \"roomId\" or \"roomName\" is required [error-room-param-not-provided]",
  "errorType": "error-room-param-not-provided"
}
```

object  successboolean    
errorstring    
errorTypestring    

401

Unauthorized

<select class='api-response-data' aria-label='Media type'><option value='229424a9-d5e4-4589-af58-aa7d34eefbfa'>application/json</option>
</select><select class='select-example' aria-label='Media type'><option value='81f037c4-7654-49ef-80ed-d718f961c758'>Authorization Error</option>
</select>Authorization Error

```json
{
  "status": "error",
  "message": "You must be logged in to do this."
}
```

object  statusstring    
messagestring
