---
title: "Set Channel ReadOnly"
slug: "set-channel-readonly"
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 Channel ReadOnly

Post/api/v1/channels.setReadOnly

Set a channel to be read-only or not. 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='52546fd9-56a3-4119-9f2c-64304943e843'>application/json</option>
</select><select class='select-example' aria-label='Media type'><option value='371e3185-1dfa-4a00-bf16-e013d1c3c4ad'>Example</option>
</select>Example

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

object  roomIdstring    Required

The channel ID.

readOnlyboolean    Required

Boolean of whether the room is read-only or not.

Responses200

OK

<select class='api-response-data' aria-label='Media type'><option value='1ee287ea-d9fd-47d1-b71e-31acbc13c929'>application/json</option>
</select><select class='select-example' aria-label='Media type'><option value='5ee870ba-d69b-404a-be2c-e88e4ca340b4'>Success</option>
</select>Success

```json
{
  "channel": {
    "_id": "ByehQjC44FwMeiLbX",
    "name": "testing0",
    "t": "c",
    "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  channelobject  _idstring    
namestring    
tstring    
msgsinteger    
uobject  _idstring    
usernamestring    

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

successboolean    

401

Unauthorized

<select class='api-response-data' aria-label='Media type'><option value='ae33ad39-5a82-4cc3-bec5-537373f048b4'>application/json</option>
</select><select class='select-example' aria-label='Media type'><option value='4e283a31-4d20-499d-ae7f-ba9cd77c2eee'>Authorization Error</option>
</select>Authorization Error

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

object  statusstring    
messagestring
