Stream Chat icon

Stream Chat

Server-side Stream Chat operations

Channel → Truncate

AI-generated

Summary

Remove all messages from a specified Stream Chat channel, optionally using advanced truncation options.

Inputs

  • Channel Type — The type of the channel, e.g., "messaging" for 1-on-1 chats, "team" for group channels, or "livestream" for broadcast channels. Defaults to "messaging".
  • Channel ID (required) — Unique identifier for the channel to truncate (e.g., "general", "random", "team-alpha"). Combined with Channel Type to identify the channel.
  • Truncate Options — A JSON object specifying additional options for truncating the channel, such as {"hard_delete": true, "skip_push": false} to control deletion behavior and push notifications.

Output shape

a single JSON object representing the result of the truncate operation from the Stream Chat API

The output contains the API response confirming the truncation. If the operation fails, an error is returned. The truncate options JSON can customize the truncation process per Stream Chat API specification.

Discussion