# Disabling Channels

Disabling a channel is a visibility and access toggle. The channel and all its data remain intact, but client-side read and write operations return a `403 Not Allowed` error. Server-side access is preserved for admin operations like moderation and data export.

Disabled channels still appear in query results by default. This means users see the channel in their list but receive errors when attempting to open it. To hide disabled channels from users, filter them out in your queries:

```js
await client.queryChannels({ disabled: false });
```

Re-enabling a channel restores full client-side access with all historical messages intact.

## Disable a Channel

<codetabs>

<codetabs-item value="javascript" label="JavaScript">

```js
// disable a channel with full update
await channel.update({ disabled: true });

// disable a channel with partial update
await channel.updatePartial({ set: { disabled: true } });

// enable a channel with full update
await channel.update({ disabled: false });

// enable a channel with partial update
await channel.updatePartial({ set: { disabled: false } });
```

</codetabs-item>

<codetabs-item value="php" label="PHP">

```php
use GetStream\ChatClient;
use GetStream\GeneratedModels as Models;

$client = new ChatClient("{{ api_key }}", "{{ api_secret }}");

// Disable a channel with partial update
$client->updateChannelPartial("messaging", "general", new Models\UpdateChannelPartialRequest(
    set: (object)["disabled" => true],
));

// Enable a channel with partial update
$client->updateChannelPartial("messaging", "general", new Models\UpdateChannelPartialRequest(
    set: (object)["disabled" => false],
));
```

</codetabs-item>

<codetabs-item value="python" label="Python">

```python
from getstream.models import ChannelInputRequest

# Get a channel
channel = client.chat.channel("messaging", "general")

# disable a channel with full update
channel.update(data=ChannelInputRequest(disabled=True))

# disable a channel with partial update
channel.update_channel_partial(set={"disabled": True})

# enable a channel with full update
channel.update(data=ChannelInputRequest(disabled=False))

# enable a channel with partial update
channel.update_channel_partial(set={"disabled": False})
```

</codetabs-item>

<codetabs-item value="ruby" label="Ruby">

```ruby
require 'getstream_ruby'

Models = GetStream::Generated::Models

# disable a channel with full update
client.chat.update_channel("messaging", "general", Models::UpdateChannelRequest.new(
  data: Models::ChannelInputRequest.new(disabled: true)
))

# disable a channel with partial update
client.chat.update_channel_partial("messaging", "general", Models::UpdateChannelPartialRequest.new(
  set: { 'disabled' => true }
))

# enable a channel with full update
client.chat.update_channel("messaging", "general", Models::UpdateChannelRequest.new(
  data: Models::ChannelInputRequest.new(disabled: false)
))

# enable a channel with partial update
client.chat.update_channel_partial("messaging", "general", Models::UpdateChannelPartialRequest.new(
  set: { 'disabled' => false }
))
```

</codetabs-item>

<codetabs-item value="java" label="Java">

```java
// disable a channel with full update
chat.updateChannel("<channel-type>", "<channel-id>", UpdateChannelRequest.builder()
    .data(ChannelInputRequest.builder().disabled(true).build())
    .build()).execute();

// disable a channel with partial update
chat.updateChannelPartial("<channel-type>", "<channel-id>",
    UpdateChannelPartialRequest.builder()
        .set(Map.of("disabled", true))
        .build()).execute();

// enable a channel with full update
chat.updateChannel("<channel-type>", "<channel-id>", UpdateChannelRequest.builder()
    .data(ChannelInputRequest.builder().disabled(false).build())
    .build()).execute();

// enable a channel with partial update
chat.updateChannelPartial("<channel-type>", "<channel-id>",
    UpdateChannelPartialRequest.builder()
        .set(Map.of("disabled", false))
        .build()).execute();
```

</codetabs-item>

<codetabs-item value="csharp" label="C#">

```csharp
using GetStream;
using GetStream.Models;

var client = new StreamClient("{{ api_key }}", "{{ api_secret }}");
var chat = new ChatClient(client);

var channelId = "channel-id";

// Disable a channel with partial update
await chat.UpdateChannelPartialAsync("messaging", channelId,
    new UpdateChannelPartialRequest
    {
        Set = new Dictionary<string, object> { ["disabled"] = true }
    });

// Enable a channel with partial update
await chat.UpdateChannelPartialAsync("messaging", channelId,
    new UpdateChannelPartialRequest
    {
        Set = new Dictionary<string, object> { ["disabled"] = false }
    });
```

</codetabs-item>

<codetabs-item value="go" label="Go">

```go
channel := client.Chat().Channel("messaging", "general")

// disable a channel with full update
channel.Update(ctx, &getstream.UpdateChannelRequest{
	Data: &getstream.ChannelInputRequest{Disabled: getstream.PtrTo(true)},
})

// disable a channel with partial update
channel.UpdateChannelPartial(ctx, &getstream.UpdateChannelPartialRequest{
	Set: map[string]any{"disabled": true},
})

// enable a channel with full update
channel.Update(ctx, &getstream.UpdateChannelRequest{
	Data: &getstream.ChannelInputRequest{Disabled: getstream.PtrTo(false)},
})

// enable a channel with partial update
channel.UpdateChannelPartial(ctx, &getstream.UpdateChannelPartialRequest{
	Set: map[string]any{"disabled": false},
})
```

</codetabs-item>

<codetabs-item value="unity" label="Unity">

```csharp
// For security reasons, disabling channels is only possible via a server-side SDK
```

</codetabs-item>

</codetabs>

<admonition type="info">

To prevent new messages while still allowing users to read existing messages, use [freeze the channel](/chat/docs/<framework>/freezing_channels/) instead.

</admonition>


---

This page was last updated at 2026-04-13T07:27:05.275Z.

For the most recent version of this documentation, visit [https://getstream.io/chat/docs/android/disabling_channels/](https://getstream.io/chat/docs/android/disabling_channels/).