/moderate endpoint. The API accepts different content types (text, image, object, video, audio) and returns results immediately.
Content metadata
You can add metadata to the content you send for moderation. Some fields are used by the moderation pipeline to improve accuracy, while others enhance the dashboard experience.contentId
Specify acontentId to associate the request with specific content. This is typically the content’s unique identifier from your database.
If you don’t specify a contentId, the API generates a random ID for the content.
When you include a contentId, submitting the same ID again updates the existing content. This is useful when using review queues - you can update content in the queue without creating duplicate items.
The contentId can also be used to execute actions in the review queue programmatically. For example, you can allow users to report content on your platform and then add it to a review queue.
conversationId
UseconversationId to group related content together, such as messages in a chatroom or comments on a post.
If you’re using review queues, the conversationId can filter the queue to show content from a specific conversation.
Enable context awareness to improve moderation accuracy using the conversationId.
authorId
UseauthorId to identify the user who created the content.
This enables user-level moderation in review queues and allows filtering by specific users.
Enable context awareness to improve moderation accuracy using the authorId.
metaType
UsemetaType to specify what kind of content you’re moderating. This helps the API apply appropriate analysis:
| Value | Use case |
|---|---|
message | Chat messages, direct messages |
post | Forum posts, social media posts |
comment | Comments on posts or articles |
review | Product or service reviews |
profile | User profile information |
product | Product listings |
event | Event descriptions |
other | Any other content type |
channel
Usechannel to route content to a specific channel configuration. If not provided, the project’s default channel is used.
metadata
Usemetadata to attach any additional information to the request. This object can contain custom key-value pairs.
Metadata is displayed in review queues and included in webhooks.
Context awareness
EnableContext awareness in your channel settings, then include authorId and/or conversationId in API requests. This allows models to analyze previous messages for improved accuracy.
When context awareness is enabled, models analyze the current message alongside recent conversation history. The API retrieves previous messages with the same conversationId or authorId and provides them to the model sequentially, allowing it to understand the full context before making a decision.
LLM-based policies can use the conversationId to see previous messages in the same conversation, and authorId to see previous messages from the same author.
This can prevent unwanted content spread across multiple messages:
Content types
The/moderate endpoint accepts different content types through the content object:
Text
Analyze text content
Image
Analyze image content
Object
Analyze mixed content types
Video (enterprise)
Analyze video content
Audio (enterprise)
Analyze audio content
Text
Text moderation is the most common type. Use it for:- Chat messages
- Forum posts
- Comments
- Reviews
- Product descriptions
- Profile bios
Image
Image moderation analyzes visual content to detect inappropriate or harmful images, including nudity, violence, or other objectionable content.Object
Object moderation analyzes multiple fields at once, useful for moderating entire entities like user profiles or product listings.flagged_fields in each policy result, showing which specific fields triggered the flag.
Audio (enterprise)
Audio moderation analyzes audio content to detect inappropriate language or sounds. Useful for podcasts, voice messages, or other audio content.Video (enterprise)
Video moderation analyzes video content to detect inappropriate scenes or actions, including violence, nudity, or other objectionable content.Opt out of content store
SetdoNotStore to true to prevent the content from being stored. The content will still be analyzed but won’t appear in the dashboard or review queues.