const response = await client.moderation.queryReviewQueue(
{ entity_type: "stream:chat:v1:message" },
[{ field: "created_at", direction: -1 }],
{ next: null }
)
for (const item of response.items) {
console.log(item.message.id)
console.log(item.message.text)
console.log(item.message.type)
console.log(item.message.created_at)
}
console.log(next) // <-- next cursor for pagination
Frequently Asked Questions
Here are some of the frequently asked questions about the moderation dashboard.
- How To Review Only Flagged Content?
- Does Image Moderation Work With Custom CDN?
- Can We Customize The Action Buttons On Review Queue?
- What Is The Difference Between Inbox And Reviewed Tab?
- What Is An Entity Within Stream Moderation APIs?
- What Is A Review Queue?
- How To Query Flagged Chat Messages?
- Get Webhook Event For New Flagged Messages?
- How To Handle False Positives?
- Can I Use Moderation For Custom Content?
- How to Export Review Queue Data?
How To Review Only Flagged Content?
By default, the review queue shows all the content that is picked up by the moderation engines or manually flagged by the users of the application.
In some cases you might want to exclude the content which is blocked and only review the flagged content. You can achieve this by setting the Action
filter.
- Go to Text Queue by clicking on the
Text
tab in the sidebar. - At top of the page, you will see all the filters. Select the filter
Action
and selectflag
in the dropdown.
All the content which is blocked will be excluded from the review queue.
You can simply bookmark the URL with the Action
filter set to flag
to review only the flagged content.
Does Image Moderation Work With Custom CDN?
Yes, the image moderation works independent of type of CDN. You can use any CDN to host your images and the moderation will work as expected. You just need to make sure that the image urls are accessible from the internet.
Can We Customize The Action Buttons On Review Queue?
Yes, you can customize the action buttons on the review queue. But currently this change needs to be done by the Stream team. So please reach out to Stream Support Team if you would like to make any changes to the action buttons. We can accomodate following customizations:
- Change the text of the button
- Hide the button
- Replace the button with a custom link
What Is The Difference Between Inbox And Reviewed Tab?
Inbox tab shows all the content which is picked up by the moderation engines or manually flagged by the users of the application. Reviewed tab shows all the content which has been reviewed by the moderators.
What Is An Entity Within Stream Moderation APIs?
In the context of the Moderation API, an “entity” is a piece of content submitted for moderation. This can be text, an image, a video, or even a user profile, as the API supports flagging users. Each entity requires a unique identifier when sent for moderation through the Check API endpoint.
What Is A Review Queue?
A review queue is a list of flagged entities, either by AI moderation or platform users. This queue is displayed on the Stream dashboard for your company’s moderators to review and take action on.
How To Query Flagged Chat Messages?
You can query all the review queue items related to flagged messages as following (Sample Response):
Get Webhook Event For New Flagged Messages?
Since v2 moderation extends beyond chat, the message.flagged
event is now obsolete. In v2 moderation, we’ve introduced a separate webhook to track all content flagged by AI, blocklist, or
manual moderation. When a message is flagged, you’ll receive a review_queue_item.new
event. If an already flagged message is flagged again (by a user, moderator, or AI), you’ll receive a
review_queue_item.updated
event.
To set up the webhook URL, please refer to the How to Configure Moderation Webhook section.
Newly created flags are included in the event payload’s flags
property.
How To Handle False Positives?
If you are seeing a lot of false positives, it could be the policy being too strict.
- Semantic Filters: If you have configured semantic filters, you can try to relax the policy by increasing the threshold for similarity score. Please refer to the Semantic Filters section for more details.
- Image Moderation: If you are using image moderation, you can try to relax the policy by increasing the confidence score threshold. Please refer to the Image Moderation section for more details.
- AI Text: If you are using AI Text moderation, you can try to configure action per severity level. Please refer to the AI Text section for more details.
Can I Use Moderation For Custom Content?
Yes, you can use moderation for any custom content. You don’t need to be using Stream’s Chat or Activity Feeds product to use moderation. You can submit any content for moderation by using the Check API.
How to Export Review Queue Data?
We provide all the REST API endpoints to query the review queue data. Please refer to the Review Queue API section for more details. For example, to get list of all the flagged messages, you can use the following code:
const response = await client.moderation.queryReviewQueue(
{ entity_type: "stream:chat:v1:message" },
[{ field: "created_at", direction: -1 }],
{ next: null }
)
for (const item of response.items) {
console.log(item.message.id)
console.log(item.message.text)
console.log(item.message.type)
console.log(item.message.created_at)
}
// If you want to get the next page of results, you can use the following code:
const nextResponse = await client.moderation.queryReviewQueue(
{ entity_type: "stream:chat:v1:message" },
[{ field: "created_at", direction: -1 }],
{ next: response.next }
)
- How To Review Only Flagged Content?
- Does Image Moderation Work With Custom CDN?
- Can We Customize The Action Buttons On Review Queue?
- What Is The Difference Between Inbox And Reviewed Tab?
- What Is An Entity Within Stream Moderation APIs?
- What Is A Review Queue?
- How To Query Flagged Chat Messages?
- Get Webhook Event For New Flagged Messages?
- How To Handle False Positives?
- Can I Use Moderation For Custom Content?
- How to Export Review Queue Data?