action stream_io_api_ban { label: "Ban user" description: "Restricts user activity either in specific channel or globally" provider: stream_io_api method: POST path: "/moderation/ban" encoding: json input: { type: "object" required: ["target_user_id"] properties: { banned_by: { type: "object" description: "Represents chat user" required: ["id"] properties: { ban_expires: { type: "string" format: "date-time" description: "Expiration date of the ban" } banned: { type: "boolean" description: "Whether a user is banned or not" } id: { type: "string" description: "Unique user identifier" } invisible: { type: "boolean" } language: { type: "string" description: "Preferred language of a user" } push_notifications: { type: "object" properties: { disabled: { type: "boolean" } disabled_until: { type: "string" format: "date-time" } } } revoke_tokens_issued_before: { type: "string" format: "date-time" description: "Revocation date for tokens" } role: { type: "string" description: "Determines the set of user permissions" } teams: { type: "array" description: "List of teams user is a part of" items: { type: "string" } } } } banned_by_id: { type: "string" description: "User ID who issued a ban" } id: { type: "string" description: "Channel ID to ban user in" } ip_ban: { type: "boolean" description: "Whether to perform IP ban or not" } reason: { type: "string" description: "Ban reason" } shadow: { type: "boolean" description: "Whether to perform shadow ban or not" } target_user_id: { type: "string" description: "ID of user to ban" } timeout: { type: "number" description: "Timeout of ban in minutes. User will be unbanned after this period of time" } type: { type: "string" description: "Channel type to ban user in" } user: { type: "object" additionalProperties: true } user_id: { type: "string" } } } output: { type: "object" required: ["duration"] properties: { duration: { type: "string" description: "Duration of the request in human-readable format" } } } }