Truncate a channel
Truncates a channel by removing all messages but keeping the channel metadata and members.
Optional flags allow you to perform a hard delete, add a system message, skip push notifications, and define the truncating user ID (for server-side calls).
stream-cli chat truncate-channel --type [channel-type] --id [channel-id] [flags]
# Truncate messages in 'general' channel of type messaging
$ stream-cli chat truncate-channel --type messaging --id general
# Truncate with hard delete and system message
$ stream-cli chat truncate-channel --type messaging --id general --hard --message "Channel reset" --user-id system-user
--hard [optional] Permanently delete messages instead of hiding them
-h, --help help for truncate-channel
-i, --id string [required] Channel ID
--message string [optional] System message to include in truncation (requires --message-user-id)
--message-user-id string [optional] User id for the message to include in truncation (required if --message is set)
--skip-push [optional] Skip push notifications
-t, --type string [required] Channel type such as 'messaging'
--user-id string [optional] User ID who performs the truncation
--app string [optional] Application name to use as it's defined in the configuration file
--config string [optional] Explicit config file path
- stream-cli chat - Allows you to interact with your Chat applications