Modules for interacting with the moderation group of Stream APIs
API Reference: https://getstream.github.io/protocol/?urls.primaryName=Chat%20v2
Shared options
All functions in this module accept the following optional parameters:
api_key- API key to use. If not provided, the default key from config will be usedauthenticate_as_user- User id to authenticate. If not provided, the server key will be usedapi_key_secret- API key secret to use. If not provided, the default secret from config will be usedendpoint- endpoint to use. If not provided, the default endpoint from config will be usedclient- HTTP client to use. Must implementExStreamClient.Http.Behavior. Defaults toExStreamClient.Httpreq_opts- all of these options will be forwarded to req. SeeReq.new/1for available options
Summary
Functions
Appeal against the moderation decision
Ban a user from a channel or the entire app
Delete multiple moderation action config entries by UUID in a single request.
Moderate multiple images in bulk using a CSV file
Create or update multiple moderation action config entries in a single request. Omit the ID field to create; provide an ID to update.
Enable or disable moderation bypass for a user. This endpoint is server-side only.
Run moderation checks on the provided content
Verifies that the configured IAM role ARN can access private S3 images for moderation. Optionally accepts a stream+s3:// URL to check access to a specific object.
Custom check, add your own AI model reports to the review queue
Delete a specific moderation action config entry by its UUID.
Delete a specific moderation policy by its name
Delete an existing moderation rule
Flag any type of content (messages, users, channels, activities) for moderation review. Supports custom content types and additional metadata for flagged content.
Returns moderation action configs grouped by entity type, sorted by order ascending. Supports fetching DB-configured actions, hardcoded defaults, or both.
Retrieve a specific appeal item by its ID
Retrieve a specific moderation configuration by its key and team. This configuration contains settings for various moderation features like toxicity detection, AI analysis, and filtering rules.
Returns the number of moderation flags created against a specific user's content. Optionally filter by entity type.
Get a specific moderation rule by ID
Retrieve a specific review queue item by its ID
Insert a moderation action log entry. Server-side only. Used by product services to log moderation-related actions.
Run moderation on text and return labels
Mute a user. Mutes are generally not visible to the user you mute, while block is something you notice.
Query Appeals
Search and filter moderation label results with support for pagination and sorting. View the history of moderation labels applied to content.
Search and filter moderation configurations across your application. This endpoint is designed for building moderation dashboards and managing multiple configuration sets.
Query flags associated with moderation items. This is used for building a moderation dashboard.
Search and filter moderation action logs with support for pagination. View the history of moderation actions taken, including who performed them and when.
Search and filter moderation rules across your application. This endpoint is designed for building moderation dashboards and managing multiple rule sets.
Query review queue items allows you to filter the review queue items. This is used for building a moderation dashboard.
Take action on flagged content, such as marking content as safe, deleting content, banning users, or executing custom moderation actions. Supports various action types with configurable parameters.
Forward a moderator-supplied correction to the moderation feedback pipeline. Server-side only.
Unban a user from a channel or globally.
Unmute a user
Create a new moderation action config entry or update an existing one. Action configs control the action buttons displayed in the moderation dashboard for each entity type.
Create a new moderation configuration or update an existing one. Configure settings for content filtering, AI analysis, toxicity detection, and other moderation features.
Create or update a moderation rule that can apply app-wide or to specific moderation configs
Delete a specific moderation template by its name
Retrieve a list of feed moderation templates that define preset moderation rules and configurations. Limited to 100 templates per request.
Upsert feeds template for moderation
Types
Functions
@spec appeal(ExStreamClient.Model.AppealRequest.t(), shared_opts()) :: {:ok, ExStreamClient.Model.AppealResponse.t()} | {:error, any()}
Appeal against the moderation decision
Required Arguments:
Optional Arguments:
- All options from Shared Options are supported.
@spec ban(ExStreamClient.Model.BanRequest.t(), shared_opts()) :: {:ok, ExStreamClient.Model.BanResponse.t()} | {:error, any()}
Ban a user from a channel or the entire app
Required Arguments:
Optional Arguments:
- All options from Shared Options are supported.
@spec bulk_delete_action_config( ExStreamClient.Model.BulkDeleteActionConfigRequest.t(), shared_opts() ) :: {:ok, ExStreamClient.Model.BulkDeleteActionConfigResponse.t()} | {:error, any()}
Delete multiple moderation action config entries by UUID in a single request.
Required Arguments:
Optional Arguments:
- All options from Shared Options are supported.
@spec bulk_image_moderation( ExStreamClient.Model.BulkImageModerationRequest.t(), shared_opts() ) :: {:ok, ExStreamClient.Model.BulkImageModerationResponse.t()} | {:error, any()}
Moderate multiple images in bulk using a CSV file
Required Arguments:
Optional Arguments:
- All options from Shared Options are supported.
@spec bulk_upsert_action_config( ExStreamClient.Model.BulkUpsertActionConfigRequest.t(), shared_opts() ) :: {:ok, ExStreamClient.Model.BulkUpsertActionConfigResponse.t()} | {:error, any()}
Create or update multiple moderation action config entries in a single request. Omit the ID field to create; provide an ID to update.
Required Arguments:
Optional Arguments:
- All options from Shared Options are supported.
@spec bypass(ExStreamClient.Model.BypassRequest.t(), shared_opts()) :: {:ok, ExStreamClient.Model.BypassResponse.t()} | {:error, any()}
Enable or disable moderation bypass for a user. This endpoint is server-side only.
Required Arguments:
Optional Arguments:
- All options from Shared Options are supported.
@spec check(ExStreamClient.Model.CheckRequest.t(), shared_opts()) :: {:ok, ExStreamClient.Model.CheckResponse.t()} | {:error, any()}
Run moderation checks on the provided content
Required Arguments:
Optional Arguments:
- All options from Shared Options are supported.
@spec check_s3_access(ExStreamClient.Model.CheckS3AccessRequest.t(), shared_opts()) :: {:ok, ExStreamClient.Model.CheckS3AccessResponse.t()} | {:error, any()}
Verifies that the configured IAM role ARN can access private S3 images for moderation. Optionally accepts a stream+s3:// URL to check access to a specific object.
Required Arguments:
Optional Arguments:
- All options from Shared Options are supported.
@spec custom_check(ExStreamClient.Model.CustomCheckRequest.t(), shared_opts()) :: {:ok, ExStreamClient.Model.CustomCheckResponse.t()} | {:error, any()}
Custom check, add your own AI model reports to the review queue
Required Arguments:
Optional Arguments:
- All options from Shared Options are supported.
@spec delete_action_config(String.t(), [{:user_id, String.t()} | shared_opts()]) :: {:ok, ExStreamClient.Model.DeleteActionConfigResponse.t()} | {:error, any()}
Delete a specific moderation action config entry by its UUID.
Required Arguments:
id
Optional Arguments:
user_id- All options from Shared Options are supported.
@spec delete_config(String.t(), [ ({:user_id, String.t()} | {:team, String.t()}) | shared_opts() ]) :: {:ok, ExStreamClient.Model.DeleteModerationConfigResponse.t()} | {:error, any()}
Delete a specific moderation policy by its name
Required Arguments:
key
Optional Arguments:
teamuser_id- All options from Shared Options are supported.
@spec delete_moderation_rule(String.t(), [{:user_id, String.t()} | shared_opts()]) :: {:ok, ExStreamClient.Model.DeleteModerationRuleResponse.t()} | {:error, any()}
Delete an existing moderation rule
Required Arguments:
id
Optional Arguments:
user_id- All options from Shared Options are supported.
@spec flag(ExStreamClient.Model.FlagRequest.t(), shared_opts()) :: {:ok, ExStreamClient.Model.FlagResponse.t()} | {:error, any()}
Flag any type of content (messages, users, channels, activities) for moderation review. Supports custom content types and additional metadata for flagged content.
Required Arguments:
Optional Arguments:
- All options from Shared Options are supported.
@spec get_action_config([ ({:user_id, String.t()} | {:only_defaults, boolean()} | {:exclude_defaults, boolean()} | {:entity_type, String.t()} | {:queue_type, String.t()}) | shared_opts() ]) :: {:ok, ExStreamClient.Model.GetActionConfigResponse.t()} | {:error, any()}
Returns moderation action configs grouped by entity type, sorted by order ascending. Supports fetching DB-configured actions, hardcoded defaults, or both.
Optional Arguments:
entity_typeexclude_defaultsonly_defaultsqueue_typeuser_id- All options from Shared Options are supported.
@spec get_appeal(String.t(), shared_opts()) :: {:ok, ExStreamClient.Model.GetAppealResponse.t()} | {:error, any()}
Retrieve a specific appeal item by its ID
Required Arguments:
id
Optional Arguments:
- All options from Shared Options are supported.
@spec get_config(String.t(), [{:team, String.t()} | shared_opts()]) :: {:ok, ExStreamClient.Model.GetConfigResponse.t()} | {:error, any()}
Retrieve a specific moderation configuration by its key and team. This configuration contains settings for various moderation features like toxicity detection, AI analysis, and filtering rules.
Required Arguments:
key
Optional Arguments:
team- All options from Shared Options are supported.
@spec get_flag_count(ExStreamClient.Model.GetFlagCountRequest.t(), shared_opts()) :: {:ok, ExStreamClient.Model.GetFlagCountResponse.t()} | {:error, any()}
Returns the number of moderation flags created against a specific user's content. Optionally filter by entity type.
Required Arguments:
Optional Arguments:
- All options from Shared Options are supported.
@spec get_moderation_rule(String.t(), shared_opts()) :: {:ok, ExStreamClient.Model.GetModerationRuleResponse.t()} | {:error, any()}
Get a specific moderation rule by ID
Required Arguments:
id
Optional Arguments:
- All options from Shared Options are supported.
@spec get_review_queue_item(String.t(), shared_opts()) :: {:ok, ExStreamClient.Model.GetReviewQueueItemResponse.t()} | {:error, any()}
Retrieve a specific review queue item by its ID
Required Arguments:
id
Optional Arguments:
- All options from Shared Options are supported.
@spec insert_action_log( ExStreamClient.Model.InsertActionLogRequest.t(), shared_opts() ) :: {:ok, ExStreamClient.Model.InsertActionLogResponse.t()} | {:error, any()}
Insert a moderation action log entry. Server-side only. Used by product services to log moderation-related actions.
Required Arguments:
Optional Arguments:
- All options from Shared Options are supported.
@spec labels(ExStreamClient.Model.LabelsRequest.t(), shared_opts()) :: {:ok, ExStreamClient.Model.LabelsResponse.t()} | {:error, any()}
Run moderation on text and return labels
Required Arguments:
Optional Arguments:
- All options from Shared Options are supported.
@spec mute(ExStreamClient.Model.MuteRequest.t(), shared_opts()) :: {:ok, ExStreamClient.Model.MuteResponse.t()} | {:error, any()}
Mute a user. Mutes are generally not visible to the user you mute, while block is something you notice.
Required Arguments:
Optional Arguments:
- All options from Shared Options are supported.
@spec query_appeals(ExStreamClient.Model.QueryAppealsRequest.t(), shared_opts()) :: {:ok, ExStreamClient.Model.QueryAppealsResponse.t()} | {:error, any()}
Query Appeals
Required Arguments:
Optional Arguments:
- All options from Shared Options are supported.
@spec query_label_results( ExStreamClient.Model.QueryLabelResultsRequest.t(), shared_opts() ) :: {:ok, ExStreamClient.Model.QueryLabelResultsResponse.t()} | {:error, any()}
Search and filter moderation label results with support for pagination and sorting. View the history of moderation labels applied to content.
Required Arguments:
Optional Arguments:
- All options from Shared Options are supported.
@spec query_moderation_configs( ExStreamClient.Model.QueryModerationConfigsRequest.t(), shared_opts() ) :: {:ok, ExStreamClient.Model.QueryModerationConfigsResponse.t()} | {:error, any()}
Search and filter moderation configurations across your application. This endpoint is designed for building moderation dashboards and managing multiple configuration sets.
Required Arguments:
Optional Arguments:
- All options from Shared Options are supported.
@spec query_moderation_flags( ExStreamClient.Model.QueryModerationFlagsRequest.t(), shared_opts() ) :: {:ok, ExStreamClient.Model.QueryModerationFlagsResponse.t()} | {:error, any()}
Query flags associated with moderation items. This is used for building a moderation dashboard.
Required Arguments:
Optional Arguments:
- All options from Shared Options are supported.
@spec query_moderation_logs( ExStreamClient.Model.QueryModerationLogsRequest.t(), shared_opts() ) :: {:ok, ExStreamClient.Model.QueryModerationLogsResponse.t()} | {:error, any()}
Search and filter moderation action logs with support for pagination. View the history of moderation actions taken, including who performed them and when.
Required Arguments:
Optional Arguments:
- All options from Shared Options are supported.
@spec query_moderation_rules( ExStreamClient.Model.QueryModerationRulesRequest.t(), shared_opts() ) :: {:ok, ExStreamClient.Model.QueryModerationRulesResponse.t()} | {:error, any()}
Search and filter moderation rules across your application. This endpoint is designed for building moderation dashboards and managing multiple rule sets.
Required Arguments:
Optional Arguments:
- All options from Shared Options are supported.
@spec query_review_queue( ExStreamClient.Model.QueryReviewQueueRequest.t(), shared_opts() ) :: {:ok, ExStreamClient.Model.QueryReviewQueueResponse.t()} | {:error, any()}
Query review queue items allows you to filter the review queue items. This is used for building a moderation dashboard.
Required Arguments:
Optional Arguments:
- All options from Shared Options are supported.
@spec submit_action(ExStreamClient.Model.SubmitActionRequest.t(), shared_opts()) :: {:ok, ExStreamClient.Model.SubmitActionResponse.t()} | {:error, any()}
Take action on flagged content, such as marking content as safe, deleting content, banning users, or executing custom moderation actions. Supports various action types with configurable parameters.
Required Arguments:
Optional Arguments:
- All options from Shared Options are supported.
@spec submit_moderation_feedback( ExStreamClient.Model.SubmitModerationFeedbackRequest.t(), shared_opts() ) :: {:ok, ExStreamClient.Model.SubmitModerationFeedbackResponse.t()} | {:error, any()}
Forward a moderator-supplied correction to the moderation feedback pipeline. Server-side only.
Required Arguments:
Optional Arguments:
- All options from Shared Options are supported.
@spec unban(String.t(), ExStreamClient.Model.UnbanRequest.t(), [ ({:created_by, String.t()} | {:channel_cid, String.t()}) | shared_opts() ]) :: {:ok, ExStreamClient.Model.UnbanResponse.t()} | {:error, any()}
Unban a user from a channel or globally.
Required Arguments:
target_user_idpayload:Elixir.ExStreamClient.Model.UnbanRequest
Optional Arguments:
channel_cidcreated_by- All options from Shared Options are supported.
@spec unmute(ExStreamClient.Model.UnmuteRequest.t(), shared_opts()) :: {:ok, ExStreamClient.Model.UnmuteResponse.t()} | {:error, any()}
Unmute a user
Required Arguments:
Optional Arguments:
- All options from Shared Options are supported.
@spec upsert_action_config( ExStreamClient.Model.UpsertActionConfigRequest.t(), shared_opts() ) :: {:ok, ExStreamClient.Model.UpsertActionConfigResponse.t()} | {:error, any()}
Create a new moderation action config entry or update an existing one. Action configs control the action buttons displayed in the moderation dashboard for each entity type.
Required Arguments:
Optional Arguments:
- All options from Shared Options are supported.
@spec upsert_config(ExStreamClient.Model.UpsertConfigRequest.t(), shared_opts()) :: {:ok, ExStreamClient.Model.UpsertConfigResponse.t()} | {:error, any()}
Create a new moderation configuration or update an existing one. Configure settings for content filtering, AI analysis, toxicity detection, and other moderation features.
Required Arguments:
Optional Arguments:
- All options from Shared Options are supported.
@spec upsert_moderation_rule( ExStreamClient.Model.UpsertModerationRuleRequest.t(), shared_opts() ) :: {:ok, ExStreamClient.Model.UpsertModerationRuleResponse.t()} | {:error, any()}
Create or update a moderation rule that can apply app-wide or to specific moderation configs
Required Arguments:
Optional Arguments:
- All options from Shared Options are supported.
@spec v2_delete_template(shared_opts()) :: {:ok, ExStreamClient.Model.DeleteModerationTemplateResponse.t()} | {:error, any()}
Delete a specific moderation template by its name
Optional Arguments:
- All options from Shared Options are supported.
@spec v2_query_templates(shared_opts()) :: {:ok, ExStreamClient.Model.QueryFeedModerationTemplatesResponse.t()} | {:error, any()}
Retrieve a list of feed moderation templates that define preset moderation rules and configurations. Limited to 100 templates per request.
Optional Arguments:
- All options from Shared Options are supported.
@spec v2_upsert_template( ExStreamClient.Model.UpsertModerationTemplateRequest.t(), shared_opts() ) :: {:ok, ExStreamClient.Model.UpsertModerationTemplateResponse.t()} | {:error, any()}
Upsert feeds template for moderation
Required Arguments:
Optional Arguments:
- All options from Shared Options are supported.