Skip to main content
Moderation Status: PENDINGAPPROVED or DISAPPROVED Supported Types: Text, Image, Video messages

Overview

AI Moderation in the CometChat SDK helps ensure that your chat application remains safe and compliant by automatically reviewing messages for inappropriate content. This feature leverages AI to moderate messages in real-time, reducing manual intervention and improving user experience.
Available via: SDK | REST API | UI Kits | Dashboard
For a broader understanding of moderation features, configuring rules, and managing flagged messages, see the Moderation Overview.

Prerequisites

Before using AI Moderation, ensure the following:
  1. Moderation is enabled for your app in the CometChat Dashboard
  2. Moderation rules are configured under Moderation > Rules
  3. You’re using CometChat SDK version that supports moderation

How It Works

Supported Message Types

Moderation is triggered only for the following message types: Moderation applies to TextMessage and MediaMessage types. | Custom Messages | ❌ | Not subject to AI moderation | | Action Messages | ❌ | Not subject to AI moderation |

Moderation Status

The moderationStatus property returns one of the following enum values:

Implementation

Step 1: Send a Message and Check Initial Status

When you send a text, image, or video message, check the initial moderation status:
On Success — A TextMessage object containing all details of the sent message, including the initial moderation status:TextMessage Object:
sender Object:
receiver Object:

Step 2: Listen for Moderation Results

Implement the MessageListener to receive moderation results in real-time:

Step 3: Handle Disapproved Messages

When a message is disapproved, handle it appropriately in your UI:

Next Steps

After implementing AI Moderation, explore these related features:

AI Agents

Build intelligent AI-powered agents for automated conversations

Flag Message

Allow users to manually report inappropriate messages

AI Chatbots

Create automated chatbot experiences for your users

Receive Messages

Handle incoming messages and moderation events