Skip to main content

Content Moderation Task Management

Manually manage RTC content moderation tasks. Based on your business scenarios, you can selectively moderate specific calls or specific stages of calls as needed.

Enable the Service

Content Moderation is a paid value-added service. You can log in to the Console and enable the RTC Moderation service on the IM & RTC Moderation page.

Before using the Content Moderation Task Management API, ensure that the RTC Moderation service is enabled in the Console and the relevant configurations are completed. Note that the trigger mode for RTC Moderation must be set to Manual to use the API for controlling moderation tasks.

Start Moderation

When the RTC Moderation service is configured for Manual Start, call this API to initiate a moderation task.

Request Method

POST: https://Data Center Domain/rtc/contentcensor/start.json

Signature Rule: All requests to RC's server APIs require signature validation. For details, refer to API Request Signature.

Request Body Parameters

The HTTP request body contains a JSON object with the following structure:

ParameterTypeRequiredDescription
usersArrayYesList of users for whom moderation tasks need to be started.
users[i].userIdStringYesThe user ID to be moderated.
users[i].interceptFrequencyNumberNoThe frame interception frequency interval (in seconds) for the moderation service, used to adjust the duration between video frame captures for moderation. Valid range: 1–60s. If not provided, the default interval configured in the moderation service backend (default: 3s) will be used. This parameter is only applicable to certain moderation providers (e.g., ShuMei). The corresponding parameter in ShuMei is detectFrequency.
users[i].sceneStringNoThe moderation scenario for the user, corresponding to different moderation policies of the provider (e.g., ShuMei). Only applicable to specific moderation providers (e.g., ShuMei). If no agreement exists with the provider, this field can be omitted.
users[i].censorTypeNumberNoThe type of stream to be moderated for the user. Only applicable to certain moderation providers (e.g., ShuMei). 0: Moderate only the audio stream; 1: Moderate only the video stream; 2: Moderate both audio and video streams. If not provided or an invalid value is passed, the default moderation type configured in the Console (IM & RTC Moderation) under the RTC Service Configuration section will apply.
users[i].streamsArrayYesThe user's RTC stream information.
users[i].streams[i].streamIdStringYesThe stream ID.

Request Example

POST /rtc/contentcensor/start.json HTTP/1.1
Host: api.rong-api.com
App-Key: XXX
Nonce: 1027489915
Timestamp: 1609754958
Signature: 357cef9b529edd1ed4f34bd8df52de00a909914b
Room-Id: 123
Session-Id: 456
Content-Type: application/json

{
"users": [{
"userId": "xxxxx",
"scene": "xxx",
"censorType": 0,
"streams": [{
"streamId": "xxxxx"
}]
},
{
"userId": "xxxx2x",
"scene": "xxx",
"censorType": 1,
"streams": [{
"streamId": "xxx3xx"
},
{
"streamId": "xx4xxx"
}
]
}
]
}

Response

ParameterTypeRequiredDescription
resultCodeNumberYesStatus code.
reasonStringYesDescription of the API call status.

Response Example

The response contains a JSON object with the following structure:

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
"reason": "the roomId or userId was not exist",
"resultCode": 49009
}

Stop Moderation

Moderation tasks are automatically stopped when the session ends. To manually stop a moderation task, call this API.

Request Method

POST: http://api.rong-api.com/rtc/contentcensor/stop.json

Signature Rule: All requests to RC's server APIs require signature validation. For details, refer to API Request Signature.

Request Body Parameters

The HTTP request body contains a JSON object with the following structure:

ParameterTypeRequiredDescription
usersArrayYesList of users for whom moderation tasks need to be stopped.
users[i].userIdStringNoThe user ID.
users[i].streamsArrayNoThe user's RTC stream information.
users[i].streams[i].streamIdStringNoThe stream ID.

Request Example

POST /rtc/contentcensor/stop.json HTTP/1.1
Host: api.rong-api.com
App-Key: XXX
Nonce: 1027489915
Timestamp: 1609754958
Signature: 357cef9b529edd1ed4f34bd8df52de00a909914b
room-id: 123
session-id: 456
Content-Type: application/json

{
"users": [{
"userId": "xxxxx",
"streams": [{
"streamId": "xxxxx"
}]
},
{
"userId": "xxxx2x",
"streams": [{
"streamId": "xxx3xx"
},
{
"streamId": "xx4xxx"
}
]
}
]
}

Response Example

The response contains a JSON object with the following structure:

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
"reason": "the roomId or userId was not exist",
"resultCode": 49009
}