Content Moderation
Moderation task lifecycle, sampling findings and status queries backing the SDK content-inspection capability.
Group overview
Generated at build time from the public REST API definition: tag moderation, 6 operations (out of 230). For authentication, envelope and pagination conventions see REST API overview.
| Method | Path | Summary |
|---|---|---|
POST | /v1/moderation/inspect | Upload a sample for inspection |
GET | /v1/moderation/tasks | List moderation tasks |
POST | /v1/moderation/tasks | Create a moderation task |
GET | /v1/moderation/tasks/{taskId} | Get a moderation task |
GET | /v1/moderation/tasks/{taskId}/findings | List findings of a task |
POST | /v1/moderation/tasks/{taskId}/stop | Stop a moderation task |
Operation details
POST /v1/moderation/inspect
Upload a sample for inspection
Called by the client SDK (ContentInspectConfig / ContentInspectModule) with the task token. The sample is judged by the deployment's moderation provider; a flagged verdict triggers a signed callback to the task callbackUrl. A deployment without a provider answers 503 moderation_provider_unavailable (fail-closed).
Authentication: no credentials required
Request body
| Field | Type | Required | Description |
|---|---|---|---|
mediaType | enum(image | audio | video) | is | |
media | string | is | base64 sample bytes (decoded limit 512 KiB) |
capturedAt | string | format date-time | |
extraInfo | string | length 0..1024 |
{
"mediaType": "image",
"media": "string",
"capturedAt": "string",
"extraInfo": "string"
}Response
| Status codes | Description / schema |
|---|---|
201 | OK — ModerationInspectResult |
400 | Invalid parameter — Error |
401 | Bad/expired task token (moderation_token_invalid) — Error |
403 | Task stopped or media type not declared (moderation_task_inactive) — Error |
413 | Sample too large (moderation_payload_too_large) — Error |
503 | No provider configured (moderation_provider_unavailable) — Error |
Example call
curl -s -X POST "$NIMEET_API_BASE/v1/moderation/inspect" \
-H "Content-Type: application/json" \
-d '{"mediaType":"image","media":"string","capturedAt":"string","extraInfo":"string"}'GET /v1/moderation/tasks
List moderation tasks
Authentication: project credentials (Base64 of customerId:customerSecret)
Parameters
| Name | Location | Required | Type | Description |
|---|---|---|---|---|
status | query | enum(active | stopped) | ||
channelName | query | string | ||
limit | query | integer | 1..200 | |
offset | query | integer | >= 0 |
Response
| Status codes | Description / schema |
|---|---|
200 | OK — object{ tasks, total } |
400 | Invalid parameter — Error |
Example call
curl -s -X GET "$NIMEET_API_BASE/v1/moderation/tasks?status=active&channelName=weekly-sync&limit=50&offset=0" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC"POST /v1/moderation/tasks
Create a moderation task
One active task per (project, channel, uid); a duplicate answers moderation_task_conflict with details.taskId. The response carries the one-time inspectToken and inspectUrl — the SDK uploads samples there (ContentInspectConfig.serverConfig equivalent). providerConfigured=false means the deployment has no moderation provider and uploads will answer 503.
Authentication: project credentials (Base64 of customerId:customerSecret)
Request body
| Field | Type | Required | Description |
|---|---|---|---|
channelName | string | is | pattern ^[A-Za-z0-9_-]{1,128}$ |
uid | integer | null | 1..2147483647 | |
mediaTypes | array<enum(image | audio | video)> | ||
intervalSeconds | integer | 1..3600 | |
callbackUrl | string | null | length 0..2048 | |
metadata | object |
{
"channelName": "weekly-sync",
"uid": 1,
"mediaTypes": [
"image"
]
}Response
| Status codes | Description / schema |
|---|---|
201 | OK — ModerationTaskCreated |
400 | Invalid parameter — Error |
409 | An active task already exists (moderation_task_conflict) — Error |
Example call
curl -s -X POST "$NIMEET_API_BASE/v1/moderation/tasks" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC" \
-H "Content-Type: application/json" \
-d '{"channelName":"weekly-sync","uid":1,"mediaTypes":["image"]}'GET /v1/moderation/tasks/{taskId}
Get a moderation task
Authentication: project credentials (Base64 of customerId:customerSecret)
Parameters
| Name | Location | Required | Type | Description |
|---|---|---|---|---|
taskId | path | is | string |
Response
| Status codes | Description / schema |
|---|---|
200 | OK — ModerationTask |
404 | Unknown task (moderation_task_not_found) — Error |
Example call
curl -s -X GET "$NIMEET_API_BASE/v1/moderation/tasks/taskId" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC"GET /v1/moderation/tasks/{taskId}/findings
List findings of a task
Authentication: project credentials (Base64 of customerId:customerSecret)
Parameters
| Name | Location | Required | Type | Description |
|---|---|---|---|---|
taskId | path | is | string | |
verdict | query | enum(pass | review | block) | ||
limit | query | integer | 1..200 | |
offset | query | integer | >= 0 |
Response
| Status codes | Description / schema |
|---|---|
200 | OK — object{ findings, total } |
404 | Unknown task (moderation_task_not_found) — Error |
Example call
curl -s -X GET "$NIMEET_API_BASE/v1/moderation/tasks/taskId/findings?verdict=pass&limit=50&offset=0" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC"POST /v1/moderation/tasks/{taskId}/stop
Stop a moderation task
Idempotent: stopping an already-stopped task returns it unchanged.
Authentication: project credentials (Base64 of customerId:customerSecret)
Parameters
| Name | Location | Required | Type | Description |
|---|---|---|---|---|
taskId | path | is | string |
Response
| Status codes | Description / schema |
|---|---|
200 | OK — ModerationTask |
404 | Unknown task (moderation_task_not_found) — Error |
Example call
curl -s -X POST "$NIMEET_API_BASE/v1/moderation/tasks/taskId/stop" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC"Schemas used by this group
Error — object{ code, message, reason, sdkCode, details }
| Field | Type | Required | Description |
|---|---|---|---|
code | string | is | stable machine code, see errors.json |
message | string | is | |
reason | string | ||
sdkCode | integer | Agora-aligned client error number | |
details | object |
ModerationFinding — object
| Field | Type | Required | Description |
|---|---|---|---|
findingId | string | is | |
taskId | string | is | |
mediaType | enum(image | audio | video) | is | |
verdict | enum(pass | review | block) | is | |
labels | array<string> | is | |
score | number | null | is | 0..1 |
capturedAt | string | is | format date-time |
receivedAt | string | is | format date-time |
provider | string | is | |
notifiedAt | string | null | is | format date-time |
notifyState | enum(delivered | failed | skipped) | is |
ModerationInspectResult — object{ findingId, verdict, labels, score }
| Field | Type | Required | Description |
|---|---|---|---|
findingId | string | is | |
verdict | enum(pass | review | block) | is | |
labels | array<string> | is | |
score | number | null | is |
ModerationTask — object
| Field | Type | Required | Description |
|---|---|---|---|
taskId | string | is | |
projectId | string | ||
channelName | string | is | |
uid | integer | null | is | 1..2147483647 |
mediaTypes | array<enum(image | audio | video)> | is | |
intervalSeconds | integer | is | 1..3600 |
callbackUrl | string | null | ||
status | enum(active | stopped) | is | |
inspectUrl | string | ||
inspectedCount | integer | is | >= 0 |
flaggedCount | integer | is | >= 0 |
metadata | object | ||
createdAt | string | is | format date-time |
updatedAt | string | is | format date-time |
stoppedAt | string | null | is | format date-time |
ModerationTaskCreated — object
| Field | Type | Required | Description |
|---|---|---|---|
taskId | string | is | |
projectId | string | ||
channelName | string | is | |
uid | integer | null | 1..2147483647 | |
mediaTypes | array<enum(image | audio | video)> | is | |
intervalSeconds | integer | 1..3600 | |
callbackUrl | string | null | ||
status | enum(active | stopped) | is | |
inspectUrl | string | ||
inspectedCount | integer | >= 0 | |
flaggedCount | integer | >= 0 | |
metadata | object | ||
createdAt | string | is | format date-time |
updatedAt | string | format date-time | |
stoppedAt | string | null | format date-time | |
inspectToken | string | is | |
inspectTokenExpiresAt | string | is | format date-time |
providerConfigured | boolean |