curl --request POST \
--url https://apimgmt.cometchat.io/apps/{appId}/moderation/rules \
--header 'Content-Type: application/json' \
--header 'key: <key>' \
--header 'secret: <secret>' \
--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"
}
}
Create a new moderation rule to specify actions and conditions for detecting and handling inappropriate content.
curl --request POST \
--url https://apimgmt.cometchat.io/apps/{appId}/moderation/rules \
--header 'Content-Type: application/json' \
--header 'key: <key>' \
--header 'secret: <secret>' \
--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"
}
}
AppID in which the extension has to be enabled/disabled
Created Rule
The response is of type object
.
Was this page helpful?