Appearance
Moderation
About 11066 wordsAbout 37 min
Python SDK - Feeds API
Table of Contents
- insert_action_log
- appeal
- get_appeal
- query_appeals
- ban
- bulk_image_moderation
- bypass
- check
- check_s3_access
- upsert_config
- get_config
- delete_config
- query_moderation_configs
- custom_check
- v2_query_templates
- v2_upsert_template
- v2_delete_template
- flag
- get_flag_count
- query_moderation_flags
- query_moderation_logs
- upsert_moderation_rule
- get_moderation_rule
- delete_moderation_rule
- query_moderation_rules
- mute
- query_review_queue
- get_review_queue_item
- submit_action
- unban
- unmute
- Types Reference
insert_action_log
Records a moderation action into the log, useful for tracking and auditing moderation activities performed on the platform.
Example
from getstream import Stream
client = Stream(api_key=api_key, api_secret=api_secret)
# Insert moderation action log
response = client.feeds.insert_action_log(
action_type="value",
entity_creator_id="value",
entity_id="value",
entity_type="value",
custom={},
reason="value"
)
print(response)Response: InsertActionLogResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| action_type | str | Yes | Type of moderation action taken |
| entity_creator_id | str | Yes | ID of the user who created the entity |
| entity_id | str | Yes | ID of the entity the action was taken on |
| entity_type | str | Yes | Type of entity the action was taken on |
| custom | dict | No | Custom metadata for the action log |
| reason | str | No | Reason for the action |
appeal
Submit a request to review and potentially overturn a moderation decision; use this when you believe a moderation action was taken in error.
Example
from getstream import Stream
client = Stream(api_key=api_key, api_secret=api_secret)
# Appeal against the moderation decision
response = client.feeds.appeal(
appeal_reason="value",
entity_id="value",
entity_type="value",
user_id="john",
user={"id": "activity-123", "custom": {}}
)
print(response)Example: with attachments
from getstream import Stream
client = Stream(api_key=api_key, api_secret=api_secret)
# Appeal against the moderation decision
response = client.feeds.appeal(
appeal_reason="value",
entity_id="value",
entity_type="value",
attachments=[]
)
print(response)Response: AppealResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| appeal_reason | str | Yes | Explanation for why the content is being appealed |
| entity_id | str | Yes | Unique identifier of the entity being appealed |
| entity_type | str | Yes | Type of entity being appealed (e.g., message, user) |
| attachments | []string | No | Array of Attachment URLs(e.g., images) |
| user | UserRequest | No | - |
| user_id | str | No | - |
get_appeal
Retrieve details about a specific appeal, allowing you to track the status and outcome of your request for review.
Example
from getstream import Stream
client = Stream(api_key=api_key, api_secret=api_secret)
# Get appeal item
response = client.feeds.get_appeal(
id="activity-123"
)
print(response)Response: GetAppealResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | str | Yes | - |
query_appeals
Search and filter through multiple appeals to manage and assess ongoing or past moderation challenges effectively.
Example
from getstream import Stream
client = Stream(api_key=api_key, api_secret=api_secret)
# Query Appeals
response = client.feeds.query_appeals(
user_id="john",
limit=25,
filter={}
)
print(response)Example: with sort and next
from getstream import Stream
client = Stream(api_key=api_key, api_secret=api_secret)
# Query Appeals
response = client.feeds.query_appeals(
sort=[],
next=None
)
print(response)Example: with user and prev
from getstream import Stream
client = Stream(api_key=api_key, api_secret=api_secret)
# Query Appeals
response = client.feeds.query_appeals(
user={"id": "activity-123", "custom": {}},
prev=None
)
print(response)Response: QueryAppealsResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| filter | dict | No | Filter conditions for appeals |
| limit | int | No | - |
| next | str | No | - |
| prev | str | No | - |
| sort | []SortParamRequest | No | Sorting parameters for appeals |
| user | UserRequest | No | - |
| user_id | str | No | - |
ban
Restrict a user from accessing services or content, useful when enforcing community guidelines and maintaining a safe environment.
Example
from getstream import Stream
client = Stream(api_key=api_key, api_secret=api_secret)
# Ban
response = client.feeds.ban(
target_user_id="value",
banned_by={"id": "activity-123", "custom": {}},
banned_by_id="value"
)
print(response)Example: with channel_cid and delete_messages
from getstream import Stream
client = Stream(api_key=api_key, api_secret=api_secret)
# Ban
response = client.feeds.ban(
target_user_id="value",
channel_cid="value",
delete_messages="value"
)
print(response)Example: with ip_ban and reason
from getstream import Stream
client = Stream(api_key=api_key, api_secret=api_secret)
# Ban
response = client.feeds.ban(
target_user_id="value",
ip_ban=False,
reason="value"
)
print(response)Example: with shadow and timeout
from getstream import Stream
client = Stream(api_key=api_key, api_secret=api_secret)
# Ban
response = client.feeds.ban(
target_user_id="value",
shadow=False,
timeout=10
)
print(response)Response: BanResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| target_user_id | str | Yes | ID of the user to ban |
| banned_by | UserRequest | No | Details about the user performing the ban |
| banned_by_id | str | No | ID of the user performing the ban |
| channel_cid | str | No | Channel where the ban applies |
| delete_messages | str | No | - |
| ip_ban | bool | No | Whether to ban the user's IP address |
| reason | str | No | Optional explanation for the ban |
| shadow | bool | No | Whether this is a shadow ban |
| timeout | int | No | Duration of the ban in minutes |
bulk_image_moderation
Process multiple images simultaneously for content compliance, ideal for efficiently managing large batches of visual content.
Example
from getstream import Stream
client = Stream(api_key=api_key, api_secret=api_secret)
# Bulk image moderation
response = client.feeds.bulk_image_moderation(
csv_file="value"
)
print(response)Response: BulkImageModerationResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| csv_file | str | Yes | URL to CSV file containing image URLs to moderate |
bypass
Allows a specific content or user to bypass moderation checks, typically used in scenarios where trusted entities need uninterrupted access.
Example
from getstream import Stream
client = Stream(api_key=api_key, api_secret=api_secret)
# Bypass Moderation
response = client.feeds.bypass(
enabled=False,
target_user_id="value"
)
print(response)Response: BypassResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| enabled | bool | Yes | Whether to enable moderation bypass for this user |
| target_user_id | str | Yes | ID of the user to update |
check
Evaluate content against moderation policies to ensure compliance, used to verify that user-generated content adheres to community standards.
Example
from getstream import Stream
client = Stream(api_key=api_key, api_secret=api_secret)
# Check
response = client.feeds.check(
entity_creator_id="value",
entity_id="value",
entity_type="value",
user_id="john",
config_key="value"
)
print(response)Example: with config_team and content_published_at
from getstream import Stream
client = Stream(api_key=api_key, api_secret=api_secret)
# Check
response = client.feeds.check(
entity_creator_id="value",
entity_id="value",
entity_type="value",
config_team="value",
content_published_at=10
)
print(response)Example: with moderation_payload and options
from getstream import Stream
client = Stream(api_key=api_key, api_secret=api_secret)
# Check
response = client.feeds.check(
entity_creator_id="value",
entity_id="value",
entity_type="value",
moderation_payload={"custom": {}},
options={}
)
print(response)Example: with test_mode and user
from getstream import Stream
client = Stream(api_key=api_key, api_secret=api_secret)
# Check
response = client.feeds.check(
entity_creator_id="value",
entity_id="value",
entity_type="value",
test_mode=False,
user={"id": "activity-123", "custom": {}}
)
print(response)Response: CheckResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| entity_creator_id | str | Yes | ID of the user who created the entity |
| entity_id | str | Yes | Unique identifier of the entity to moderate |
| entity_type | str | Yes | Type of entity to moderate |
| config | ModerationConfig | No | Custom moderation configuration (test mode only) |
| config_key | str | No | Key of the moderation configuration to use |
| config_team | str | No | Team associated with the configuration |
| content_published_at | float | No | Original timestamp when the content was produced (for correlating flagged content with source vid... |
| moderation_payload | ModerationPayload | No | Content to be moderated |
| options | dict | No | Additional moderation configuration options |
| test_mode | bool | No | Whether to run moderation in test mode |
| user | UserRequest | No | - |
| user_id | str | No | - |
check_s3_access
Verifies if an image stored in Amazon S3 is accessible, ensuring that media files are correctly permissioned and available for use.
Example
from getstream import Stream
client = Stream(api_key=api_key, api_secret=api_secret)
# Check S3 image access
response = client.feeds.check_s3_access(
s3_url="value"
)
print(response)Response: CheckS3AccessResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| s3_url | str | No | Optional stream+s3:// reference to test access against |
upsert_config
Create or update rules for content moderation, enabling customization and refinement of moderation strategies to suit specific needs.
Example
from getstream import Stream
client = Stream(api_key=api_key, api_secret=api_secret)
# Create or update moderation configuration
response = client.feeds.upsert_config(
key="value",
user_id="john",
ai_text_config={"async": False}
)
print(response)Example: with ai_video_config and async
from getstream import Stream
client = Stream(api_key=api_key, api_secret=api_secret)
# Create or update moderation configuration
response = client.feeds.upsert_config(
key="value",
ai_video_config={"async": False},
async=False
)
print(response)Example: with automod_platform_circumvention_config and automod_semantic_filters_config
from getstream import Stream
client = Stream(api_key=api_key, api_secret=api_secret)
# Create or update moderation configuration
response = client.feeds.upsert_config(
key="value",
automod_platform_circumvention_config={"async": False},
automod_semantic_filters_config={"async": False}
)
print(response)Example: with automod_toxicity_config and aws_rekognition_config
from getstream import Stream
client = Stream(api_key=api_key, api_secret=api_secret)
# Create or update moderation configuration
response = client.feeds.upsert_config(
key="value",
automod_toxicity_config={"async": False},
aws_rekognition_config={"async": False}
)
print(response)Response: UpsertConfigResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| key | str | Yes | Unique identifier for the moderation configuration |
| ai_image_config | AIImageConfig | No | Configuration for AI image analysis |
| ai_text_config | AITextConfig | No | Configuration for AI text analysis |
| ai_video_config | AIVideoConfig | No | Configuration for AI video analysis |
| async | bool | No | Whether moderation should be performed asynchronously |
| automod_platform_circumvention_config | AutomodPlatformCircumventionConfig | No | Configuration for platform circumvention detection |
| automod_semantic_filters_config | AutomodSemanticFiltersConfig | No | Configuration for semantic filtering |
| automod_toxicity_config | AutomodToxicityConfig | No | Configuration for toxicity detection |
| aws_rekognition_config | AIImageConfig | No | - |
| block_list_config | BlockListConfig | No | Configuration for block list filtering |
| bodyguard_config | AITextConfig | No | - |
| google_vision_config | GoogleVisionConfig | No | Configuration for Google Vision integration |
| llm_config | LLMConfig | No | Configuration for customer-configured LLM moderation |
| rule_builder_config | RuleBuilderConfig | No | Configuration for custom rule builder (max 3 rules, max 5 conditions per rule) |
| team | str | No | Team associated with the configuration |
| user | UserRequest | No | - |
| user_id | str | No | Optional user ID to associate with the audit log entry |
| velocity_filter_config | VelocityFilterConfig | No | Configuration for velocity-based filtering |
| video_call_rule_config | VideoCallRuleConfig | No | - |
get_config
Access the current configuration settings for moderation, allowing you to review and understand the active rules and policies.
Example
from getstream import Stream
client = Stream(api_key=api_key, api_secret=api_secret)
# Get moderation configuration
response = client.feeds.get_config(
key="value",
team="value"
)
print(response)Response: GetConfigResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| key | str | Yes | - |
| team | str | No | - |
delete_config
Remove an existing moderation policy, useful for retiring outdated rules or simplifying moderation strategies.
Example
from getstream import Stream
client = Stream(api_key=api_key, api_secret=api_secret)
# Delete a moderation policy
response = client.feeds.delete_config(
key="value",
user_id="john",
team="value"
)
print(response)Response: DeleteModerationConfigResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| key | str | Yes | - |
| team | str | No | - |
| user_id | str | No | - |
query_moderation_configs
Search through various moderation configurations to compare, audit, or manage different policy setups efficiently.
Example
from getstream import Stream
client = Stream(api_key=api_key, api_secret=api_secret)
# Query moderation configurations
response = client.feeds.query_moderation_configs(
user_id="john",
limit=25,
filter={}
)
print(response)Example: with sort and next
from getstream import Stream
client = Stream(api_key=api_key, api_secret=api_secret)
# Query moderation configurations
response = client.feeds.query_moderation_configs(
sort=[],
next=None
)
print(response)Example: with user and prev
from getstream import Stream
client = Stream(api_key=api_key, api_secret=api_secret)
# Query moderation configurations
response = client.feeds.query_moderation_configs(
user={"id": "activity-123", "custom": {}},
prev=None
)
print(response)Response: QueryModerationConfigsResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| filter | dict | No | Filter conditions for moderation configs |
| limit | int | No | - |
| next | str | No | - |
| prev | str | No | - |
| sort | []SortParamRequest | No | Sorting parameters for the results |
| user | UserRequest | No | - |
| user_id | str | No | - |
custom_check
Performs a custom check on content to determine if it adheres to specific moderation criteria, useful for applying tailored moderation rules to unique content types.
Example
from getstream import Stream
client = Stream(api_key=api_key, api_secret=api_secret)
# Custom check endpoint
response = client.feeds.custom_check(
entity_id="value",
entity_type="value",
flags=[],
user_id="john",
moderation_payload={"custom": {}}
)
print(response)Example: with user and entity_creator_id
from getstream import Stream
client = Stream(api_key=api_key, api_secret=api_secret)
# Custom check endpoint
response = client.feeds.custom_check(
entity_id="value",
entity_type="value",
flags=[],
user={"id": "activity-123", "custom": {}},
entity_creator_id="value"
)
print(response)Response: CustomCheckResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| entity_id | str | Yes | Unique identifier of the entity |
| entity_type | str | Yes | Type of entity to perform custom check on |
| flags | []CustomCheckFlag | Yes | List of custom check flags (1-10 flags required) |
| entity_creator_id | str | No | ID of the user who created the entity (required for non-message entities) |
| moderation_payload | ModerationPayloadRequest | No | Content to be checked (required for non-message entities) |
| user | UserRequest | No | - |
| user_id | str | No | - |
v2_query_templates
Retrieves a list of available moderation templates, helping users to understand and select predefined moderation criteria that can be applied to their content.
Example
from getstream import Stream
client = Stream(api_key=api_key, api_secret=api_secret)
# Query feed moderation templates
response = client.feeds.v2_query_templates()
print(response)Response: QueryFeedModerationTemplatesResponse
v2_upsert_template
Creates or updates a moderation template, allowing users to define or modify the criteria used for evaluating content across feeds.
Example
from getstream import Stream
client = Stream(api_key=api_key, api_secret=api_secret)
# Upsert feeds template
response = client.feeds.v2_upsert_template(
config={"data_types": {}, "config_key": "value"},
name="My Feed"
)
print(response)Response: UpsertModerationTemplateResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| config | FeedsModerationTemplateConfigPayload | Yes | Configuration for the moderation template |
| name | str | Yes | Name of the moderation template |
v2_delete_template
Removes a specified moderation template, enabling users to manage and streamline the moderation criteria available for content evaluation.
Example
from getstream import Stream
client = Stream(api_key=api_key, api_secret=api_secret)
# Delete a moderation template
response = client.feeds.v2_delete_template()
print(response)Response: DeleteModerationTemplateResponse
flag
Marks content for moderation review, allowing users to identify and address potentially inappropriate or harmful content within their feeds.
Example
from getstream import Stream
client = Stream(api_key=api_key, api_secret=api_secret)
# Flag content for moderation
response = client.feeds.flag(
entity_id="value",
entity_type="value",
user_id="john",
entity_creator_id="value"
)
print(response)Example: with moderation_payload and reason
from getstream import Stream
client = Stream(api_key=api_key, api_secret=api_secret)
# Flag content for moderation
response = client.feeds.flag(
entity_id="value",
entity_type="value",
moderation_payload={"custom": {}},
reason="value"
)
print(response)Example: with user and custom
from getstream import Stream
client = Stream(api_key=api_key, api_secret=api_secret)
# Flag content for moderation
response = client.feeds.flag(
entity_id="value",
entity_type="value",
user={"id": "activity-123", "custom": {}},
custom={}
)
print(response)Response: FlagResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| entity_id | str | Yes | Unique identifier of the entity being flagged |
| entity_type | str | Yes | Type of entity being flagged (e.g., message, user) |
| custom | dict | No | Additional metadata about the flag |
| entity_creator_id | str | No | ID of the user who created the flagged entity |
| moderation_payload | ModerationPayload | No | Content being flagged |
| reason | str | No | Optional explanation for why the content is being flagged |
| user | UserRequest | No | - |
| user_id | str | No | - |
get_flag_count
Retrieves the total number of flags raised against a user, enabling moderation teams to assess user behavior and identify potential issues.
Example
from getstream import Stream
client = Stream(api_key=api_key, api_secret=api_secret)
# Get flag count for a user
response = client.feeds.get_flag_count(
entity_creator_id="value",
entity_type="value"
)
print(response)Response: GetFlagCountResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| entity_creator_id | str | Yes | ID of the user whose content was flagged |
| entity_type | str | No | Optional entity type filter (e.g., stream:chat:v1:message, stream:user) |
query_moderation_flags
Fetches a list of content that has been flagged for moderation, assisting users in monitoring and reviewing items that may breach community standards.
Example
from getstream import Stream
client = Stream(api_key=api_key, api_secret=api_secret)
# Query moderation flags
response = client.feeds.query_moderation_flags(
limit=25,
filter={},
sort=[]
)
print(response)Example: with prev and next
from getstream import Stream
client = Stream(api_key=api_key, api_secret=api_secret)
# Query moderation flags
response = client.feeds.query_moderation_flags(
prev=None,
next=None
)
print(response)Response: QueryModerationFlagsResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| filter | dict | No | - |
| limit | int | No | - |
| next | str | No | - |
| prev | str | No | - |
| sort | []SortParamRequest | No | - |
query_moderation_logs
Provides access to logs of moderation actions taken, offering users transparency and the ability to audit past moderation decisions and activities.
Example
from getstream import Stream
client = Stream(api_key=api_key, api_secret=api_secret)
# Query moderation action logs
response = client.feeds.query_moderation_logs(
user_id="john",
limit=25,
filter={}
)
print(response)Example: with sort and next
from getstream import Stream
client = Stream(api_key=api_key, api_secret=api_secret)
# Query moderation action logs
response = client.feeds.query_moderation_logs(
sort=[],
next=None
)
print(response)Example: with user and prev
from getstream import Stream
client = Stream(api_key=api_key, api_secret=api_secret)
# Query moderation action logs
response = client.feeds.query_moderation_logs(
user={"id": "activity-123", "custom": {}},
prev=None
)
print(response)Response: QueryModerationLogsResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| filter | dict | No | Filter conditions for moderation logs |
| limit | int | No | - |
| next | str | No | - |
| prev | str | No | - |
| sort | []SortParamRequest | No | Sorting parameters for the results |
| user | UserRequest | No | - |
| user_id | str | No | - |
upsert_moderation_rule
Creates or updates a specific moderation rule, enabling users to customize the criteria used to assess and manage content within their platform.
Example
from getstream import Stream
client = Stream(api_key=api_key, api_secret=api_secret)
# Upsert moderation rule
response = client.feeds.upsert_moderation_rule(
name="My Feed",
rule_type="value",
user_id="john",
action_sequences=[]
)
print(response)Example: with conditions and config_keys
from getstream import Stream
client = Stream(api_key=api_key, api_secret=api_secret)
# Upsert moderation rule
response = client.feeds.upsert_moderation_rule(
name="My Feed",
rule_type="value",
conditions=[],
config_keys=[]
)
print(response)Example: with cooldown_period and description
from getstream import Stream
client = Stream(api_key=api_key, api_secret=api_secret)
# Upsert moderation rule
response = client.feeds.upsert_moderation_rule(
name="My Feed",
rule_type="value",
cooldown_period="value",
description="A description"
)
print(response)Example: with enabled and groups
from getstream import Stream
client = Stream(api_key=api_key, api_secret=api_secret)
# Upsert moderation rule
response = client.feeds.upsert_moderation_rule(
name="My Feed",
rule_type="value",
enabled=False,
groups=[]
)
print(response)Response: UpsertModerationRuleResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| name | str | Yes | Unique rule name |
| rule_type | str | Yes | Type of rule: user, content, or call |
| action | RuleBuilderAction | No | Action for user/content rules |
| action_sequences | []CallRuleActionSequence | No | Escalation sequences for call rules |
| conditions | []RuleBuilderCondition | No | Flat list of conditions (legacy) |
| config_keys | []string | No | List of config keys this rule applies to |
| cooldown_period | str | No | Duration before rule can trigger again (e.g. 24h, 7d) |
| description | str | No | Optional description of the rule |
| enabled | bool | No | Whether the rule is active |
| groups | []RuleBuilderConditionGroup | No | Nested condition groups |
| logic | str | No | Logical operator between conditions/groups: AND or OR |
| team | str | No | Team scope for the rule |
| user | UserRequest | No | - |
| user_id | str | No | Optional user ID to associate with the audit log entry |
get_moderation_rule
Retrieves details of a specified moderation rule, helping users to review and understand the criteria applied to content moderation processes.
Example
from getstream import Stream
client = Stream(api_key=api_key, api_secret=api_secret)
# Get moderation rule
response = client.feeds.get_moderation_rule()
print(response)Response: GetModerationRuleResponse
delete_moderation_rule
Removes a specified moderation rule, allowing users to adjust and refine the moderation criteria in use by eliminating obsolete or unnecessary rules.
Example
from getstream import Stream
client = Stream(api_key=api_key, api_secret=api_secret)
# Delete moderation rule
response = client.feeds.delete_moderation_rule(
user_id="john"
)
print(response)Response: DeleteModerationRuleResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| user_id | str | No | - |
query_moderation_rules
Retrieve the current set of moderation rules to understand the guidelines and criteria used for moderating content. Use this method to ensure compliance with moderation standards or to inform users of the rules.
Example
from getstream import Stream
client = Stream(api_key=api_key, api_secret=api_secret)
# Query moderation rules
response = client.feeds.query_moderation_rules(
user_id="john",
limit=25,
filter={}
)
print(response)Example: with sort and next
from getstream import Stream
client = Stream(api_key=api_key, api_secret=api_secret)
# Query moderation rules
response = client.feeds.query_moderation_rules(
sort=[],
next=None
)
print(response)Example: with user and prev
from getstream import Stream
client = Stream(api_key=api_key, api_secret=api_secret)
# Query moderation rules
response = client.feeds.query_moderation_rules(
user={"id": "activity-123", "custom": {}},
prev=None
)
print(response)Response: QueryModerationRulesResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| filter | dict | No | Filter conditions for moderation rules |
| limit | int | No | - |
| next | str | No | - |
| prev | str | No | - |
| sort | []SortParamRequest | No | Sorting parameters for the results |
| user | UserRequest | No | - |
| user_id | str | No | - |
mute
Temporarily silence a user to prevent them from posting or interacting on the platform for a specific duration. Utilize this method to manage disruptive behavior without permanently banning the user.
Example
from getstream import Stream
client = Stream(api_key=api_key, api_secret=api_secret)
# Mute
response = client.feeds.mute(
target_ids=[],
user_id="john",
user={"id": "activity-123", "custom": {}}
)
print(response)Example: with timeout
from getstream import Stream
client = Stream(api_key=api_key, api_secret=api_secret)
# Mute
response = client.feeds.mute(
target_ids=[],
timeout=10
)
print(response)Response: MuteResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| target_ids | []string | Yes | User IDs to mute (if multiple users) |
| timeout | int | No | Duration of mute in minutes |
| user | UserRequest | No | - |
| user_id | str | No | - |
query_review_queue
Access a list of content items pending review to manage and prioritize moderation tasks efficiently. Use this method to streamline the review process and address potential issues in a timely manner.
Example
from getstream import Stream
client = Stream(api_key=api_key, api_secret=api_secret)
# Query review queue items
response = client.feeds.query_review_queue(
user_id="john",
limit=25,
filter={}
)
print(response)Example: with sort and lock_items
from getstream import Stream
client = Stream(api_key=api_key, api_secret=api_secret)
# Query review queue items
response = client.feeds.query_review_queue(
sort=[],
lock_items=False
)
print(response)Example: with next and prev
from getstream import Stream
client = Stream(api_key=api_key, api_secret=api_secret)
# Query review queue items
response = client.feeds.query_review_queue(
next=None,
prev=None
)
print(response)Example: with lock_count and stats_only
from getstream import Stream
client = Stream(api_key=api_key, api_secret=api_secret)
# Query review queue items
response = client.feeds.query_review_queue(
lock_count=10,
stats_only=False
)
print(response)Response: QueryReviewQueueResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| filter | dict | No | Filter conditions for review queue items |
| limit | int | No | - |
| lock_count | int | No | Number of items to lock (1-25) |
| lock_duration | int | No | Duration for which items should be locked |
| lock_items | bool | No | Whether to lock items for review (true), unlock items (false), or just fetch (nil) |
| next | str | No | - |
| prev | str | No | - |
| sort | []SortParamRequest | No | Sorting parameters for the results |
| stats_only | bool | No | Whether to return only statistics |
| user | UserRequest | No | - |
| user_id | str | No | - |
get_review_queue_item
Retrieve detailed information about a specific item in the review queue to make informed moderation decisions. Employ this method when you need to assess an individual piece of content thoroughly.
Example
from getstream import Stream
client = Stream(api_key=api_key, api_secret=api_secret)
# Get review queue item
response = client.feeds.get_review_queue_item(
id="activity-123"
)
print(response)Response: GetReviewQueueItemResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | str | Yes | - |
submit_action
Execute a moderation action, such as approving or rejecting content, based on the review outcome. Use this method to enforce moderation decisions and maintain community standards.
Example
from getstream import Stream
client = Stream(api_key=api_key, api_secret=api_secret)
# Submit moderation action
response = client.feeds.submit_action(
action_type="value",
user_id="john",
ban={"ban_from_future_channels": False}
)
print(response)Example: with block and bypass
from getstream import Stream
client = Stream(api_key=api_key, api_secret=api_secret)
# Submit moderation action
response = client.feeds.submit_action(
action_type="value",
block={"reason": "value"},
bypass={"enabled": False}
)
print(response)Example: with custom and delete_activity
from getstream import Stream
client = Stream(api_key=api_key, api_secret=api_secret)
# Submit moderation action
response = client.feeds.submit_action(
action_type="value",
custom={"id": "activity-123"},
delete_activity={"entity_id": "value"}
)
print(response)Example: with delete_comment and delete_message
from getstream import Stream
client = Stream(api_key=api_key, api_secret=api_secret)
# Submit moderation action
response = client.feeds.submit_action(
action_type="value",
delete_comment={"entity_id": "value"},
delete_message={"entity_id": "value"}
)
print(response)Response: SubmitActionResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| action_type | str | Yes | Type of moderation action to perform. One of: mark_reviewed, delete_message, delete_activity, del... |
| appeal_id | str | No | UUID of the appeal to act on (required for reject_appeal, optional for other actions) |
| ban | BanActionRequestPayload | No | Configuration for ban action |
| block | BlockActionRequestPayload | No | Configuration for block action |
| bypass | BypassActionRequest | No | Configuration for bypass moderation action |
| custom | CustomActionRequestPayload | No | Configuration for custom action |
| delete_activity | DeleteActivityRequestPayload | No | Configuration for activity deletion action |
| delete_comment | DeleteCommentRequestPayload | No | Configuration for comment deletion action |
| delete_message | DeleteMessageRequestPayload | No | Configuration for message deletion action |
| delete_reaction | DeleteReactionRequestPayload | No | Configuration for reaction deletion action |
| delete_user | DeleteUserRequestPayload | No | Configuration for user deletion action |
| escalate | EscalatePayload | No | Configuration for escalation action |
| flag | FlagRequest | No | Configuration for flag action |
| item_id | str | No | UUID of the review queue item to act on |
| mark_reviewed | MarkReviewedRequestPayload | No | Configuration for marking item as reviewed |
| reject_appeal | RejectAppealRequestPayload | No | Configuration for rejecting an appeal |
| restore | RestoreActionRequestPayload | No | Configuration for restore action |
| shadow_block | ShadowBlockActionRequestPayload | No | Configuration for shadow block action |
| unban | UnbanActionRequestPayload | No | Configuration for unban action |
| unblock | UnblockActionRequestPayload | No | Configuration for unblock action |
| user | UserRequest | No | - |
| user_id | str | No | - |
unban
Lift a ban on a user, restoring their ability to interact with the platform. Use this method to reinstate a previously banned user after determining that the ban is no longer necessary.
Example
from getstream import Stream
client = Stream(api_key=api_key, api_secret=api_secret)
# Unban
response = client.feeds.unban(
target_user_id="value",
channel_cid="value",
created_by="value"
)
print(response)Example: with unbanned_by and unbanned_by_id
from getstream import Stream
client = Stream(api_key=api_key, api_secret=api_secret)
# Unban
response = client.feeds.unban(
target_user_id="value",
unbanned_by={"id": "activity-123", "custom": {}},
unbanned_by_id="value"
)
print(response)Response: UnbanResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| target_user_id | str | Yes | - |
| channel_cid | str | No | - |
| created_by | str | No | - |
| unbanned_by | UserRequest | No | Details about the user performing the unban |
| unbanned_by_id | str | No | ID of the user performing the unban |
unmute
Remove a mute restriction from a user, allowing them to resume posting and interacting on the platform. Use this method to restore communication privileges to a user after a mute period has ended or is deemed unnecessary.
Example
from getstream import Stream
client = Stream(api_key=api_key, api_secret=api_secret)
# Unmute a user
response = client.feeds.unmute(
target_ids=[],
user_id="john",
user={"id": "activity-123", "custom": {}}
)
print(response)Response: UnmuteResponse
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| target_ids | []string | Yes | User IDs to unmute |
| user | UserRequest | No | - |
| user_id | str | No | - |
Types Reference
This section documents the types/interfaces used in this API. These types are extracted from the OpenAPI specification.
AIImageConfig
class AIImageConfig(TypedDict, total=False):
async: bool
enabled: bool
ocr_rules: List[OCRRule]
rules: List[AWSRekognitionRule]Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| async | bool | No | |
| enabled | bool | No | |
| ocr_rules | List[OCRRule] | No | |
| rules | List[AWSRekognitionRule] | No |
AIImageLabelDefinition
class AIImageLabelDefinition(TypedDict, total=False):
description: str
group: str
key: str
label: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| description | str | Yes | |
| group | str | Yes | |
| key | str | Yes | |
| label | str | Yes |
AITextConfig
class AITextConfig(TypedDict, total=False):
async: bool
enabled: bool
profile: str
rules: List[BodyguardRule]
severity_rules: List[BodyguardSeverityRule]Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| async | bool | No | |
| enabled | bool | No | |
| profile | str | No | |
| rules | List[BodyguardRule] | No | |
| severity_rules | List[BodyguardSeverityRule] | No |
AIVideoConfig
class AIVideoConfig(TypedDict, total=False):
async: bool
enabled: bool
rules: List[AWSRekognitionRule]Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| async | bool | No | |
| enabled | bool | No | |
| rules | List[AWSRekognitionRule] | No |
AWSRekognitionRule
class AWSRekognitionRule(TypedDict, total=False):
action: str
label: str
min_confidence: float
subclassifications: Dict[str, Any]Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| action | str | Yes | |
| label | str | Yes | |
| min_confidence | float | Yes | |
| subclassifications | Dict[str, Any] | No |
Action
class Action(TypedDict, total=False):
name: str
style: str
text: str
type: str
value: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| name | str | Yes | |
| text | str | Yes | |
| type | str | Yes | |
| style | str | No | |
| value | str | No |
ActionLogResponse
class ActionLogResponse(TypedDict, total=False):
ai_providers: List[str]
created_at: float
custom: Dict[str, Any]
id: str
reason: str
review_queue_item: ReviewQueueItemResponse
target_user: UserResponse
target_user_id: str
type: str
user: UserResponse
user_id: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| ai_providers | List[str] | Yes | |
| created_at | float | Yes | Timestamp when the action was taken |
| custom | Dict[str, Any] | Yes | Additional metadata about the action |
| id | str | Yes | Unique identifier of the action log |
| reason | str | Yes | Reason for the moderation action |
| target_user_id | str | Yes | ID of the user who was the target of the action |
| type | str | Yes | Type of moderation action |
| user_id | str | Yes | ID of the user who performed the action |
| review_queue_item | ReviewQueueItemResponse | No | Associated review queue item |
| target_user | UserResponse | No | User who was the target of the action |
| user | UserResponse | No | User who performed the action |
ActionSequence
class ActionSequence(TypedDict, total=False):
action: str
blur: bool
cooldown_period: int
threshold: int
time_window: int
warning: bool
warning_text: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| action | str | No | |
| blur | bool | No | |
| cooldown_period | int | No | |
| threshold | int | No | |
| time_window | int | No | |
| warning | bool | No | |
| warning_text | str | No |
ActivityRequest
class ActivityRequest(TypedDict, total=False):
attachments: List[Attachment]
collection_refs: List[str]
copy_custom_to_notification: bool
create_notification_activity: bool
custom: Dict[str, Any]
expires_at: str
feeds: List[str]
filter_tags: List[str]
id: str
interest_tags: List[str]
location: Location
mentioned_user_ids: List[str]
parent_id: str
poll_id: str
restrict_replies: str
search_data: Dict[str, Any]
skip_enrich_url: bool
skip_push: bool
text: str
type: str
user_id: str
visibility: str
visibility_tag: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| feeds | List[str] | Yes | List of feeds to add the activity to with a default max limit of 25 feeds |
| type | str | Yes | Type of activity |
| attachments | List[Attachment] | No | List of attachments for the activity |
| collection_refs | List[str] | No | Collections that this activity references |
| copy_custom_to_notification | bool | No | Whether to copy custom data to the notification activity (only applies when c... |
| create_notification_activity | bool | No | Whether to create notification activities for mentioned users |
| custom | Dict[str, Any] | No | Custom data for the activity |
| expires_at | str | No | Expiration time for the activity |
| filter_tags | List[str] | No | Tags for filtering activities |
| id | str | No | Optional ID for the activity |
| interest_tags | List[str] | No | Tags for indicating user interests |
| location | Location | No | Geographic location related to the activity |
| mentioned_user_ids | List[str] | No | List of users mentioned in the activity |
| parent_id | str | No | ID of parent activity for replies/comments |
| poll_id | str | No | ID of a poll to attach to activity |
| restrict_replies | str | No | Controls who can add comments/replies to this activity. One of: everyone, peo... |
| search_data | Dict[str, Any] | No | Additional data for search indexing |
| skip_enrich_url | bool | No | Whether to skip URL enrichment for the activity |
| skip_push | bool | No | Whether to skip push notifications |
| text | str | No | Text content of the activity |
| user_id | str | No | ID of the user creating the activity |
| visibility | str | No | Visibility setting for the activity. One of: public, private, tag |
| visibility_tag | str | No | If visibility is 'tag', this is the tag name and is required |
AppealItemResponse
class AppealItemResponse(TypedDict, total=False):
appeal_reason: str
attachments: List[str]
created_at: float
decision_reason: str
entity_content: ModerationPayload
entity_id: str
entity_type: str
id: str
status: str
updated_at: float
user: UserResponseProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| appeal_reason | str | Yes | Reason Text of the Appeal Item |
| created_at | float | Yes | When the flag was created |
| entity_id | str | Yes | ID of the entity |
| entity_type | str | Yes | Type of entity |
| id | str | Yes | |
| status | str | Yes | Status of the Appeal Item |
| updated_at | float | Yes | When the flag was last updated |
| attachments | List[str] | No | Attachments(e.g. Images) of the Appeal Item |
| decision_reason | str | No | Decision Reason of the Appeal Item |
| entity_content | ModerationPayload | No | |
| user | UserResponse | No | Details of the user who created the appeal |
AppealRequest
class AppealRequest(TypedDict, total=False):
appeal_reason: str
attachments: List[str]
entity_id: str
entity_type: str
user: UserRequest
user_id: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| appeal_reason | str | Yes | Explanation for why the content is being appealed |
| entity_id | str | Yes | Unique identifier of the entity being appealed |
| entity_type | str | Yes | Type of entity being appealed (e.g., message, user) |
| attachments | List[str] | No | Array of Attachment URLs(e.g., images) |
| user | UserRequest | No | |
| user_id | str | No |
AppealResponse
class AppealResponse(TypedDict, total=False):
appeal_id: str
duration: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| appeal_id | str | Yes | Unique identifier of the created Appeal item |
| duration | str | Yes |
Attachment
An attachment is a message object that represents a file uploaded by a user.
class Attachment(TypedDict, total=False):
actions: List[Action]
asset_url: str
author_icon: str
author_link: str
author_name: str
color: str
custom: Dict[str, Any]
fallback: str
fields: List[Field]
footer: str
footer_icon: str
giphy: Images
image_url: str
og_scrape_url: str
original_height: int
original_width: int
pretext: str
text: str
thumb_url: str
title: str
title_link: str
type: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| custom | Dict[str, Any] | Yes | |
| actions | List[Action] | No | |
| asset_url | str | No | |
| author_icon | str | No | |
| author_link | str | No | |
| author_name | str | No | |
| color | str | No | |
| fallback | str | No | |
| fields | List[Field] | No | |
| footer | str | No | |
| footer_icon | str | No | |
| giphy | Images | No | |
| image_url | str | No | |
| og_scrape_url | str | No | |
| original_height | int | No | |
| original_width | int | No | |
| pretext | str | No | |
| text | str | No | |
| thumb_url | str | No | |
| title | str | No | |
| title_link | str | No | |
| type | str | No | Attachment type (e.g. image, video, url) |
AutomodPlatformCircumventionConfig
class AutomodPlatformCircumventionConfig(TypedDict, total=False):
async: bool
enabled: bool
rules: List[AutomodRule]Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| async | bool | No | |
| enabled | bool | No | |
| rules | List[AutomodRule] | No |
AutomodRule
class AutomodRule(TypedDict, total=False):
action: str
label: str
threshold: floatProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| action | str | Yes | |
| label | str | Yes | |
| threshold | float | Yes |
AutomodSemanticFiltersConfig
class AutomodSemanticFiltersConfig(TypedDict, total=False):
async: bool
enabled: bool
rules: List[AutomodSemanticFiltersRule]Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| async | bool | No | |
| enabled | bool | No | |
| rules | List[AutomodSemanticFiltersRule] | No |
AutomodSemanticFiltersRule
class AutomodSemanticFiltersRule(TypedDict, total=False):
action: str
name: str
threshold: floatProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| action | str | Yes | |
| name | str | Yes | |
| threshold | float | Yes |
AutomodToxicityConfig
class AutomodToxicityConfig(TypedDict, total=False):
async: bool
enabled: bool
rules: List[AutomodRule]Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| async | bool | No | |
| enabled | bool | No | |
| rules | List[AutomodRule] | No |
BanActionRequestPayload
Configuration for ban moderation action
class BanActionRequestPayload(TypedDict, total=False):
ban_from_future_channels: bool
channel_ban_only: bool
channel_cid: str
delete_messages: str
ip_ban: bool
reason: str
shadow: bool
target_user_id: str
timeout: intProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| ban_from_future_channels | bool | No | Also ban user from all channels this moderator creates in the future |
| channel_ban_only | bool | No | Ban only from specific channel |
| channel_cid | str | No | |
| delete_messages | str | No | Message deletion mode: soft, pruning, or hard |
| ip_ban | bool | No | Whether to ban by IP address |
| reason | str | No | Reason for the ban |
| shadow | bool | No | Whether this is a shadow ban |
| target_user_id | str | No | Optional: ban user directly without review item |
| timeout | int | No | Duration of ban in minutes |
BanOptions
class BanOptions(TypedDict, total=False):
delete_messages: str
duration: int
ip_ban: bool
reason: str
shadow_ban: boolProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| delete_messages | str | No | |
| duration | int | No | |
| ip_ban | bool | No | |
| reason | str | No | |
| shadow_ban | bool | No |
BanResponse
class BanResponse(TypedDict, total=False):
duration: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | str | Yes |
BlockActionRequestPayload
Configuration for block action
class BlockActionRequestPayload(TypedDict, total=False):
reason: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| reason | str | No | Reason for blocking |
BlockListConfig
class BlockListConfig(TypedDict, total=False):
async: bool
enabled: bool
match_substring: bool
rules: List[BlockListRule]Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| async | bool | No | |
| enabled | bool | No | |
| match_substring | bool | No | |
| rules | List[BlockListRule] | No |
BlockListRule
class BlockListRule(TypedDict, total=False):
action: str
name: str
team: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| action | str | Yes | |
| name | str | No | |
| team | str | No |
BodyguardImageAnalysisConfig
class BodyguardImageAnalysisConfig(TypedDict, total=False):
rules: List[BodyguardRule]Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| rules | List[BodyguardRule] | No |
BodyguardRule
class BodyguardRule(TypedDict, total=False):
action: str
label: str
severity_rules: List[BodyguardSeverityRule]Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| label | str | Yes | |
| action | str | No | |
| severity_rules | List[BodyguardSeverityRule] | No |
BodyguardSeverityRule
class BodyguardSeverityRule(TypedDict, total=False):
action: str
severity: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| action | str | Yes | |
| severity | str | Yes |
BulkImageModerationResponse
class BulkImageModerationResponse(TypedDict, total=False):
duration: str
task_id: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | str | Yes | |
| task_id | str | Yes | ID of the task for processing the bulk image moderation |
BypassActionRequest
class BypassActionRequest(TypedDict, total=False):
enabled: boolProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| enabled | bool | No |
BypassResponse
class BypassResponse(TypedDict, total=False):
duration: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | str | Yes |
CallActionOptions
class CallActionOptions(TypedDict, total=False):
duration: int
flag_reason: str
kick_reason: str
mute_audio: bool
mute_video: bool
reason: str
warning_text: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | int | No | |
| flag_reason | str | No | |
| kick_reason | str | No | |
| mute_audio | bool | No | |
| mute_video | bool | No | |
| reason | str | No | |
| warning_text | str | No |
CallCustomPropertyParameters
class CallCustomPropertyParameters(TypedDict, total=False):
operator: str
property_key: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| operator | str | No | |
| property_key | str | No |
CallRuleActionSequence
class CallRuleActionSequence(TypedDict, total=False):
actions: List[str]
call_options: CallActionOptions
violation_number: intProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| actions | List[str] | No | |
| call_options | CallActionOptions | No | |
| violation_number | int | No |
CallTypeRuleParameters
class CallTypeRuleParameters(TypedDict, total=False):
call_type: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| call_type | str | No |
CallViolationCountParameters
class CallViolationCountParameters(TypedDict, total=False):
threshold: int
time_window: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| threshold | int | No | |
| time_window | str | No |
CheckResponse
class CheckResponse(TypedDict, total=False):
duration: str
item: ReviewQueueItemResponse
recommended_action: str
status: str
task_id: str
triggered_rule: TriggeredRuleResponseProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | str | Yes | |
| recommended_action | str | Yes | Suggested action based on moderation results |
| status | str | Yes | Status of the moderation check (completed or pending) |
| item | ReviewQueueItemResponse | No | Review queue item (present if action != keep) |
| task_id | str | No | ID of the running moderation task |
| triggered_rule | TriggeredRuleResponse | No | Rule triggered by evaluation, with resolved actions and escalation details |
CheckS3AccessResponse
class CheckS3AccessResponse(TypedDict, total=False):
duration: str
message: str
success: boolProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | str | Yes | |
| success | bool | Yes | Whether the S3 access check succeeded |
| message | str | No | Descriptive message about the check result |
ClosedCaptionRuleParameters
class ClosedCaptionRuleParameters(TypedDict, total=False):
harm_labels: List[str]
llm_harm_labels: Dict[str, Any]
threshold: intProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| harm_labels | List[str] | No | |
| llm_harm_labels | Dict[str, Any] | No | |
| threshold | int | No |
ConfigResponse
class ConfigResponse(TypedDict, total=False):
ai_image_config: AIImageConfig
ai_image_label_definitions: List[AIImageLabelDefinition]
ai_image_subclassifications: Dict[str, Any]
ai_text_config: AITextConfig
ai_video_config: AIVideoConfig
async: bool
automod_platform_circumvention_config: AutomodPlatformCircumventionConfig
automod_semantic_filters_config: AutomodSemanticFiltersConfig
automod_toxicity_config: AutomodToxicityConfig
block_list_config: BlockListConfig
created_at: float
key: str
llm_config: LLMConfig
supported_video_call_harm_types: List[str]
team: str
updated_at: float
velocity_filter_config: VelocityFilterConfig
video_call_rule_config: VideoCallRuleConfigProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| async | bool | Yes | Whether moderation should be performed asynchronously |
| created_at | float | Yes | When the configuration was created |
| key | str | Yes | Unique identifier for the moderation configuration |
| supported_video_call_harm_types | List[str] | Yes | |
| team | str | Yes | Team associated with the configuration |
| updated_at | float | Yes | When the configuration was last updated |
| ai_image_config | AIImageConfig | No | Configuration for AI image analysis |
| ai_image_label_definitions | List[AIImageLabelDefinition] | No | Configurable image moderation label definitions for dashboard rendering |
| ai_image_subclassifications | Dict[str, Any] | No | Available L2 subclassifications per L1 image moderation label, based on the a... |
| ai_text_config | AITextConfig | No | Configuration for AI text analysis |
| ai_video_config | AIVideoConfig | No | Configuration for AI video analysis |
| automod_platform_circumvention_config | AutomodPlatformCircumventionConfig | No | Configuration for platform circumvention detection |
| automod_semantic_filters_config | AutomodSemanticFiltersConfig | No | Configuration for semantic filtering |
| automod_toxicity_config | AutomodToxicityConfig | No | Configuration for toxicity detection |
| block_list_config | BlockListConfig | No | Configuration for block list filtering |
| llm_config | LLMConfig | No | Configuration for customer-configured LLM moderation |
| velocity_filter_config | VelocityFilterConfig | No | Configuration for velocity-based filtering |
| video_call_rule_config | VideoCallRuleConfig | No |
ContentCountRuleParameters
class ContentCountRuleParameters(TypedDict, total=False):
threshold: int
time_window: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| threshold | int | No | |
| time_window | str | No |
CustomActionRequestPayload
Configuration for custom moderation action
class CustomActionRequestPayload(TypedDict, total=False):
id: str
options: Dict[str, Any]Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| id | str | No | Custom action identifier |
| options | Dict[str, Any] | No | Custom action options |
CustomCheckFlag
class CustomCheckFlag(TypedDict, total=False):
custom: Dict[str, Any]
labels: List[str]
reason: str
type: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| type | str | Yes | Type of check (custom_check_text, custom_check_image, custom_check_video) |
| custom | Dict[str, Any] | No | Additional metadata for the flag |
| labels | List[str] | No | Labels from various moderation sources |
| reason | str | No | Optional explanation for the flag |
CustomCheckResponse
class CustomCheckResponse(TypedDict, total=False):
duration: str
id: str
item: ReviewQueueItemResponse
status: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | str | Yes | |
| id | str | Yes | Unique identifier of the custom check |
| status | str | Yes | Status of the custom check |
| item | ReviewQueueItemResponse | No | Review queue item details |
DeleteActivityRequestPayload
Configuration for activity deletion action
class DeleteActivityRequestPayload(TypedDict, total=False):
entity_id: str
entity_type: str
hard_delete: bool
reason: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| entity_id | str | No | ID of the activity to delete (alternative to item_id) |
| entity_type | str | No | Type of the entity (required for delete_activity to distinguish v2 vs v3) |
| hard_delete | bool | No | Whether to permanently delete the activity |
| reason | str | No | Reason for deletion |
DeleteCommentRequestPayload
Configuration for comment deletion action
class DeleteCommentRequestPayload(TypedDict, total=False):
entity_id: str
entity_type: str
hard_delete: bool
reason: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| entity_id | str | No | ID of the comment to delete (alternative to item_id) |
| entity_type | str | No | Type of the entity |
| hard_delete | bool | No | Whether to permanently delete the comment |
| reason | str | No | Reason for deletion |
DeleteMessageRequestPayload
Configuration for message deletion action
class DeleteMessageRequestPayload(TypedDict, total=False):
entity_id: str
entity_type: str
hard_delete: bool
reason: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| entity_id | str | No | ID of the message to delete (alternative to item_id) |
| entity_type | str | No | Type of the entity |
| hard_delete | bool | No | Whether to permanently delete the message |
| reason | str | No | Reason for deletion |
DeleteModerationConfigResponse
class DeleteModerationConfigResponse(TypedDict, total=False):
duration: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | str | Yes |
DeleteModerationRuleResponse
Basic response information
class DeleteModerationRuleResponse(TypedDict, total=False):
duration: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | str | Yes | Duration of the request in milliseconds |
DeleteModerationTemplateResponse
class DeleteModerationTemplateResponse(TypedDict, total=False):
duration: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | str | Yes |
DeleteReactionRequestPayload
Configuration for reaction deletion action
class DeleteReactionRequestPayload(TypedDict, total=False):
entity_id: str
entity_type: str
hard_delete: bool
reason: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| entity_id | str | No | ID of the reaction to delete (alternative to item_id) |
| entity_type | str | No | Type of the entity |
| hard_delete | bool | No | Whether to permanently delete the reaction |
| reason | str | No | Reason for deletion |
DeleteUserRequestPayload
Configuration for user deletion action
class DeleteUserRequestPayload(TypedDict, total=False):
delete_conversation_channels: bool
delete_feeds_content: bool
entity_id: str
entity_type: str
hard_delete: bool
mark_messages_deleted: bool
reason: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| delete_conversation_channels | bool | No | Also delete all user conversations |
| delete_feeds_content | bool | No | Delete flagged feeds content |
| entity_id | str | No | ID of the user to delete (alternative to item_id) |
| entity_type | str | No | Type of the entity |
| hard_delete | bool | No | Whether to permanently delete the user |
| mark_messages_deleted | bool | No | Also delete all user messages |
| reason | str | No | Reason for deletion |
EscalatePayload
Configuration for escalation action
class EscalatePayload(TypedDict, total=False):
notes: str
priority: str
reason: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| notes | str | No | Additional context for the reviewer |
| priority | str | No | Priority of the escalation (low, medium, high) |
| reason | str | No | Reason for the escalation (from configured escalation_reasons) |
FeedsModerationTemplateConfigPayload
Configuration for a feeds moderation template
class FeedsModerationTemplateConfigPayload(TypedDict, total=False):
config_key: str
data_types: Dict[str, Any]Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| data_types | Dict[str, Any] | Yes | Map of data type names to their content types |
| config_key | str | No | Key of the moderation configuration to use |
Field
class Field(TypedDict, total=False):
short: bool
title: str
value: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| short | bool | Yes | |
| title | str | Yes | |
| value | str | Yes |
FilterConfigResponse
class FilterConfigResponse(TypedDict, total=False):
ai_text_labels: List[str]
config_keys: List[str]
llm_labels: List[str]Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| llm_labels | List[str] | Yes | |
| ai_text_labels | List[str] | No | |
| config_keys | List[str] | No |
FlagCountRuleParameters
class FlagCountRuleParameters(TypedDict, total=False):
threshold: intProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| threshold | int | No |
FlagRequest
class FlagRequest(TypedDict, total=False):
custom: Dict[str, Any]
entity_creator_id: str
entity_id: str
entity_type: str
moderation_payload: ModerationPayload
reason: str
user: UserRequest
user_id: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| entity_id | str | Yes | Unique identifier of the entity being flagged |
| entity_type | str | Yes | Type of entity being flagged (e.g., message, user) |
| custom | Dict[str, Any] | No | Additional metadata about the flag |
| entity_creator_id | str | No | ID of the user who created the flagged entity |
| moderation_payload | ModerationPayload | No | Content being flagged |
| reason | str | No | Optional explanation for why the content is being flagged |
| user | UserRequest | No | |
| user_id | str | No |
FlagResponse
class FlagResponse(TypedDict, total=False):
duration: str
item_id: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | str | Yes | |
| item_id | str | Yes | Unique identifier of the created moderation item |
FlagUserOptions
class FlagUserOptions(TypedDict, total=False):
reason: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| reason | str | No |
GetAppealResponse
class GetAppealResponse(TypedDict, total=False):
duration: str
item: AppealItemResponseProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | str | Yes | |
| item | AppealItemResponse | No | Current state of the appeal |
GetConfigResponse
class GetConfigResponse(TypedDict, total=False):
config: ConfigResponse
duration: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | str | Yes | |
| config | ConfigResponse | No | The retrieved moderation configuration |
GetFlagCountResponse
class GetFlagCountResponse(TypedDict, total=False):
count: int
duration: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| count | int | Yes | Total number of flags against the specified user's content |
| duration | str | Yes |
GetModerationRuleResponse
Basic response information
class GetModerationRuleResponse(TypedDict, total=False):
duration: str
rule: ModerationRuleV2ResponseProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | str | Yes | Duration of the request in milliseconds |
| rule | ModerationRuleV2Response | No |
GetReviewQueueItemResponse
class GetReviewQueueItemResponse(TypedDict, total=False):
duration: str
item: ReviewQueueItemResponseProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | str | Yes | |
| item | ReviewQueueItemResponse | No | Current state of the review queue item |
GoogleVisionConfig
class GoogleVisionConfig(TypedDict, total=False):
enabled: boolProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| enabled | bool | No |
HarmConfig
class HarmConfig(TypedDict, total=False):
action_sequences: List[ActionSequence]
cooldown_period: int
harm_types: List[str]
severity: int
threshold: intProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| action_sequences | List[ActionSequence] | No | |
| cooldown_period | int | No | |
| harm_types | List[str] | No | |
| severity | int | No | |
| threshold | int | No |
ImageContentParameters
class ImageContentParameters(TypedDict, total=False):
harm_labels: List[str]
label_operator: str
min_confidence: floatProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| harm_labels | List[str] | No | |
| label_operator | str | No | |
| min_confidence | float | No |
ImageRuleParameters
class ImageRuleParameters(TypedDict, total=False):
harm_labels: List[str]
min_confidence: float
threshold: int
time_window: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| harm_labels | List[str] | No | |
| min_confidence | float | No | |
| threshold | int | No | |
| time_window | str | No |
Images
class Images(TypedDict, total=False):
fixed_height: ImageData
fixed_height_downsampled: ImageData
fixed_height_still: ImageData
fixed_width: ImageData
fixed_width_downsampled: ImageData
fixed_width_still: ImageData
original: ImageDataProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| fixed_height | ImageData | Yes | |
| fixed_height_downsampled | ImageData | Yes | |
| fixed_height_still | ImageData | Yes | |
| fixed_width | ImageData | Yes | |
| fixed_width_downsampled | ImageData | Yes | |
| fixed_width_still | ImageData | Yes | |
| original | ImageData | Yes |
InsertActionLogResponse
Response after inserting a moderation action log
class InsertActionLogResponse(TypedDict, total=False):
duration: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | str | Yes |
KeyframeRuleParameters
class KeyframeRuleParameters(TypedDict, total=False):
harm_labels: List[str]
min_confidence: float
threshold: intProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| harm_labels | List[str] | No | |
| min_confidence | float | No | |
| threshold | int | No |
LLMConfig
class LLMConfig(TypedDict, total=False):
app_context: str
async: bool
enabled: bool
rules: List[LLMRule]
severity_descriptions: Dict[str, Any]Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| app_context | str | No | |
| async | bool | No | |
| enabled | bool | No | |
| rules | List[LLMRule] | No | |
| severity_descriptions | Dict[str, Any] | No |
LLMRule
class LLMRule(TypedDict, total=False):
action: str
description: str
label: str
severity_rules: List[BodyguardSeverityRule]Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| description | str | Yes | |
| label | str | Yes | |
| action | str | No | |
| severity_rules | List[BodyguardSeverityRule] | No |
Location
class Location(TypedDict, total=False):
lat: float
lng: floatProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| lat | float | Yes | Latitude coordinate |
| lng | float | Yes | Longitude coordinate |
MarkReviewedRequestPayload
Configuration for mark reviewed action
class MarkReviewedRequestPayload(TypedDict, total=False):
content_to_mark_as_reviewed_limit: int
decision_reason: str
disable_marking_content_as_reviewed: boolProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| content_to_mark_as_reviewed_limit | int | No | Maximum content items to mark as reviewed |
| decision_reason | str | No | Reason for the appeal decision |
| disable_marking_content_as_reviewed | bool | No | Skip marking content as reviewed |
ModerationConfig
class ModerationConfig(TypedDict, total=False):
ai_image_config: AIImageConfig
ai_image_lite_config: BodyguardImageAnalysisConfig
ai_text_config: AITextConfig
ai_video_config: AIVideoConfig
async: bool
automod_platform_circumvention_config: AutomodPlatformCircumventionConfig
automod_semantic_filters_config: AutomodSemanticFiltersConfig
automod_toxicity_config: AutomodToxicityConfig
block_list_config: BlockListConfig
created_at: float
google_vision_config: GoogleVisionConfig
key: str
llm_config: LLMConfig
supported_video_call_harm_types: List[str]
team: str
updated_at: float
velocity_filter_config: VelocityFilterConfig
video_call_rule_config: VideoCallRuleConfigProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| ai_image_config | AIImageConfig | No | |
| ai_image_lite_config | BodyguardImageAnalysisConfig | No | |
| ai_text_config | AITextConfig | No | |
| ai_video_config | AIVideoConfig | No | |
| async | bool | No | |
| automod_platform_circumvention_config | AutomodPlatformCircumventionConfig | No | |
| automod_semantic_filters_config | AutomodSemanticFiltersConfig | No | |
| automod_toxicity_config | AutomodToxicityConfig | No | |
| block_list_config | BlockListConfig | No | |
| created_at | float | No | |
| google_vision_config | GoogleVisionConfig | No | |
| key | str | No | |
| llm_config | LLMConfig | No | |
| supported_video_call_harm_types | List[str] | No | |
| team | str | No | |
| updated_at | float | No | |
| velocity_filter_config | VelocityFilterConfig | No | |
| video_call_rule_config | VideoCallRuleConfig | No |
ModerationFlagResponse
class ModerationFlagResponse(TypedDict, total=False):
created_at: float
custom: Dict[str, Any]
entity_creator_id: str
entity_id: str
entity_type: str
labels: List[str]
moderation_payload: ModerationPayloadResponse
reason: str
result: List[Dict[str, Any]]
review_queue_item: ReviewQueueItemResponse
review_queue_item_id: str
type: str
updated_at: float
user: UserResponse
user_id: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| created_at | float | Yes | |
| entity_id | str | Yes | |
| entity_type | str | Yes | |
| result | List[Dict[str, Any]] | Yes | |
| type | str | Yes | |
| updated_at | float | Yes | |
| user_id | str | Yes | |
| custom | Dict[str, Any] | No | |
| entity_creator_id | str | No | |
| labels | List[str] | No | |
| moderation_payload | ModerationPayloadResponse | No | |
| reason | str | No | |
| review_queue_item | ReviewQueueItemResponse | No | |
| review_queue_item_id | str | No | |
| user | UserResponse | No |
ModerationPayload
class ModerationPayload(TypedDict, total=False):
custom: Dict[str, Any]
images: List[str]
texts: List[str]
videos: List[str]Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| custom | Dict[str, Any] | No | |
| images | List[str] | No | |
| texts | List[str] | No | |
| videos | List[str] | No |
ModerationPayloadRequest
Content payload for moderation
class ModerationPayloadRequest(TypedDict, total=False):
custom: Dict[str, Any]
images: List[str]
texts: List[str]
videos: List[str]Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| custom | Dict[str, Any] | No | Custom data for moderation |
| images | List[str] | No | Image URLs to moderate (max 30) |
| texts | List[str] | No | Text content to moderate |
| videos | List[str] | No | Video URLs to moderate |
ModerationRuleV2Response
class ModerationRuleV2Response(TypedDict, total=False):
action: RuleBuilderAction
action_sequences: List[CallRuleActionSequence]
conditions: List[RuleBuilderCondition]
config_keys: List[str]
cooldown_period: str
created_at: float
description: str
enabled: bool
groups: List[RuleBuilderConditionGroup]
id: str
logic: str
name: str
rule_type: str
team: str
updated_at: floatProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| config_keys | List[str] | Yes | |
| created_at | float | Yes | |
| description | str | Yes | |
| enabled | bool | Yes | |
| id | str | Yes | |
| name | str | Yes | |
| rule_type | str | Yes | |
| team | str | Yes | |
| updated_at | float | Yes | |
| action | RuleBuilderAction | No | |
| action_sequences | List[CallRuleActionSequence] | No | |
| conditions | List[RuleBuilderCondition] | No | |
| cooldown_period | str | No | |
| groups | List[RuleBuilderConditionGroup] | No | |
| logic | str | No |
MuteResponse
class MuteResponse(TypedDict, total=False):
duration: str
mutes: List[UserMuteResponse]
non_existing_users: List[str]
own_user: OwnUserResponseProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | str | Yes | |
| mutes | List[UserMuteResponse] | No | Object with mutes (if multiple users were muted) |
| non_existing_users | List[str] | No | A list of users that can't be found. Common cause for this is deleted users |
| own_user | OwnUserResponse | No | Authorized user object with fresh mutes information |
OCRRule
class OCRRule(TypedDict, total=False):
action: str
label: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| action | str | Yes | |
| label | str | Yes |
OwnUserResponse
class OwnUserResponse(TypedDict, total=False):
avg_response_time: int
banned: bool
blocked_user_ids: List[str]
channel_mutes: List[ChannelMute]
created_at: float
custom: Dict[str, Any]
deactivated_at: float
deleted_at: float
devices: List[DeviceResponse]
id: str
image: str
invisible: bool
language: str
last_active: float
latest_hidden_channels: List[str]
mutes: List[UserMuteResponse]
name: str
online: bool
privacy_settings: PrivacySettingsResponse
push_preferences: PushPreferencesResponse
revoke_tokens_issued_before: float
role: str
teams: List[str]
teams_role: Dict[str, Any]
total_unread_count: int
total_unread_count_by_team: Dict[str, Any]
unread_channels: int
unread_count: int
unread_threads: int
updated_at: floatProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| banned | bool | Yes | |
| channel_mutes | List[ChannelMute] | Yes | |
| created_at | float | Yes | |
| custom | Dict[str, Any] | Yes | |
| devices | List[DeviceResponse] | Yes | |
| id | str | Yes | |
| invisible | bool | Yes | |
| language | str | Yes | |
| mutes | List[UserMuteResponse] | Yes | |
| online | bool | Yes | |
| role | str | Yes | |
| teams | List[str] | Yes | |
| total_unread_count | int | Yes | |
| unread_channels | int | Yes | |
| unread_count | int | Yes | |
| unread_threads | int | Yes | |
| updated_at | float | Yes | |
| avg_response_time | int | No | |
| blocked_user_ids | List[str] | No | |
| deactivated_at | float | No | |
| deleted_at | float | No | |
| image | str | No | |
| last_active | float | No | |
| latest_hidden_channels | List[str] | No | |
| name | str | No | |
| privacy_settings | PrivacySettingsResponse | No | |
| push_preferences | PushPreferencesResponse | No | |
| revoke_tokens_issued_before | float | No | |
| teams_role | Dict[str, Any] | No | |
| total_unread_count_by_team | Dict[str, Any] | No |
PagerRequest
class PagerRequest(TypedDict, total=False):
limit: int
next: str
prev: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| limit | int | No | |
| next | str | No | |
| prev | str | No |
PrivacySettingsResponse
class PrivacySettingsResponse(TypedDict, total=False):
delivery_receipts: DeliveryReceiptsResponse
read_receipts: ReadReceiptsResponse
typing_indicators: TypingIndicatorsResponseProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| delivery_receipts | DeliveryReceiptsResponse | No | |
| read_receipts | ReadReceiptsResponse | No | |
| typing_indicators | TypingIndicatorsResponse | No |
QueryAppealsResponse
class QueryAppealsResponse(TypedDict, total=False):
duration: str
items: List[AppealItemResponse]
next: str
prev: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | str | Yes | |
| items | List[AppealItemResponse] | Yes | List of Appeal Items |
| next | str | No | |
| prev | str | No |
QueryFeedModerationTemplate
class QueryFeedModerationTemplate(TypedDict, total=False):
config: FeedsModerationTemplateConfigPayload
created_at: float
name: str
updated_at: floatProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| created_at | float | Yes | When the template was created |
| name | str | Yes | Name of the moderation template |
| updated_at | float | Yes | When the template was last updated |
| config | FeedsModerationTemplateConfigPayload | No | Configuration for the moderation template |
QueryFeedModerationTemplatesResponse
class QueryFeedModerationTemplatesResponse(TypedDict, total=False):
duration: str
templates: List[QueryFeedModerationTemplate]Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | str | Yes | |
| templates | List[QueryFeedModerationTemplate] | Yes | List of moderation templates |
QueryModerationConfigsResponse
class QueryModerationConfigsResponse(TypedDict, total=False):
configs: List[ConfigResponse]
duration: str
next: str
prev: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| configs | List[ConfigResponse] | Yes | List of moderation configurations |
| duration | str | Yes | |
| next | str | No | |
| prev | str | No |
QueryModerationFlagsResponse
Basic response information
class QueryModerationFlagsResponse(TypedDict, total=False):
duration: str
flags: List[ModerationFlagResponse]
next: str
prev: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | str | Yes | Duration of the request in milliseconds |
| flags | List[ModerationFlagResponse] | Yes | |
| next | str | No | |
| prev | str | No |
QueryModerationLogsResponse
class QueryModerationLogsResponse(TypedDict, total=False):
duration: str
logs: List[ActionLogResponse]
next: str
prev: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | str | Yes | |
| logs | List[ActionLogResponse] | Yes | List of moderation action logs |
| next | str | No | |
| prev | str | No |
QueryModerationRulesResponse
class QueryModerationRulesResponse(TypedDict, total=False):
ai_image_label_definitions: List[AIImageLabelDefinition]
ai_image_subclassifications: Dict[str, Any]
closed_caption_labels: List[str]
default_llm_labels: Dict[str, Any]
duration: str
keyframe_label_classifications: Dict[str, Any]
keyframe_labels: List[str]
next: str
prev: str
rules: List[ModerationRuleV2Response]Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| ai_image_label_definitions | List[AIImageLabelDefinition] | Yes | AI image label definitions with metadata for dashboard rendering |
| ai_image_subclassifications | Dict[str, Any] | Yes | Stream L1 to leaf-level label name mapping for AI image rules |
| closed_caption_labels | List[str] | Yes | Available harm labels for closed caption rules |
| default_llm_labels | Dict[str, Any] | Yes | Default LLM label descriptions |
| duration | str | Yes | |
| keyframe_label_classifications | Dict[str, Any] | Yes | L1 to L2 mapping of keyframe harm label classifications |
| keyframe_labels | List[str] | Yes | Deprecated: use keyframe_label_classifications instead. Available L1 harm lab... |
| rules | List[ModerationRuleV2Response] | Yes | List of moderation rules |
| next | str | No | |
| prev | str | No |
QueryReviewQueueResponse
class QueryReviewQueueResponse(TypedDict, total=False):
action_config: Dict[str, Any]
duration: str
filter_config: FilterConfigResponse
items: List[ReviewQueueItemResponse]
next: str
prev: str
stats: Dict[str, Any]Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| action_config | Dict[str, Any] | Yes | Configuration for moderation actions |
| duration | str | Yes | |
| items | List[ReviewQueueItemResponse] | Yes | List of review queue items |
| stats | Dict[str, Any] | Yes | Statistics about the review queue |
| filter_config | FilterConfigResponse | No | Configuration for filters in moderation review queue |
| next | str | No | |
| prev | str | No |
Reaction
class Reaction(TypedDict, total=False):
activity_id: str
children_counts: Dict[str, Any]
created_at: float
data: Dict[str, Any]
deleted_at: float
id: str
kind: str
latest_children: Dict[str, Any]
moderation: Dict[str, Any]
own_children: Dict[str, Any]
parent: str
score: float
target_feeds: List[str]
target_feeds_extra_data: Dict[str, Any]
updated_at: float
user: User
user_id: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| activity_id | str | Yes | |
| created_at | float | Yes | |
| kind | str | Yes | |
| updated_at | float | Yes | |
| user_id | str | Yes | |
| children_counts | Dict[str, Any] | No | |
| data | Dict[str, Any] | No | |
| deleted_at | float | No | |
| id | str | No | |
| latest_children | Dict[str, Any] | No | |
| moderation | Dict[str, Any] | No | |
| own_children | Dict[str, Any] | No | |
| parent | str | No | |
| score | float | No | |
| target_feeds | List[str] | No | |
| target_feeds_extra_data | Dict[str, Any] | No | |
| user | User | No |
RejectAppealRequestPayload
Configuration for rejecting an appeal
class RejectAppealRequestPayload(TypedDict, total=False):
decision_reason: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| decision_reason | str | Yes | Reason for rejecting the appeal |
RestoreActionRequestPayload
Configuration for restore action
class RestoreActionRequestPayload(TypedDict, total=False):
decision_reason: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| decision_reason | str | No | Reason for the appeal decision |
ReviewQueueItemResponse
class ReviewQueueItemResponse(TypedDict, total=False):
actions: List[ActionLogResponse]
activity: EnrichedActivity
ai_text_severity: str
appeal: AppealItemResponse
assigned_to: UserResponse
bans: List[BanInfoResponse]
call: CallResponse
completed_at: float
config_key: str
created_at: float
entity_creator: EntityCreatorResponse
entity_creator_id: str
entity_id: str
entity_type: str
escalated: bool
escalated_at: float
escalated_by: str
escalation_metadata: EscalationMetadata
feeds_v2_activity: EnrichedActivity
feeds_v2_reaction: Reaction
feeds_v3_activity: FeedsV3ActivityResponse
feeds_v3_comment: FeedsV3CommentResponse
flags: List[ModerationFlagResponse]
flags_count: int
id: str
languages: List[str]
latest_moderator_action: str
message: MessageResponse
moderation_payload: ModerationPayloadResponse
reaction: Reaction
recommended_action: str
reviewed_at: float
reviewed_by: str
severity: int
status: str
teams: List[str]
updated_at: floatProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| actions | List[ActionLogResponse] | Yes | Moderation actions taken |
| ai_text_severity | str | Yes | AI-determined text severity |
| bans | List[BanInfoResponse] | Yes | Associated ban records |
| created_at | float | Yes | When the item was created |
| entity_id | str | Yes | ID of the entity being reviewed |
| entity_type | str | Yes | Type of entity being reviewed |
| escalated | bool | Yes | Whether the item has been escalated |
| flags | List[ModerationFlagResponse] | Yes | Associated flag records |
| flags_count | int | Yes | |
| id | str | Yes | Unique identifier of the review queue item |
| languages | List[str] | Yes | Detected languages in the content |
| latest_moderator_action | str | Yes | |
| recommended_action | str | Yes | Suggested moderation action |
| reviewed_by | str | Yes | ID of the moderator who reviewed the item |
| severity | int | Yes | Severity level of the content |
| status | str | Yes | Current status of the review |
| updated_at | float | Yes | When the item was last updated |
| activity | EnrichedActivity | No | |
| appeal | AppealItemResponse | No | Appeal submitted for this item if it exists |
| assigned_to | UserResponse | No | Moderator assigned to review this item |
| call | CallResponse | No | |
| completed_at | float | No | When the review was completed |
| config_key | str | No | |
| entity_creator | EntityCreatorResponse | No | Details about who created the entity |
| entity_creator_id | str | No | ID of who created the entity |
| escalated_at | float | No | When the item was escalated |
| escalated_by | str | No | ID of the moderator who escalated the item |
| escalation_metadata | EscalationMetadata | No | Escalation details including reason, notes, and priority |
| feeds_v2_activity | EnrichedActivity | No | Associated feed activity |
| feeds_v2_reaction | Reaction | No | Associated feed reaction |
| feeds_v3_activity | FeedsV3ActivityResponse | No | |
| feeds_v3_comment | FeedsV3CommentResponse | No | |
| message | MessageResponse | No | Associated message details |
| moderation_payload | ModerationPayloadResponse | No | Content being moderated |
| reaction | Reaction | No | |
| reviewed_at | float | No | When the item was reviewed |
| teams | List[str] | No | Teams associated with this item |
RuleBuilderAction
class RuleBuilderAction(TypedDict, total=False):
ban_options: BanOptions
call_options: CallActionOptions
flag_user_options: FlagUserOptions
skip_inbox: bool
type: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| ban_options | BanOptions | No | |
| call_options | CallActionOptions | No | |
| flag_user_options | FlagUserOptions | No | |
| skip_inbox | bool | No | |
| type | str | No |
RuleBuilderCondition
class RuleBuilderCondition(TypedDict, total=False):
call_custom_property_params: CallCustomPropertyParameters
call_type_rule_params: CallTypeRuleParameters
call_violation_count_params: CallViolationCountParameters
closed_caption_rule_params: ClosedCaptionRuleParameters
confidence: float
content_count_rule_params: ContentCountRuleParameters
content_flag_count_rule_params: FlagCountRuleParameters
image_content_params: ImageContentParameters
image_rule_params: ImageRuleParameters
keyframe_rule_params: KeyframeRuleParameters
text_content_params: TextContentParameters
text_rule_params: TextRuleParameters
type: str
user_created_within_params: UserCreatedWithinParameters
user_custom_property_params: UserCustomPropertyParameters
user_flag_count_rule_params: FlagCountRuleParameters
user_identical_content_count_params: UserIdenticalContentCountParameters
user_role_params: UserRoleParameters
user_rule_params: UserRuleParameters
video_content_params: VideoContentParameters
video_rule_params: VideoRuleParametersProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| call_custom_property_params | CallCustomPropertyParameters | No | |
| call_type_rule_params | CallTypeRuleParameters | No | |
| call_violation_count_params | CallViolationCountParameters | No | |
| closed_caption_rule_params | ClosedCaptionRuleParameters | No | |
| confidence | float | No | |
| content_count_rule_params | ContentCountRuleParameters | No | |
| content_flag_count_rule_params | FlagCountRuleParameters | No | |
| image_content_params | ImageContentParameters | No | |
| image_rule_params | ImageRuleParameters | No | |
| keyframe_rule_params | KeyframeRuleParameters | No | |
| text_content_params | TextContentParameters | No | |
| text_rule_params | TextRuleParameters | No | |
| type | str | No | |
| user_created_within_params | UserCreatedWithinParameters | No | |
| user_custom_property_params | UserCustomPropertyParameters | No | |
| user_flag_count_rule_params | FlagCountRuleParameters | No | |
| user_identical_content_count_params | UserIdenticalContentCountParameters | No | |
| user_role_params | UserRoleParameters | No | |
| user_rule_params | UserRuleParameters | No | |
| video_content_params | VideoContentParameters | No | |
| video_rule_params | VideoRuleParameters | No |
RuleBuilderConditionGroup
class RuleBuilderConditionGroup(TypedDict, total=False):
conditions: List[RuleBuilderCondition]
logic: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| conditions | List[RuleBuilderCondition] | No | |
| logic | str | No |
RuleBuilderConfig
class RuleBuilderConfig(TypedDict, total=False):
async: bool
rules: List[RuleBuilderRule]Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| async | bool | No | |
| rules | List[RuleBuilderRule] | No |
RuleBuilderRule
class RuleBuilderRule(TypedDict, total=False):
action: RuleBuilderAction
action_sequences: List[CallRuleActionSequence]
conditions: List[RuleBuilderCondition]
cooldown_period: str
groups: List[RuleBuilderConditionGroup]
id: str
logic: str
rule_type: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| rule_type | str | Yes | |
| action | RuleBuilderAction | No | |
| action_sequences | List[CallRuleActionSequence] | No | |
| conditions | List[RuleBuilderCondition] | No | |
| cooldown_period | str | No | |
| groups | List[RuleBuilderConditionGroup] | No | |
| id | str | No | |
| logic | str | No |
ShadowBlockActionRequestPayload
Configuration for shadow block action
class ShadowBlockActionRequestPayload(TypedDict, total=False):
reason: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| reason | str | No | Reason for shadow blocking |
SortParamRequest
class SortParamRequest(TypedDict, total=False):
direction: int
field: str
type: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| direction | int | No | Direction of sorting, 1 for Ascending, -1 for Descending, default is 1. One o... |
| field | str | No | Name of field to sort by |
| type | str | No | Type of field to sort by. Empty string or omitted means string type (default)... |
SubmitActionResponse
class SubmitActionResponse(TypedDict, total=False):
appeal_item: AppealItemResponse
duration: str
item: ReviewQueueItemResponseProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | str | Yes | |
| appeal_item | AppealItemResponse | No | Updated Appeal item after action was performed |
| item | ReviewQueueItemResponse | No | Updated review queue item after action was performed |
TextContentParameters
class TextContentParameters(TypedDict, total=False):
blocklist_match: List[str]
contains_url: bool
harm_labels: List[str]
label_operator: str
llm_harm_labels: Dict[str, Any]
severity: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| blocklist_match | List[str] | No | |
| contains_url | bool | No | |
| harm_labels | List[str] | No | |
| label_operator | str | No | |
| llm_harm_labels | Dict[str, Any] | No | |
| severity | str | No |
TextRuleParameters
class TextRuleParameters(TypedDict, total=False):
blocklist_match: List[str]
contains_url: bool
harm_labels: List[str]
llm_harm_labels: Dict[str, Any]
semantic_filter_min_threshold: float
semantic_filter_names: List[str]
severity: str
threshold: int
time_window: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| blocklist_match | List[str] | No | |
| contains_url | bool | No | |
| harm_labels | List[str] | No | |
| llm_harm_labels | Dict[str, Any] | No | |
| semantic_filter_min_threshold | float | No | |
| semantic_filter_names | List[str] | No | |
| severity | str | No | |
| threshold | int | No | |
| time_window | str | No |
TriggeredRuleResponse
class TriggeredRuleResponse(TypedDict, total=False):
actions: List[str]
call_options: CallActionOptions
rule_id: str
rule_name: str
violation_number: intProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| actions | List[str] | Yes | Action types resolved from the rule's action sequence |
| rule_id | str | Yes | ID of the moderation rule that triggered |
| call_options | CallActionOptions | No | Options for call actions (mute settings, warning text, kick reason) |
| rule_name | str | No | Name of the moderation rule that triggered |
| violation_number | int | No | Violation count for action sequence rules (1-based) |
UnbanActionRequestPayload
Configuration for unban moderation action
class UnbanActionRequestPayload(TypedDict, total=False):
channel_cid: str
decision_reason: str
remove_future_channels_ban: boolProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| channel_cid | str | No | Channel CID for channel-specific unban |
| decision_reason | str | No | Reason for the appeal decision |
| remove_future_channels_ban | bool | No | Also remove the future channels ban for this user |
UnbanResponse
class UnbanResponse(TypedDict, total=False):
duration: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | str | Yes |
UnblockActionRequestPayload
Configuration for unblock action
class UnblockActionRequestPayload(TypedDict, total=False):
decision_reason: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| decision_reason | str | No | Reason for the appeal decision |
UnmuteResponse
class UnmuteResponse(TypedDict, total=False):
duration: str
non_existing_users: List[str]Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | str | Yes | |
| non_existing_users | List[str] | No | A list of users that can't be found. Common cause for this is deleted users |
UpsertConfigResponse
class UpsertConfigResponse(TypedDict, total=False):
config: ConfigResponse
duration: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | str | Yes | |
| config | ConfigResponse | No | The created or updated moderation configuration |
UpsertModerationRuleResponse
Basic response information
class UpsertModerationRuleResponse(TypedDict, total=False):
duration: str
rule: ModerationRuleV2ResponseProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| duration | str | Yes | Duration of the request in milliseconds |
| rule | ModerationRuleV2Response | No |
UpsertModerationTemplateResponse
class UpsertModerationTemplateResponse(TypedDict, total=False):
config: FeedsModerationTemplateConfigPayload
created_at: float
duration: str
name: str
updated_at: floatProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| created_at | float | Yes | When the template was created |
| duration | str | Yes | |
| name | str | Yes | Name of the moderation template |
| updated_at | float | Yes | When the template was last updated |
| config | FeedsModerationTemplateConfigPayload | No | Configuration for the moderation template |
User
class User(TypedDict, total=False):
data: Dict[str, Any]
id: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| id | str | Yes | |
| data | Dict[str, Any] | No |
UserCreatedWithinParameters
class UserCreatedWithinParameters(TypedDict, total=False):
max_age: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| max_age | str | No |
UserCustomPropertyParameters
class UserCustomPropertyParameters(TypedDict, total=False):
operator: str
property_key: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| operator | str | No | |
| property_key | str | No |
UserIdenticalContentCountParameters
class UserIdenticalContentCountParameters(TypedDict, total=False):
threshold: int
time_window: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| threshold | int | No | |
| time_window | str | No |
UserMuteResponse
class UserMuteResponse(TypedDict, total=False):
created_at: float
expires: float
target: UserResponse
updated_at: float
user: UserResponseProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| created_at | float | Yes | |
| updated_at | float | Yes | |
| expires | float | No | |
| target | UserResponse | No | |
| user | UserResponse | No |
UserRequest
User request object
class UserRequest(TypedDict, total=False):
custom: Dict[str, Any]
id: str
image: str
invisible: bool
language: str
name: str
privacy_settings: PrivacySettingsResponse
role: str
teams: List[str]
teams_role: Dict[str, Any]Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| id | str | Yes | User ID |
| custom | Dict[str, Any] | No | Custom user data |
| image | str | No | User's profile image URL |
| invisible | bool | No | |
| language | str | No | |
| name | str | No | Optional name of user |
| privacy_settings | PrivacySettingsResponse | No | |
| role | str | No | User's global role |
| teams | List[str] | No | List of teams the user belongs to |
| teams_role | Dict[str, Any] | No | Map of team-specific roles for the user |
UserResponse
User response object
class UserResponse(TypedDict, total=False):
avg_response_time: int
ban_expires: float
banned: bool
blocked_user_ids: List[str]
bypass_moderation: bool
created_at: float
custom: Dict[str, Any]
deactivated_at: float
deleted_at: float
devices: List[DeviceResponse]
id: str
image: str
invisible: bool
language: str
last_active: float
name: str
online: bool
privacy_settings: PrivacySettingsResponse
push_notifications: PushNotificationSettingsResponse
revoke_tokens_issued_before: float
role: str
shadow_banned: bool
teams: List[str]
teams_role: Dict[str, Any]
updated_at: floatProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| banned | bool | Yes | Whether a user is banned or not |
| blocked_user_ids | List[str] | Yes | |
| created_at | float | Yes | Date/time of creation |
| custom | Dict[str, Any] | Yes | Custom data for this object |
| id | str | Yes | Unique user identifier |
| invisible | bool | Yes | |
| language | str | Yes | Preferred language of a user |
| online | bool | Yes | Whether a user online or not |
| role | str | Yes | Determines the set of user permissions |
| shadow_banned | bool | Yes | Whether a user is shadow banned |
| teams | List[str] | Yes | List of teams user is a part of |
| updated_at | float | Yes | Date/time of the last update |
| avg_response_time | int | No | |
| ban_expires | float | No | Date when ban expires |
| bypass_moderation | bool | No | |
| deactivated_at | float | No | Date of deactivation |
| deleted_at | float | No | Date/time of deletion |
| devices | List[DeviceResponse] | No | List of devices user is using |
| image | str | No | |
| last_active | float | No | Date of last activity |
| name | str | No | Optional name of user |
| privacy_settings | PrivacySettingsResponse | No | User privacy settings |
| push_notifications | PushNotificationSettingsResponse | No | User push notification settings |
| revoke_tokens_issued_before | float | No | Revocation date for tokens |
| teams_role | Dict[str, Any] | No |
UserRoleParameters
class UserRoleParameters(TypedDict, total=False):
operator: str
role: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| operator | str | No | |
| role | str | No |
UserRuleParameters
class UserRuleParameters(TypedDict, total=False):
max_age: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| max_age | str | No |
VelocityFilterConfig
class VelocityFilterConfig(TypedDict, total=False):
advanced_filters: bool
async: bool
cascading_actions: bool
cids_per_user: int
enabled: bool
first_message_only: bool
rules: List[VelocityFilterConfigRule]Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| advanced_filters | bool | No | |
| async | bool | No | |
| cascading_actions | bool | No | |
| cids_per_user | int | No | |
| enabled | bool | No | |
| first_message_only | bool | No | |
| rules | List[VelocityFilterConfigRule] | No |
VelocityFilterConfigRule
class VelocityFilterConfigRule(TypedDict, total=False):
action: str
ban_duration: int
cascading_action: str
cascading_threshold: int
check_message_context: bool
fast_spam_threshold: int
fast_spam_ttl: int
ip_ban: bool
probation_period: int
shadow_ban: bool
slow_spam_ban_duration: int
slow_spam_threshold: int
slow_spam_ttl: int
url_only: boolProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| action | str | Yes | |
| ban_duration | int | No | |
| cascading_action | str | No | |
| cascading_threshold | int | No | |
| check_message_context | bool | No | |
| fast_spam_threshold | int | No | |
| fast_spam_ttl | int | No | |
| ip_ban | bool | No | |
| probation_period | int | No | |
| shadow_ban | bool | No | |
| slow_spam_ban_duration | int | No | |
| slow_spam_threshold | int | No | |
| slow_spam_ttl | int | No | |
| url_only | bool | No |
VideoCallRuleConfig
class VideoCallRuleConfig(TypedDict, total=False):
flag_all_labels: bool
flagged_labels: List[str]
rules: List[HarmConfig]Properties:
| Property | Type | Required | Description |
|---|---|---|---|
| flag_all_labels | bool | No | |
| flagged_labels | List[str] | No | |
| rules | List[HarmConfig] | No |
VideoContentParameters
class VideoContentParameters(TypedDict, total=False):
harm_labels: List[str]
label_operator: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| harm_labels | List[str] | No | |
| label_operator | str | No |
VideoRuleParameters
class VideoRuleParameters(TypedDict, total=False):
harm_labels: List[str]
threshold: int
time_window: strProperties:
| Property | Type | Required | Description |
|---|---|---|---|
| harm_labels | List[str] | No | |
| threshold | int | No | |
| time_window | str | No |