---
source_url: https://www.pubnub.com/docs/chat/kotlin-chat-sdk/build/features/channels/updates
title: Manage channel updates
updated_at: 2026-06-15T12:11:31.787Z
---

> Documentation Index
> For a curated overview of PubNub documentation, see: https://www.pubnub.com/docs/llms.txt
> For the full list of all documentation pages, see: https://www.pubnub.com/docs/llms-full.txt


# Manage channel updates

Update channel metadata and receive real-time change events.

:::note Requires App Context
Enable [App Context](https://youtu.be/9UEoSlngpYI) for your keyset in the [Admin Portal](https://admin.pubnub.com/).
:::

## Update channel details

Edit channel metadata with `update()` or `updateChannel()`.

Both methods produce the same result. Call `update()` on a `Channel` object or `updateChannel()` on the `Chat` object with the channel ID.

### Method signature

These methods take the following parameters:

* update() 1channel.update(2 name: String?,3 custom: CustomObject?,4 description: String?,5 status: String?,6 type: ChannelType?,7): PNFuture<Channel>
* updateChannel() 1chat.updateChannel(2 id: String,3 name: String?,4 custom: CustomObject?,5 description: String?,6 status: String?,7 type: ChannelType?,8): PNFuture<Channel>

#### Input

| Parameter | Required in update() | Required in updateChannel() | Description |
| --- | --- | --- | --- |
| id | String | Optional |  | No | Yes | Unique channel identifier. |
| name | String | Optional |  | No | No | Display name for the channel. |
| custom | CustomObject | Optional |  | No | No | JSON object providing custom data about the channel. Values must be scalar only; arrays or objects are not supported. [App Context filtering language](https://www.pubnub.com/docs/general/metadata/filtering) doesn’t support filtering by custom properties. |
| description | String | Optional |  | No | No | Additional details about the channel. |
| status | String | Optional |  | No | No | Tag that categorizes a channel by its state, like `archived`. |
| type | String | Optional |  | No | No | Tag that categorizes a channel by its function, like `offtopic`. |

:::tip API limits
To learn about the maximum length of parameters used to set channel metadata, refer to [REST API docs](https://www.pubnub.com/docs/sdks/rest-api/set-channel-metadata).
:::

#### Output

| Type | Description |
| --- | --- |
| `PNFuture<Channel>` | `PNFuture` containing the updated channel object with its metadata. |

### Sample code

Update the description of the `support` channel.

* update() 1// reference the "channel" object2chat.getChannel("support").async {3 it.onSuccess { channel ->4 // invoke the "update()" method on the "channel" object5 channel.update(description = "Channel for CRM tickets").async {6 ... // handle success and failure7 }8 }.onFailure { ... /* handle failure */ }9}
* updateChannel() 1// reference the "chat" object and invoke the "updateChannel()" method2chat.updateChannel(3 "support",4 description = "Channel for CRM tickets"5).async {6 ... // handle success and failure7}

## Get channel updates

Receive real-time notifications when channel metadata changes or a channel is deleted:

* `onUpdated()` - fires when channel metadata is modified
* `onDeleted()` - fires when the channel is deleted

### Method signature

These methods take the following parameters:

* onUpdated() 1channel.onUpdated(callback: (channel: Channel) -> Unit): AutoCloseable
* onDeleted() 1channel.onDeleted(callback: () -> Unit): AutoCloseable

#### Input

| Parameter | Description |
| --- | --- |
| `callback` (in `onUpdated`) *Type: `(channel: Channel) -> Unit`Default: n/a | Function that receives the updated `Channel` object when metadata changes. |
| `callback` (in `onDeleted`) *Type: `() -> Unit`Default: n/a | Function invoked when the channel is deleted. |

#### Output

| Type | Description |
| --- | --- |
| `AutoCloseable` | Interface that lets you stop receiving channel-related updates by invoking the `close()` method. |

### Sample code

Get updates when the `support` channel metadata changes.

```kotlin
val supportChannel: Channel

...

val subscription = supportChannel.onUpdated { updatedChannel ->
    println("Updated channel: $updatedChannel")
}

...
// stop receiving updates:
subscription.close()
```

Get notified when the `support` channel is deleted.

```kotlin
val supportChannel: Channel

...

val subscription = supportChannel.onDeleted {
    println("Channel was deleted")
}

...
// stop receiving updates:
subscription.close()
```

## Get channel updates (deprecated)

:::warning Deprecated methods
`streamUpdates()` is deprecated. Use [onUpdated()](#get-channel-updates) and [onDeleted()](#get-channel-updates) instead. `streamUpdatesOn()` remains supported.
:::

Receive updates when [Channel objects](https://www.pubnub.com/docs/chat/kotlin-chat-sdk/learn/chat-entities/channel) are edited or removed:

* `streamUpdates()` - monitors a single channel
* `streamUpdatesOn()` - monitors multiple channels

Both methods accept a callback invoked when channel metadata changes. They subscribe to a channel and add an [objects event listener](https://www.pubnub.com/docs/sdks/kotlin/api-reference/configuration#event-listeners) for `channel` events, returning an `unsubscribe` function.

:::note Stream update behavior
* `streamUpdates()` returns the updated `Channel` object on each change (`null` if deleted)
* `streamUpdatesOn()` returns the complete list of monitored channels on any change
:::

### Method signature

These methods take the following parameters:

* streamUpdates() 1channel.streamUpdates(callback: (channel: Channel?) -> Unit): AutoCloseable
* streamUpdatesOn() 1class Channel {2 companion object {3 fun streamUpdatesOn(4 channels: Collection<Channel>,5 callback: (channels: Collection<Channel>) -> Unit6 ): AutoCloseable7 }8}

#### Input

| Parameter | Required in `streamUpdates()` | Required in `streamUpdatesOn()` | Description |
| --- | --- | --- | --- |
| `channels`Type: `Collection<Channel>`Default: n/a | No | Yes | A collection of [Channel objects](https://www.pubnub.com/docs/chat/kotlin-chat-sdk/learn/chat-entities/channel) for which you want to get updates. |
| `callback`Type: `(channel: Channel?) -> Unit`Default: n/a | Yes | No | Function that takes a single `Channel` object. It defines the custom behavior to be executed when detecting channel changes. |
| `callback`Type: `(channels: Collection<Channel>) -> Unit`Default: n/a | No | Yes | Function that takes a set of `Channel` objects. It defines the custom behavior to be executed when detecting channel changes. |

#### Output

| Type | Description |
| --- | --- |
| `AutoCloseable` | Interface that lets you stop receiving channel-related updates (`objects` events) by invoking the `close()` method. |

### Sample code

* streamUpdates() Get updates on the support channel. 1val supportChannel: Channel2 3... 4 5val subscription = supportChannel.streamUpdates { updatedChannel ->6 // The callback receives the entire updated Channel object each time a change occurs.7 if (updatedChannel != null) {8 println("-=Updated channel: $updatedChannel")9 } else {10 println("Channel was deleted")11 }12}13 14...15// always remember to call close to stop receiving updates:16subscription.close()
* streamUpdatesOn() Get updates on the support and incident-management channels. 1val supportChannel: Channel2val incidentManagementChannel: Channel3 4...5 6// create a list of channels to monitor7val channelsToMonitor = listOf(supportChannel, incidentManagementChannel)8 9// monitor updates on the specified channels10Channel.streamUpdatesOn(channels = channelsToMonitor) { updatedChannels ->11 // The callback receives the complete list of all channels you're monitoring12 // each time any change occurs.13 println("-=Updated channels: $updatedChannels")14}15 16...17// always remember to call close to stop receiving updates:18subscription.close()