内容审核
构建时从公开 REST 接口定义的 `moderation` 标签生成:方法、路径、参数、请求体、响应与 curl。
分组概览
本页由公开 REST 接口定义在构建时生成:标签 moderation,共 6 个操作(全量 230 个)。鉴权、信封与分页约定见 REST API 总览.
| 方法 | 路径 | 摘要 |
|---|---|---|
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 |
操作详情
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).
鉴权:无需鉴权
请求体
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
mediaType | enum(image | audio | video) | 是 | |
media | string | 是 | base64 sample bytes (decoded limit 512 KiB) |
capturedAt | string | format date-time | |
extraInfo | string | 长度 0..1024 |
{
"mediaType": "image",
"media": "string",
"capturedAt": "string",
"extraInfo": "string"
}响应
| 状态码 | 说明 / 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 |
调用示例
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
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
status | query | enum(active | stopped) | ||
channelName | query | string | ||
limit | query | integer | 1..200 | |
offset | query | integer | >= 0 |
响应
| 状态码 | 说明 / schema |
|---|---|
200 | OK — object{ tasks, total } |
400 | Invalid parameter — Error |
调用示例
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.
鉴权:项目凭证(customerId:customerSecret 的 Base64)
请求体
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
channelName | string | 是 | 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 | 长度 0..2048 | |
metadata | object |
{
"channelName": "weekly-sync",
"uid": 1,
"mediaTypes": [
"image"
]
}响应
| 状态码 | 说明 / schema |
|---|---|
201 | OK — ModerationTaskCreated |
400 | Invalid parameter — Error |
409 | An active task already exists (moderation_task_conflict) — Error |
调用示例
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
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
taskId | path | 是 | string |
响应
| 状态码 | 说明 / schema |
|---|---|
200 | OK — ModerationTask |
404 | Unknown task (moderation_task_not_found) — Error |
调用示例
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
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
taskId | path | 是 | string | |
verdict | query | enum(pass | review | block) | ||
limit | query | integer | 1..200 | |
offset | query | integer | >= 0 |
响应
| 状态码 | 说明 / schema |
|---|---|
200 | OK — object{ findings, total } |
404 | Unknown task (moderation_task_not_found) — Error |
调用示例
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.
鉴权:项目凭证(customerId:customerSecret 的 Base64)
参数
| 名称 | 位置 | 必填 | 类型 | 说明 |
|---|---|---|---|---|
taskId | path | 是 | string |
响应
| 状态码 | 说明 / schema |
|---|---|
200 | OK — ModerationTask |
404 | Unknown task (moderation_task_not_found) — Error |
调用示例
curl -s -X POST "$NIMEET_API_BASE/v1/moderation/tasks/taskId/stop" \
-H "Authorization: Basic $NIMEET_CUSTOMER_BASIC"本分组用到的 Schema
Error — object{ code, message, reason, sdkCode, details }
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
code | string | 是 | stable machine code, see errors.json |
message | string | 是 | |
reason | string | ||
sdkCode | integer | Agora-aligned client error number | |
details | object |
ModerationFinding — object
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
findingId | string | 是 | |
taskId | string | 是 | |
mediaType | enum(image | audio | video) | 是 | |
verdict | enum(pass | review | block) | 是 | |
labels | array<string> | 是 | |
score | number | null | 是 | 0..1 |
capturedAt | string | 是 | format date-time |
receivedAt | string | 是 | format date-time |
provider | string | 是 | |
notifiedAt | string | null | 是 | format date-time |
notifyState | enum(delivered | failed | skipped) | 是 |
ModerationInspectResult — object{ findingId, verdict, labels, score }
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
findingId | string | 是 | |
verdict | enum(pass | review | block) | 是 | |
labels | array<string> | 是 | |
score | number | null | 是 |
ModerationTask — object
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
taskId | string | 是 | |
projectId | string | ||
channelName | string | 是 | |
uid | integer | null | 是 | 1..2147483647 |
mediaTypes | array<enum(image | audio | video)> | 是 | |
intervalSeconds | integer | 是 | 1..3600 |
callbackUrl | string | null | ||
status | enum(active | stopped) | 是 | |
inspectUrl | string | ||
inspectedCount | integer | 是 | >= 0 |
flaggedCount | integer | 是 | >= 0 |
metadata | object | ||
createdAt | string | 是 | format date-time |
updatedAt | string | 是 | format date-time |
stoppedAt | string | null | 是 | format date-time |
ModerationTaskCreated — object
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
taskId | string | 是 | |
projectId | string | ||
channelName | string | 是 | |
uid | integer | null | 1..2147483647 | |
mediaTypes | array<enum(image | audio | video)> | 是 | |
intervalSeconds | integer | 1..3600 | |
callbackUrl | string | null | ||
status | enum(active | stopped) | 是 | |
inspectUrl | string | ||
inspectedCount | integer | >= 0 | |
flaggedCount | integer | >= 0 | |
metadata | object | ||
createdAt | string | 是 | format date-time |
updatedAt | string | format date-time | |
stoppedAt | string | null | format date-time | |
inspectToken | string | 是 | |
inspectTokenExpiresAt | string | 是 | format date-time |
providerConfigured | boolean |