Delete channels
Remove a channel permanently or soft-delete it (keeping historical data in App Context storage) with Delete() or DeleteChannel().
Both methods produce the same result. Call Delete() on a Channel object or DeleteChannel() on the Chat object with the channel ID.
Requires App Context
Enable App Context for your keyset in the Admin Portal.
Method signature
These methods take the following parameters:
-
Delete()(on theChannelobject)1channel.Delete(bool soft = false) -
DeleteChannel()(on theChatobject)1chat.DeleteChannel(
2 string channelId,
3 bool soft = false
4 )
Input
| Parameter | Required in Delete() | Required in DeleteChannel() | Description |
|---|---|---|---|
channelIdType: stringDefault: n/a | No | Yes | Unique channel identifier. |
softType: boolDefault: false | No | No | Define if you want to permanently remove channel metadata. The channel metadata gets permanently deleted from the App Context storage by default. If you set this parameter to true, the channel's IsDeleted property is set to true, and you can still restore/get its data. |
Output
| Type | Description |
|---|---|
Task<ChatOperationResult> | Returned Task that you can await to get the result of the delete operation. |
Sample code
Permanently delete the channel with the ID of support.
-
Delete()(on theChannelobject)1 -
DeleteChannel()(on theChatobject)1
Other examples
Archive (soft delete) the channel with the ID of support, keeping its data in the App Context storage.
1