---
title: "Query Banned Users"
method: GET
path: "/query_banned_users"
tags: ["Users", "Moderation"]
---

# Query Banned Users

`GET /query_banned_users`

Find and filter channel scoped or global user bans

## Response `200`

Successful response

- QueryBannedUsersResponse, nullable
  - `bans` BanResponse[], required
    - `banned_by` UserObject — Represents chat user
      - `ban_expires` string, date-time — Expiration date of the ban
      - `banned` boolean, required — Whether a user is banned or not
      - `created_at` string, date-time — Date/time of creation
      - `deactivated_at` string, date-time — Date of deactivation
      - `deleted_at` string, date-time — Date/time of deletion
      - `id` string, required — Unique user identifier
      - `invisible` boolean
      - `language` string — Preferred language of a user
      - `last_active` string, date-time — Date of last activity
      - `online` boolean, required — Whether a user online or not
      - `push_notifications` PushNotificationSettings
        - `disabled` boolean
        - `disabled_until` string, date-time
      - `revoke_tokens_issued_before` string, date-time — Revocation date for tokens
      - `role` string, required — Determines the set of user permissions
      - `teams` string[] — List of teams user is a part of
      - `updated_at` string, date-time — Date/time of the last update
    - `channel` ChannelResponse — Represents channel in chat
      - `auto_translation_enabled` boolean — Whether auto translation is enabled or not
      - `auto_translation_language` string — Language to translate to when auto translation is active
      - `cid` string, required — Channel CID (<type>:<id>)
      - `config` ChannelConfigWithInfo
        - `automod` 'disabled' | 'simple' | 'AI', required
        - `automod_behavior` 'flag' | 'block', required
        - `automod_thresholds` Thresholds — Sets thresholds for AI moderation
          - `explicit` LabelThresholds
            - `block` number, float — Threshold for automatic message block
            - `flag` number, float — Threshold for automatic message flag
          - `spam` LabelThresholds
            - `block` number, float — Threshold for automatic message block
            - `flag` number, float — Threshold for automatic message flag
          - `toxic` LabelThresholds
            - `block` number, float — Threshold for automatic message block
            - `flag` number, float — Threshold for automatic message flag
        - `blocklist` string
        - `blocklist_behavior` 'flag' | 'block'
        - `commands` Command[], required
          - `args` string, required — Arguments help text, shown in commands auto-completion
          - `created_at` string, date-time — Date/time of creation
          - `description` string, required — Description, shown in commands auto-completion
          - `name` string, required — Unique command name
          - `set` string, required — Set name used for grouping commands
          - `updated_at` string, date-time — Date/time of the last update
        - `connect_events` boolean, required
        - `created_at` string, date-time, required
        - `custom_events` boolean, required
        - `grants` object
        - `max_message_length` number, required
        - `message_retention` string, required
        - `mutes` boolean, required
        - `name` string, required
        - `push_notifications` boolean, required
        - `quotes` boolean, required
        - `reactions` boolean, required
        - `read_events` boolean, required
        - `reminders` boolean, required
        - `replies` boolean, required
        - `search` boolean, required
        - `typing_events` boolean, required
        - `updated_at` string, date-time, required
        - `uploads` boolean, required
        - `url_enrichment` boolean, required
      - `cooldown` number — Cooldown period after sending each message
      - `created_at` string, date-time — Date/time of creation
      - `created_by` UserObject — Represents chat user
        - `ban_expires` string, date-time — Expiration date of the ban
        - `banned` boolean, required — Whether a user is banned or not
        - `created_at` string, date-time — Date/time of creation
        - `deactivated_at` string, date-time — Date of deactivation
        - `deleted_at` string, date-time — Date/time of deletion
        - `id` string, required — Unique user identifier
        - `invisible` boolean
        - `language` string — Preferred language of a user
        - `last_active` string, date-time — Date of last activity
        - `online` boolean, required — Whether a user online or not
        - `push_notifications` PushNotificationSettings
          - `disabled` boolean
          - `disabled_until` string, date-time
        - `revoke_tokens_issued_before` string, date-time — Revocation date for tokens
        - `role` string, required — Determines the set of user permissions
        - `teams` string[] — List of teams user is a part of
        - `updated_at` string, date-time — Date/time of the last update
      - `deleted_at` string, date-time — Date/time of deletion
      - `disabled` boolean, required
      - `frozen` boolean, required — Whether channel is frozen or not
      - `hidden` boolean — Whether this channel is hidden by current user or not
      - `hide_messages_before` string, date-time — Date since when the message history is accessible
      - `id` string, required — Channel unique ID
      - `last_message_at` string, date-time — Date of the last message sent
      - `member_count` number — Number of members in the channel
      - `members` ChannelMember[] — List of channel members (max 100)
        - `ban_expires` string, date-time — Expiration date of the ban
        - `banned` boolean, required — Whether member is banned this channel or not
        - `channel_role` string, required — Role of the member in the channel
        - `created_at` string, date-time, required — Date/time of creation
        - `deleted_at` string, date-time
        - `invite_accepted_at` string, date-time — Date when invite was accepted
        - `invite_rejected_at` string, date-time — Date when invite was rejected
        - `invited` boolean — Whether member was invited or not
        - `is_moderator` boolean — Whether member is channel moderator or not
        - `role` 'member' | 'moderator' | 'admin' | 'owner' — Permission level of the member in the channel (DEPRECATED: use channel_role instead)
        - `shadow_banned` boolean, required — Whether member is shadow banned in this channel or not
        - `updated_at` string, date-time, required — Date/time of the last update
        - `user` UserObject — Represents chat user
          - `ban_expires` string, date-time — Expiration date of the ban
          - `banned` boolean, required — Whether a user is banned or not
          - `created_at` string, date-time — Date/time of creation
          - `deactivated_at` string, date-time — Date of deactivation
          - `deleted_at` string, date-time — Date/time of deletion
          - `id` string, required — Unique user identifier
          - `invisible` boolean
          - `language` string — Preferred language of a user
          - `last_active` string, date-time — Date of last activity
          - `online` boolean, required — Whether a user online or not
          - `push_notifications` PushNotificationSettings
            - `disabled` boolean
            - `disabled_until` string, date-time
          - `revoke_tokens_issued_before` string, date-time — Revocation date for tokens
          - `role` string, required — Determines the set of user permissions
          - `teams` string[] — List of teams user is a part of
          - `updated_at` string, date-time — Date/time of the last update
        - `user_id` string
      - `mute_expires_at` string, date-time — Date of mute expiration
      - `muted` boolean — Whether this channel is muted or not
      - `own_capabilities` string[] — List of channel capabilities of authenticated user
      - `team` string — Team the channel belongs to (multi-tenant only)
      - `truncated_at` string, date-time — Date of the latest truncation of the channel
      - `truncated_by` UserObject — Represents chat user
        - `ban_expires` string, date-time — Expiration date of the ban
        - `banned` boolean, required — Whether a user is banned or not
        - `created_at` string, date-time — Date/time of creation
        - `deactivated_at` string, date-time — Date of deactivation
        - `deleted_at` string, date-time — Date/time of deletion
        - `id` string, required — Unique user identifier
        - `invisible` boolean
        - `language` string — Preferred language of a user
        - `last_active` string, date-time — Date of last activity
        - `online` boolean, required — Whether a user online or not
        - `push_notifications` PushNotificationSettings
          - `disabled` boolean
          - `disabled_until` string, date-time
        - `revoke_tokens_issued_before` string, date-time — Revocation date for tokens
        - `role` string, required — Determines the set of user permissions
        - `teams` string[] — List of teams user is a part of
        - `updated_at` string, date-time — Date/time of the last update
      - `type` string, required — Type of the channel
      - `updated_at` string, date-time — Date/time of the last update
    - `created_at` string, date-time, required
    - `expires` string, date-time
    - `reason` string
    - `shadow` boolean
    - `user` UserObject — Represents chat user
      - `ban_expires` string, date-time — Expiration date of the ban
      - `banned` boolean, required — Whether a user is banned or not
      - `created_at` string, date-time — Date/time of creation
      - `deactivated_at` string, date-time — Date of deactivation
      - `deleted_at` string, date-time — Date/time of deletion
      - `id` string, required — Unique user identifier
      - `invisible` boolean
      - `language` string — Preferred language of a user
      - `last_active` string, date-time — Date of last activity
      - `online` boolean, required — Whether a user online or not
      - `push_notifications` PushNotificationSettings
        - `disabled` boolean
        - `disabled_until` string, date-time
      - `revoke_tokens_issued_before` string, date-time — Revocation date for tokens
      - `role` string, required — Determines the set of user permissions
      - `teams` string[] — List of teams user is a part of
      - `updated_at` string, date-time — Date/time of the last update
  - `duration` string, required — Duration of the request in human-readable format

## Other responses

- `400` — Bad request
- `429` — Too many requests

---

[API](https://skmtc.net/streamioapi/apis/stream-io-api.md) · [All operations](https://skmtc.net/streamioapi/apis/stream-io-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/streamioapi/stream-io-api/versions/f5553620777b/schema)
