Set Group as Encrypted

HTTP MethodURLRequires Auth

POST

/api/v1/groups.setEncrypted

Body Parameters

KeyExample ValueDescription

encrypted*

true

Whether or not to encrypt the room.

roomID* or roomName*

JZ8Y2dLfYhsg323Rf or My Group

The group ID or name on which to set the encryption.

Example Call

curl -L -X POST 'http://localhost:3000/api/v1/groups.setEncrypted' \
-H 'X-User-Id: d26x6zSkaPSe5gCyy' \
-H 'X-Auth-Token: Zu-Z6eKzIIz7MCCRGeHi29bYkXZCJ4SxFC0JAasqm92' \
-H 'Content-Type: application/json' \
--data-raw '{
    "encrypted": false,
    "roomId": "JZ8Y2dLfYhsg323Rf"
}'

Example Response

Success

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

Error

Any of the following errors can occur:

  • Authorization: Requires an authentication token for the request to be made.

  • No encrypted parameter: Occurs when the endpoint is called without the encrypted body param.

  • No Room Id or roomName: Occurs when no roomID or roomName is given.

  • Invalid Room: Occurs when the given room is invalid.

{
    "success": false,
    "error": "unauthorized"
}

Change Log

VersionDescription

3.13.0

Added

Last updated

Rocket.Chat versions receive support for six months after release.