Stream Chat icon

Stream Chat

Server-side Stream Chat operations

Moderation → Ban User

AI-generated

Summary

Ban a user globally on the Stream Chat platform with optional reason, timeout duration, and IP or user agent restrictions.

Inputs

  • Target User ID (required) — The unique identifier of the user to ban.
  • Reason — The reason for the ban action.
  • Timeout (Minutes) — Duration in minutes for which the user will be banned. Use a high value for permanent bans.
  • IP Address — An optional IP address to ban along with the user.
  • User Agent — An optional user agent to ban along with the user.

Output shape

a single JSON object containing the Stream Chat API response to the ban request

The output includes details of the ban action taken. Moderation changes may take a few seconds to propagate across Stream Chat servers.

Examples

Example 1: Ban user 'user123' for 60 minutes with reason 'Violation of rules'.

Set Target User ID to 'user123', Reason to 'Violation of rules', and Timeout to 60.

Discussion