On this page

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 the Channel object)

    1channel.Delete(bool soft = false)
  • DeleteChannel() (on the Chat object)

    1chat.DeleteChannel(
    2 string channelId,
    3 bool soft = false
    4 )

Input

ParameterRequired in Delete()Required in DeleteChannel()Description
channelId
Type: string
Default:
n/a
No
Yes
Unique channel identifier.
soft
Type: bool
Default:
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

TypeDescription
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 the Channel object)

    1
    
  • DeleteChannel() (on the Chat object)

    1
    

Other examples

Archive (soft delete) the channel with the ID of support, keeping its data in the App Context storage.

1

Last updated on