Delete channels

Remove a channel permanently 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​

icon

Under the hood


These methods take the following parameters:

  • delete()

    1channel.delete(): Promise<true>
  • deleteChannel()

    1chat.deleteChannel(id: string): Promise<true>

Input​

ParameterRequired in delete()Required in deleteChannel()Description
id
Type: string
Default:
n/a
NoYesUnique channel identifier.

Output​

TypeDescription
Promise<true>For delete(), a confirmation that the channel metadata was permanently deleted.
Promise<true>For deleteChannel(), a confirmation that the channel metadata was permanently deleted.

Errors​

Whenever the channel ID is required, and you try to delete a channel without providing its ID, you will receive the ID is required error.

Sample code​

Permanently delete the support channel metadata.

  • delete()

    1// reference the "channel" object
    2const channel = await chat.getChannel("support")
    3// permanently delete the channel
    4await channel.delete()
  • deleteChannel()

    1// reference the "chat" object and invoke the "deleteChannel()" method
    2const channel = await chat.deleteChannel("support")

Was this page useful?

Last updated on