---
title: "Set Group as Read Only"
slug: "set-group-as-read-only"
updated: 2026-06-01T06:32:04Z
published: 2026-06-01T06:32:04Z
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 Read Only

Post/api/v1/groups.setReadOnly

Set or unset a private channel as [read-only](https://docs.rocket.chat/docs/channels#readonly-channels). Permission required: `edit-room`

### Changelog

| Version | Description |
| --- | --- |
| 0.49.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='45724ad3-ce13-41b5-b6ac-c8341a17faf7'>application/json</option>
</select><select class='select-example' aria-label='Media type'><option value='24b66fa6-2dc5-419a-b8d8-0e8afccbd73a'>Example</option>
</select>Example

```json
{
  "roomId": "ByehQjC44FwMei5LbX",
  "readOnly": true
}
```

object  roomIdstring    Required

The private group ID. You can find the IDs by using any of the following endpoints:

- [Get List of User Groups](https://developer.rocket.chat/apidocs/get-list-of-user-groups): This endpoint returns all private channels in the workspace, if you have the required permissions to view them.
- [Get Groups](https://developer.rocket.chat/apidocs/get-groups): This endpoint returns the private channels that you are a member of.

ExampleByehQjC44FwMei5LbX
readOnlyboolean    Required

Boolean to represent the group read-only status

Exampletrue

Responses200

OK

<select class='api-response-data' aria-label='Media type'><option value='7b04a053-78f4-4f13-b287-899ecb7aedea'>application/json</option>
</select><select class='select-example' aria-label='Media type'><option value='4b42406b-b7a0-4104-9a60-4a599e2e95a5'>Success</option>
</select>Success

```json
{
  "group": {
    "_id": "ByehQjC44FwMei5LbX",
    "name": "testing-private",
    "t": "p",
    "msgs": 0,
    "u": {
      "_id": "aiPqNoGkjpNDiRx6d",
      "username": "goose160"
    },
    "ts": "2017-01-05T18:02:50.754Z",
    "ro": true,
    "sysMes": true,
    "_updatedAt": "2017-01-05T19:02:24.429Z",
    "usernames": [
      "goose160",
      "graywolf336"
    ],
    "joinCodeRequired": true,
    "muted": []
  },
  "success": true
}
```

Expand Allobject  groupobject  _idstring    
namestring    
tstring    
msgsinteger    
uobject  _idstring    
usernamestring    

tsstring    
roboolean    
sysMesboolean    
_updatedAtstring    
usernames Array of string   string    
joinCodeRequiredboolean    
muted Array of object   object  

successboolean    

400

Bad Request

<select class='api-response-data' aria-label='Media type'><option value='135cece9-5585-45eb-90da-edd6bfda7e7e'>application/json</option>
</select><select class='select-example' aria-label='Media type'><option value='2c7d25a6-9d99-49f7-a8fb-540d464eba26'>Example 1</option>
<option value='fb17754c-1a1e-468c-a1a1-afd9e1375c6d'>Example 2</option>
</select>Example 1

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

Example 2

```json
{
  "success": false,
  "error": "The bodyParam \"readOnly\" is required"
}
```

object  successboolean    
errorstring    

401

Unauthorized

<select class='api-response-data' aria-label='Media type'><option value='2c74e27f-9b7e-411f-96a7-5c1915695ace'>application/json</option>
</select><select class='select-example' aria-label='Media type'><option value='a0ffa349-eee0-46ce-96c5-ed052aab67c4'>Authorization Error</option>
</select>Authorization Error

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

object  statusstring    
messagestring
