Skip to main content
The Moderation API provides endpoints for managing content moderation rules and keyword lists. You can define rules that automatically detect and block inappropriate content in messages, including text profanity, AI-based image/video moderation, and custom keyword filters.

Key Behaviors

  • Default rules cover text profanity, AI-based image/video moderation, custom profanity, contact details, and email content.
  • Text and custom profanity filters scan for words (including regex patterns) and drop the message if a violation is detected.
  • AI-based image/video moderation scans attachments and discards the message if a violation is found.
  • When a rule is violated, the message is blocked. Optionally, the sender can be kicked or banned (in groups) or blocked (in 1-on-1 conversations).

How Moderation Connects to Other Resources

  • Messages — Moderation rules are evaluated against Messages in real time before delivery.
  • Groups — Violations in group messages can trigger member kicks or bans via Group Members and Banned Users.
  • Blocked Users — Violations in 1-on-1 messages can trigger a block on the sender.

Available Endpoints

AI Image and Video Moderation Labels

API Constraints

Need higher limits? Contact CometChat Support to discuss enterprise options.
| Parameter | Limit | |-----------|-------| | Rule ID | Max 100 characters, no spaces or special characters | | Name | Max 100 characters | | Description | Max 255 characters | | Filters per rule | Max 10 filters | | Conditions per rule | Max 10 conditions | | Rules per app | Max 25 custom rules (excludes default rules) |

Error Handling

For the complete list of error codes, see Error Codes. For system limits, see Properties and Constraints.