Skip to main content
The moderation API returns a structured response that helps you decide how to handle content. Here’s an example response:
Example response
How you act on the response is up to you:
  • Block the content and return an error message to your user if it gets flagged
  • Store it to your database and let a human review it using review queues
  • Do something in between and only review content when the AI is not confident in its decision

Use the recommendation

The easiest way to handle moderation responses is to use the recommendation object. It provides a clear action based on your channel configuration, severity scores, and author status.
The reason_codes array tells you why a particular recommendation was made:

Check if flagged

For simple use cases, you can check the evaluation.flagged field. This boolean indicates if any of your enabled policies detected something that triggered a flag.

Severity score

The severity_score gives you more granular control. Higher scores indicate more severe violations:
We recommend using the recommendation.action field instead of implementing your own threshold logic. Configure thresholds in your channel settings for easier management.

Work with individual policies

The policies array contains results from each policy enabled in your channel, sorted by highest probability. Each policy includes:

Classifier policies

Classifier policies (like toxicity, spam, hate) analyze content and return a probability score:

Entity matcher policies

Entity matcher policies (like personal_information, url) detect and extract specific entities:

Handle masked content

If you have PII masking enabled, the API can automatically redact sensitive information. Check the content object:
This is useful for:
  • Anonymizing content before storing in your database
  • Preventing users from seeing personal information
  • Compliance with data protection regulations

Check author status

If you’re using author management, the response includes author information:

Use insights

The insights array provides additional analysis that doesn’t affect flagging:

Detect unicode spoofing

Spammers sometimes use look-alike characters to bypass moderation (e.g., mоney with a Cyrillic “о” instead of Latin “o”). The API detects and normalizes these characters. Check the unicode_spoofed field:
The field is omitted when neither normalization nor the Unicode spoofing policy is enabled on the channel, since nothing analyzed the text. To flag and route spoofed content rather than just observe it, enable the Unicode spoofing policy.

Handle errors

Check meta.status for the overall request status:
The errors array contains details about any policies that encountered issues during processing.