chat.updateChannelPartial("messaging", "general", UpdateChannelPartialRequest.builder()
.set(Map.of("source", "system", "channel_detail.topic", "Nature"))
.unset(List.of("source_detail"))
.build()).execute();Updating a Channel
There are two ways to update a channel with the Stream API: partial updates and full updates. A partial update preserves existing custom key–value data, while a full update replaces the entire channel object and removes any fields not included in the request.
Partial Update
A partial update lets you set or unset specific fields without affecting the rest of the channel’s custom data — essentially a patch-style update.
Full Update
The update function updates all of the channel data. Any data that is present on the channel and not included in a full update will be deleted.
chat.updateChannel("messaging", "general", UpdateChannelRequest.builder()
.message(MessageRequest.builder()
.text("Thierry changed the channel color to green")
.build())
.data(ChannelInputRequest.builder()
.custom(Map.of("name", "myspecialchannel", "color", "green"))
.build())
.build()).execute();Request Params
| Name | Type | Description | Optional |
|---|---|---|---|
| channel data | object | Object with the new channel information. One special field is "frozen". Setting this field to true will freeze the channel. Read more about freezing channels in "Freezing Channels" | |
| text | object | Message object allowing you to show a system message in the Channel that something changed. | Yes |
Updating a channel using these methods cannot be used to add or remove members. For this, you must use specific methods for adding/removing members, more information can be found here.