Deleting Channels

LAST EDIT Nov 18 2021

Deleting a Channel

Copied!

You can delete a single Channel using the delete method. This marks the channel as deleted and hides all the messages.

If you recreate this channel, it will show up empty. Recovering old messages is not supported. Use the deactivate method if you want a reversible change

Deleting Many Channels

Copied!

You can delete up to 100 channels and optionally all of their messages using this method. This can be a large amount of data to delete, so this endpoint processes asynchronously, meaning responses contain a task ID which can be polled using the getTask endpoint to check status of the deletions. Channels will be soft-deleted immediately so that channels no longer return from queries, but permanently deleting the channel and deleting messages takes longer to process.

By default, messages are soft deleted, which means they are removed from client but are still available via server-side export functions. You can also hard delete messages, which deletes them from everywhere, by setting "hard_delete": true in the request. Messages that have been soft or hard deleted cannot be recovered.

This is currently supported on the following SDK versions (or higher):

  • Javascript 4.3.0, Python 3.14.0, Ruby 2.12.0, PHP 2.6.0, Go 3.13.0, Java 1.4.0 and .NET 0.22.0

The deleteChannels response contain a taskID which can be polled using the getTask endpoint to check the status of the deletions.

Truncating a Channel

Messages from a channel can be truncated. This will remove all of the messages but not affect the channel data or channel members. If you want to delete both channel and message data then use the deleteChannels method instead.

Truncate channel can be performed client-side or server-side. To use client-side, the user must have the TruncateChannel permission.

The default behavior is to hide messages when channel is truncated. To permanently delete messages, set the hard_delete option to true