Skip to main content
PUT
/
moderation
/
rules
/
{ruleId}
Update Rule
curl --request PUT \
  --url https://{appid}.api-{region}.cometchat.io/v3/moderation/rules/{ruleId} \
  --header 'Content-Type: application/json' \
  --header 'apikey: <api-key>' \
  --data '
{
  "id": "moderation-test",
  "name": "Video Moderation",
  "enabled": true,
  "description": "AI-powered video moderation to detect unsafe content.",
  "action": [
    "blockMessage"
  ],
  "filters": [
    {
      "type": "sender",
      "entity": "user",
      "operand": "uid",
      "operator": "equals",
      "value": "admin"
    }
  ],
  "conditions": [
    {
      "id": 1,
      "entity": "message",
      "operand": "image",
      "operator": "contains",
      "category": "word",
      "isKeywordReferencePresent": false,
      "isMediaPresent": true,
      "value": "violence_greaterThan_30"
    }
  ]
}
'
{
  "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"
  }
}

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).

Path Parameters

ruleId
string
required

Rule ID

Body

application/json
id
string

Unique identifier for the moderation rule.

Example:

"moderation-test"

name
string

Descriptive name for the moderation rule.

Example:

"Video Moderation"

enabled
boolean

Indicates whether the rule is active.

Example:

true

description
string

Detailed explanation of the rule's purpose.

Example:

"AI-powered video moderation to detect unsafe content."

action
string[]

Actions to be taken when a violation is detected.

filters
object[]

List of filters to apply

conditions
object[]

List of conditions that must be met for the rule to trigger.

Response

200 - application/json

Update Rule

data
object