Skip to main content
GET
/
moderation
/
rules
List Rules
curl --request GET \
  --url https://{appid}.api-{region}.cometchat.io/v3/moderation/rules \
  --header 'apikey: <api-key>'
{
  "data": [
    {
      "id": "moderation-test",
      "name": "Video Moderation",
      "description": "AI-powered video moderation to detect unsafe content.",
      "enabled": true,
      "conditions": [
        {
          "id": 1,
          "isKeywordsReferencePresent": false,
          "isMediaPresent": true,
          "entity": "message",
          "operand": "image",
          "category": "word",
          "operator": "contains",
          "value": [
            "violence_greaterThan_30"
          ],
          "message": [
            "Image contains violence with confidence greater than 30"
          ]
        }
      ],
      "action": [
        "blockMessage"
      ],
      "active": true,
      "createdAt": 1720003247,
      "updatedAt": 1720003247,
      "revisionId": "253179cf5f665257_moderation-test_1"
    },
    {
      "id": "video-moderation1",
      "name": "Video Moderation",
      "description": "AI-powered video moderation to detect unsafe content.",
      "enabled": true,
      "conditions": [
        {
          "id": 1,
          "isKeywordsReferencePresent": false,
          "isMediaPresent": true,
          "entity": "message",
          "operand": "image",
          "category": "word",
          "operator": "contains",
          "value": [
            "violence_greaterThan_30"
          ],
          "message": [
            "Image contains violence with confidence greater than 30"
          ]
        }
      ],
      "action": [
        "blockMessage"
      ],
      "active": true,
      "createdAt": 1720000488,
      "updatedAt": 1720000488,
      "revisionId": "253179cf5f665257_video-moderation1_1"
    },
    {
      "id": "text-profanity-filter",
      "name": "Text Profanity filter",
      "description": "Detect and censor profanity in text messages.",
      "enabled": true,
      "conditions": [
        {
          "id": 1,
          "isKeywordsReferencePresent": true,
          "isMediaPresent": false,
          "entity": "message",
          "operand": "text",
          "category": "word",
          "operator": "contains",
          "value": [
            "profanity-list"
          ]
        }
      ],
      "action": [
        "blockMessage"
      ],
      "active": true,
      "createdAt": 1718355386,
      "updatedAt": 1720006272,
      "revisionId": "253157108b5294c4_profanity-filter_25",
      "default": true
    },
    {
      "id": "image-moderation",
      "name": "AI Image Moderation",
      "description": "AI-powered image moderation to detect unsafe content.",
      "enabled": false,
      "conditions": [
        {
          "id": 1,
          "isKeywordsReferencePresent": false,
          "isMediaPresent": true,
          "entity": "message",
          "operand": "image",
          "category": "word",
          "operator": "contains",
          "value": [
            "AnyOf_greaterThan_30"
          ]
        }
      ],
      "action": [
        "blockMessage"
      ],
      "active": true,
      "createdAt": 1718350200,
      "updatedAt": 1719932600,
      "revisionId": "253157108b5294c4_image-moderation_11",
      "default": true
    },
    {
      "id": "video-moderation",
      "name": "AI Video Moderation",
      "description": "AI-powered video moderation to detect unsafe content.",
      "enabled": false,
      "conditions": [
        {
          "id": 1,
          "isKeywordsReferencePresent": false,
          "isMediaPresent": true,
          "entity": "message",
          "operand": "video",
          "category": "word",
          "operator": "contains",
          "value": [
            "AnyOf_greaterThan_30"
          ]
        }
      ],
      "action": [
        "dropMessage"
      ],
      "active": true,
      "createdAt": 1718350199,
      "updatedAt": 1720006008,
      "revisionId": "253157108b5294c4_video-moderation_10",
      "default": true
    },
    {
      "id": "custom-profanity-filter",
      "name": "Custom Profanity filter",
      "description": "Detect and censor profanity in custom messages.",
      "enabled": false,
      "conditions": [
        {
          "id": 1,
          "isListReferencePresent": true,
          "isMediaPresent": false,
          "entity": "message",
          "operand": "custom",
          "category": "word",
          "operator": "contains",
          "value": [
            "profanity-list"
          ]
        }
      ],
      "action": [
        "dropMessage"
      ],
      "active": true,
      "createdAt": 1718341200,
      "updatedAt": 1719819136,
      "revisionId": "253157108b5294c4_profanity-filter_8",
      "default": true
    },
    {
      "id": "contact_details_filter",
      "name": "Contact details filter",
      "description": "Identifies and removes phone numbers from text",
      "enabled": false,
      "conditions": [
        {
          "id": 1,
          "isKeywordsReferencePresent": false,
          "isMediaPresent": false,
          "entity": "message",
          "operand": "text",
          "category": "pattern",
          "operator": "contains",
          "value": [
            "\\\\+?(\\\\d{1,3})?{-.\\\\s}?\\\\(?\\\\d{1,4}?\\\\)?{-.\\\\s}?\\\\d{1,4}{-.\\\\s}?\\\\d{1,4}{-.\\\\s}?\\\\d{1,9}"
          ]
        },
        {
          "id": 2,
          "isKeywordsReferencePresent": false,
          "isMediaPresent": false,
          "entity": "message",
          "operand": "custom",
          "category": "pattern",
          "operator": "contains",
          "value": [
            "\\\\+?(\\\\d{1,3})?{-.\\\\s}?\\\\(?\\\\d{1,4}?\\\\)?{-.\\\\s}?\\\\d{1,4}{-.\\\\s}?\\\\d{1,4}{-.\\\\s}?\\\\d{1,9}"
          ]
        }
      ],
      "action": [
        "blockMessage"
      ],
      "active": true,
      "createdAt": 1718186338,
      "updatedAt": 1719836048,
      "revisionId": "2531882e5e289115_contact_details_filter_3",
      "default": true
    },
    {
      "id": "email_filter",
      "name": "Email filter",
      "description": "Identify and remove email address from messages",
      "enabled": false,
      "conditions": [
        {
          "id": 1,
          "isKeywordsReferencePresent": false,
          "isMediaPresent": false,
          "entity": "message",
          "operand": "text",
          "category": "pattern",
          "operator": "contains",
          "value": [
            "^{a-zA-Z0-9._%+-}+@{a-zA-Z0-9.-}+\\\\.{a-zA-Z}{2,}$"
          ]
        },
        {
          "id": 2,
          "isKeywordsReferencePresent": false,
          "isMediaPresent": false,
          "entity": "message",
          "operand": "custom",
          "category": "pattern",
          "operator": "contains",
          "value": [
            "^{a-zA-Z0-9._%+-}+@{a-zA-Z0-9.-}+\\\\.{a-zA-Z}{2,}$"
          ]
        }
      ],
      "action": [
        "blockMessage"
      ],
      "active": true,
      "createdAt": 1718099938,
      "updatedAt": 1719836049,
      "revisionId": "2531882e5e289115_contact_email_filter_5",
      "default": true
    }
  ],
  "meta": {
    "current": {
      "limit": 50,
      "count": 8
    }
  }
}

Documentation Index

Fetch the complete documentation index at: https://cometchat-22654f5b-docs-v6-beta2-flutter-uikit.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

apikey
string
header
required

API Key with fullAccess scope(i.e. Rest API Key from the Dashboard).

Query Parameters

limit
string

The number of records to fetch.

Response

200 - application/json

List Rule

data
object