Skip to main content
Quick Reference for AI Agents & Developers
  • Get flag reasons: CometChat.getFlagReasons(onSuccess:onError:)
  • Flag message: CometChat.flagMessage(messageId:detail:onSuccess:onError:)
  • Review flagged: CometChat Dashboard → Moderation → Flagged Messages
  • Related: Moderation · AI Moderation · Messaging Overview

Overview

Flagging messages allows users to report inappropriate content to moderators or administrators. When a message is flagged, it appears in the CometChat Dashboard under Moderation > Flagged Messages for review.
For a complete understanding of how flagged messages are reviewed and managed, see the Flagged Messages documentation.

Prerequisites

Before using the flag message feature:

How It Works


Get Flag Reasons

Before flagging a message, retrieve the list of available flag reasons configured in your Dashboard:
Method: CometChat.getFlagReasons(onSuccess:onError:)No parameters required.

Flag a Message

To flag a message, use the flagMessage() method with the message ID and a FlagDetail object:
Method: CometChat.flagMessage(messageId:detail:onSuccess:onError:)FlagDetail Object:
Request:Swift Code:

Implementation Flow


Complete Example


Common Error Codes