审核配置与词库
本页的接口查询和修改应用的内容安全配置,维护词库和词条,以及按当前规则检查一段文本,与控制台“内容安全”中的“配置”“词库”和“试一试”相同。配置和词库的含义见内容安全,在控制台中的操作见内容安全配置。
- 生效时间:修改配置、词库和词条后,通常在 1 秒内生效,最迟 30 秒。可以用检查文本立即验证。
- 审核账号:第三方审核账号只能在控制台中添加和选择,这些接口不能修改
provider_account_id。为场景开启第三方审核之前,要先在控制台为应用选择账号。 - 平台的设置:配置中的
platform是平台对本应用的设置,只能查看。 - 操作日志:修改配置、词库和词条的请求写入操作日志,操作人为调用所用的服务端密钥。
- 调用额度:添加和删除词条按词条数计入应用的 OpenAPI 调用额度,见批量接口。
查询审核配置
查询应用当前的审核配置。scenes 中返回全部场景的设置,没有修改过的为默认值。
/{org_name}/{app_name}/moderation/config路径参数
org_name、app_name 见接入概述。
请求示例
curl "$IM_API/$ORG/$APP/moderation/config" \
-H "Authorization: Bearer $APP_TOKEN"响应
成功返回 200 OK,响应体为审核配置对象。
{
"scenes": {
"chatroom_attribute": {
"enabled": true,
"text_provider": "off",
"media_provider": "off",
"include_server_sent": false
},
"chatroom_message": {
"enabled": true,
"text_provider": "off",
"media_provider": "off",
"include_server_sent": true
},
"chatroom_profile": {
"enabled": true,
"text_provider": "off",
"media_provider": "off",
"include_server_sent": false
},
"friend_request": {
"enabled": true,
"text_provider": "off",
"media_provider": "off",
"include_server_sent": false
},
"group_member": {
"enabled": true,
"text_provider": "off",
"media_provider": "off",
"include_server_sent": false
},
"group_profile": {
"enabled": true,
"text_provider": "off",
"media_provider": "off",
"include_server_sent": false
},
"group_request": {
"enabled": true,
"text_provider": "off",
"media_provider": "off",
"include_server_sent": false
},
"media_upload": {
"enabled": true,
"text_provider": "off",
"media_provider": "off",
"include_server_sent": false
},
"message": {
"enabled": true,
"text_provider": "off",
"media_provider": "off",
"include_server_sent": true
},
"user_profile": {
"enabled": true,
"text_provider": "off",
"media_provider": "off",
"include_server_sent": true
}
},
"custom_message_check": "strings",
"provider_account_id": null,
"sync_timeout_ms": 800,
"on_timeout": "pass",
"penalty_rules": [
{
"window_hours": 24,
"threshold": 3,
"categories": null,
"action": "mute",
"mute_scopes": [
"chat",
"group"
],
"duration_seconds": 3600
},
{
"window_hours": 168,
"threshold": 10,
"categories": null,
"action": "disable",
"mute_scopes": null,
"duration_seconds": 604800
}
],
"platform": {
"rules_enabled": true,
"scenes": {},
"daily_quota": 100000,
"enforced_categories": [
"politics",
"terrorism",
"porn"
],
"inherited_scenes": true,
"inherited_daily_quota": true
},
"version": 8,
"updated_at": "2026-10-04T19:37:43.590Z"
}修改审核配置
只传要修改的项,没有传的项保持不变:
scenes按场景合并:只修改请求中给出的场景和字段;category_actions按类别合并:某个类别传null表示恢复默认的处理;penalty_rules整体替换:传新的全部规则,传null表示不自动处罚。
修改后没有任何变化的,version 不变。
/{org_name}/{app_name}/moderation/config路径参数
org_name、app_name 见接入概述。
请求体
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
scenes | Object | 否 | 要修改的场景,键为场景,值为场景设置中要修改的字段 |
custom_message_check | String | 否 | 自定义消息的检查方式:strings 检查 body 中的全部字符串值,off 不检查 |
category_actions | Object | 否 | 要修改的类别的处理,键为类别,值为类别的处理中要修改的字段,或 null(恢复默认) |
sync_timeout_ms | Number | 否 | 同步调用第三方审核的等待时限,200 到 2000 毫秒 |
on_timeout | String | 否 | 同步审核超时、出错或账号不可用时:pass 放行,之后再补审;reject 拒绝,details.reason 为 check_timeout |
penalty_rules | Array<Object> | 否 | 自动处罚规则,最多 5 条,整体替换,见自动处罚规则;null 或空数组表示不自动处罚 |
version | Number | 否 | 读取到的 version。给出时与当前版本不一致返回 409 version_conflict,见并发修改 |
请求体中不能出现 provider_account_id(即使值为 null),否则返回 400 invalid_argument。platform 可以出现,但会被忽略,所以可以把查询到的配置改完后整体提交(去掉 provider_account_id)。
请求示例
让服务端提交的群资料也按你的规则检查,第三方审核建议拦截的广告改为送审,等待时限改为 1 秒:
curl -X PATCH "$IM_API/$ORG/$APP/moderation/config" \
-H "Authorization: Bearer $APP_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"scenes": { "group_profile": { "include_server_sent": true } },
"category_actions": { "ad": { "block": "review" } },
"sync_timeout_ms": 1000,
"version": 8
}'响应
成功返回 200 OK,响应体为修改后的审核配置对象。
{
"scenes": {
"chatroom_attribute": {
"enabled": true,
"text_provider": "off",
"media_provider": "off",
"include_server_sent": false
},
"chatroom_message": {
"enabled": true,
"text_provider": "off",
"media_provider": "off",
"include_server_sent": true
},
"chatroom_profile": {
"enabled": true,
"text_provider": "off",
"media_provider": "off",
"include_server_sent": false
},
"friend_request": {
"enabled": true,
"text_provider": "off",
"media_provider": "off",
"include_server_sent": false
},
"group_member": {
"enabled": true,
"text_provider": "off",
"media_provider": "off",
"include_server_sent": false
},
"group_profile": {
"enabled": true,
"text_provider": "off",
"media_provider": "off",
"include_server_sent": true
},
"group_request": {
"enabled": true,
"text_provider": "off",
"media_provider": "off",
"include_server_sent": false
},
"media_upload": {
"enabled": true,
"text_provider": "off",
"media_provider": "off",
"include_server_sent": false
},
"message": {
"enabled": true,
"text_provider": "off",
"media_provider": "off",
"include_server_sent": true
},
"user_profile": {
"enabled": true,
"text_provider": "off",
"media_provider": "off",
"include_server_sent": true
}
},
"custom_message_check": "strings",
"provider_account_id": null,
"category_actions": {
"ad": {
"block": "review",
"review": "review"
}
},
"sync_timeout_ms": 1000,
"on_timeout": "pass",
"penalty_rules": [
{
"window_hours": 24,
"threshold": 3,
"categories": null,
"action": "mute",
"mute_scopes": [
"chat",
"group"
],
"duration_seconds": 3600
},
{
"window_hours": 168,
"threshold": 10,
"categories": null,
"action": "disable",
"mute_scopes": null,
"duration_seconds": 604800
}
],
"platform": {
"rules_enabled": true,
"scenes": {},
"daily_quota": 100000,
"enforced_categories": [
"politics",
"terrorism",
"porn"
],
"inherited_scenes": true,
"inherited_daily_quota": true
},
"version": 9,
"updated_at": "2026-10-04T19:49:55.426Z"
}错误
| HTTP 状态码 | code | 说明 |
|---|---|---|
| 400 | invalid_argument | 取值不合法,details.field 指出字段,如 scenes(场景不存在)、sync_timeout_ms、on_timeout、custom_message_check、category_actions、penalty_rules;请求体中有 provider_account_id 时 details.field 为 provider_account_id |
| 400 | invalid_argument | details.reason 为 unsupported_scene:场景不支持这种审核方式,如 text_provider 为 async 用于消息和聊天室消息以外的场景,见场景设置 |
| 400 | invalid_argument | details.reason 为 provider_account_required:开启了第三方审核,但应用还没有在控制台选择审核账号 |
| 409 | limit_exceeded | details.reason 为 penalty_rule_limit:自动处罚规则超过 5 条 |
| 409 | version_conflict | version 与当前版本不一致,details.current 为当前的 version 和 updated_at |
{
"error": {
"code": "version_conflict",
"message": "数据已被其他人修改,请刷新后重试",
"details": {
"current": {
"updated_at": "2026-10-04T19:49:55.426Z",
"version": 9
}
},
"request_id": "7FPY7Z2Q5BVEIVC7MDNLTVJFJN"
}
}词库
每个应用最多 20 个词库,每个词库最多 10000 个词条,应用合计最多 50000 个词条。词库的属性和匹配规则见词库。
查询词库列表
查询应用的全部词库,不分页,按创建时间排列。
/{org_name}/{app_name}/moderation/word-lists路径参数
org_name、app_name 见接入概述。
请求示例
curl "$IM_API/$ORG/$APP/moderation/word-lists" \
-H "Authorization: Bearer $APP_TOKEN"响应
成功返回 200 OK,items 为词库对象的数组。
{
"items": [
{
"list_id": "100311111194116096",
"name": "广告导流",
"kind": "block",
"action": "reject",
"match_mode": "contains",
"category": "ad",
"scenes": null,
"enabled": true,
"word_count": 4,
"created_at": "2026-10-04T19:20:32.603Z",
"updated_at": "2026-10-04T19:20:41.046Z"
},
{
"list_id": "100311111538049024",
"name": "不文明用语",
"kind": "block",
"action": "replace",
"match_mode": "contains",
"category": "abuse",
"scenes": null,
"enabled": true,
"word_count": 2,
"created_at": "2026-10-04T19:20:32.683Z",
"updated_at": "2026-10-04T19:30:08.569Z"
}
]
}创建词库
/{org_name}/{app_name}/moderation/word-lists路径参数
org_name、app_name 见接入概述。
请求体
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
name | String | 是 | 名称,1 到 64 个字符,不能包含控制字符,在应用内不能重复 |
kind | String | 否 | 种类:block 屏蔽(默认)、allow 放行。创建后不能修改 |
action | String | 视种类而定 | 屏蔽词库必填:reject 拒绝、replace 替换、review 送审。放行词库不能填写 |
match_mode | String | 否 | 匹配方式:contains 包含(默认)、exact 完全相同。放行词库只能为 contains |
category | String | 否 | 命中时记入的类别,默认为 custom |
scenes | Array<String> | 否 | 适用的场景,不能为空数组;省略或为 null 时适用于全部场景 |
enabled | Boolean | 否 | 是否启用,默认为 true |
请求示例
curl -X POST "$IM_API/$ORG/$APP/moderation/word-lists" \
-H "Authorization: Bearer $APP_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "联系方式导流",
"kind": "block",
"action": "review",
"match_mode": "contains",
"category": "ad",
"scenes": ["message", "chatroom_message"],
"enabled": true
}'响应
成功返回 201 Created,响应体为词库对象。
{
"list_id": "100318615084990464",
"name": "联系方式导流",
"kind": "block",
"action": "review",
"match_mode": "contains",
"category": "ad",
"scenes": [
"message",
"chatroom_message"
],
"enabled": true,
"word_count": 0,
"created_at": "2026-10-04T19:50:21.669Z",
"updated_at": "2026-10-04T19:50:21.669Z"
}错误
| HTTP 状态码 | code | 说明 |
|---|---|---|
| 400 | invalid_argument | 取值不合法,details.field 指出字段;名称已被本应用的其他词库使用时 details.field 为 name;scenes 为空数组时为 scenes |
| 400 | invalid_argument | details.reason 为 unsupported_action:屏蔽词库没有给出 action,或放行词库给出了 action |
| 409 | limit_exceeded | details.reason 为 word_list_limit:应用的词库已有 20 个 |
查询词库
/{org_name}/{app_name}/moderation/word-lists/{list_id}路径参数
org_name、app_name 见接入概述。
| 参数 | 类型 | 说明 |
|---|---|---|
list_id | String | 词库 ID |
请求示例
curl "$IM_API/$ORG/$APP/moderation/word-lists/100318615084990464" \
-H "Authorization: Bearer $APP_TOKEN"响应
成功返回 200 OK,响应体为词库对象。
错误
| HTTP 状态码 | code | 说明 |
|---|---|---|
| 404 | not_found | 词库不存在,或不属于这个应用 |
修改词库
修改词库的属性,只传要修改的字段。种类 kind 不能修改。
/{org_name}/{app_name}/moderation/word-lists/{list_id}路径参数
org_name、app_name 见接入概述。
| 参数 | 类型 | 说明 |
|---|---|---|
list_id | String | 词库 ID |
请求体
字段同创建词库,都是可选的,不能包含 kind。scenes 传 null 表示改为适用于全部场景。
请求示例
curl -X PATCH "$IM_API/$ORG/$APP/moderation/word-lists/100318615084990464" \
-H "Authorization: Bearer $APP_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "联系方式导流(消息)",
"action": "reject",
"scenes": null
}'响应
成功返回 200 OK,响应体为修改后的词库对象。
{
"list_id": "100318615084990464",
"name": "联系方式导流(消息)",
"kind": "block",
"action": "reject",
"match_mode": "contains",
"category": "ad",
"scenes": null,
"enabled": true,
"word_count": 0,
"created_at": "2026-10-04T19:50:21.669Z",
"updated_at": "2026-10-04T19:50:28.250Z"
}错误
| HTTP 状态码 | code | 说明 |
|---|---|---|
| 400 | invalid_argument | 取值不合法,details.field 指出字段;请求中有 kind 时 details.field 为 kind |
| 400 | invalid_argument | details.reason 为 unsupported_action:修改后的屏蔽词库没有处理方式,或给放行词库设置了 action |
| 404 | not_found | 词库不存在 |
删除词库
删除词库和其中的全部词条,不能恢复。
/{org_name}/{app_name}/moderation/word-lists/{list_id}路径参数
org_name、app_name 见接入概述。
| 参数 | 类型 | 说明 |
|---|---|---|
list_id | String | 词库 ID |
请求示例
curl -X DELETE "$IM_API/$ORG/$APP/moderation/word-lists/100318861361938432" \
-H "Authorization: Bearer $APP_TOKEN"响应
成功返回 204 No Content,没有响应体。
错误
| HTTP 状态码 | code | 说明 |
|---|---|---|
| 404 | not_found | 词库不存在,或已被删除 |
查询词条
按规范化之后的词条排序,分页查询词库中的词条,见分页。
/{org_name}/{app_name}/moderation/word-lists/{list_id}/words路径参数
org_name、app_name 见接入概述。
| 参数 | 类型 | 说明 |
|---|---|---|
list_id | String | 词库 ID |
查询参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
prefix | String | 否 | 只返回以它开头的词条。按规范化之后的结果匹配,如 加 Q 与 加q 相同 |
limit | Number | 否 | 每页的条数,默认 20,最大 500 |
cursor | String | 否 | 上一页返回的 next_cursor |
请求示例
curl "$IM_API/$ORG/$APP/moderation/word-lists/100318615084990464/words?limit=2" \
-H "Authorization: Bearer $APP_TOKEN"响应
成功返回 200 OK:
| 字段 | 类型 | 说明 |
|---|---|---|
items | Array<Object> | 词条对象的数组 |
next_cursor | String | 下一页的游标,没有下一页时为 null |
{
"items": [
{
"word": "qq号",
"original": "qq号",
"created_at": "2026-10-04T19:50:33.933Z"
},
{
"word": "二维码进群",
"original": "二维码进群",
"created_at": "2026-10-04T19:50:33.933Z"
}
],
"next_cursor": "二维码进群"
}错误
| HTTP 状态码 | code | 说明 |
|---|---|---|
| 404 | not_found | 词库不存在 |
添加词条
向词库中添加词条,一次 1 到 1000 个。每个词条先规范化,规范化后与已有词条(或同一次提交中的其他词条)相同的视为重复,不合法的不添加,其余正常添加。
/{org_name}/{app_name}/moderation/word-lists/{list_id}/words/batch路径参数
org_name、app_name 见接入概述。
| 参数 | 类型 | 说明 |
|---|---|---|
list_id | String | 词库 ID |
请求体
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
words | Array<String> | 是 | 要添加的词条,1 到 1000 个。屏蔽词规范化后为 2 到 32 个字符,放行词为 2 到 64 个字符;原样最多 64 个字符,不能包含控制字符 |
请求示例
curl -X POST "$IM_API/$ORG/$APP/moderation/word-lists/100318615084990464/words/batch" \
-H "Authorization: Bearer $APP_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"words": ["加QQ", "加 Q Q", "qq号", "扣扣", "x", "二维码进群"]
}'响应
成功返回 200 OK:
| 字段 | 类型 | 说明 |
|---|---|---|
added | Number | 新增的词条数 |
duplicated | Array<String> | 重复的词条(原样) |
invalid | Array<Object> | 不合法的词条,每项为原样 word 和原因 reason:too_short 太短、too_long 太长、control_character 含控制字符 |
例子中“加 Q Q”规范化后为 加qq,与同时提交的“加QQ”重复;“qq号”规范化后为 qq号:
{
"added": 4,
"duplicated": [
"加 Q Q"
],
"invalid": [
{
"reason": "too_short",
"word": "x"
}
]
}错误
| HTTP 状态码 | code | 说明 |
|---|---|---|
| 400 | invalid_argument | details.field 为 words:words 为空或超过 1000 个 |
| 404 | not_found | 词库不存在 |
| 409 | limit_exceeded | details.reason 为 word_limit:添加后词库超过 10000 个词条,或应用合计超过 50000 个。这时整批都不添加 |
删除词条
从词库中删除词条,一次 1 到 1000 个。词条可以是原样,也可以是规范化之后的结果,按规范化之后的结果删除;不存在的词条忽略。
/{org_name}/{app_name}/moderation/word-lists/{list_id}/words/batch-delete路径参数
org_name、app_name 见接入概述。
| 参数 | 类型 | 说明 |
|---|---|---|
list_id | String | 词库 ID |
请求体
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
words | Array<String> | 是 | 要删除的词条,1 到 1000 个 |
请求示例
curl -X POST "$IM_API/$ORG/$APP/moderation/word-lists/100318615084990464/words/batch-delete" \
-H "Authorization: Bearer $APP_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"words": ["扣扣", "加 qq", "不存在的词"]
}'响应
成功返回 200 OK,removed 为删除的词条数:
{
"removed": 2
}错误
| HTTP 状态码 | code | 说明 |
|---|---|---|
| 400 | invalid_argument | details.field 为 words:words 为空或超过 1000 个 |
| 404 | not_found | 词库不存在 |
检查文本
按应用当前的全部规则检查一段文本或多个字段,返回结果和命中的词,用于修改词库后验证,或在你自己的业务中预先检查用户输入。检查按客户端提交的内容处理(平台规则和你的规则都适用),不生成审核记录和违规,不计入统计。
平台词库的命中只返回 platform 和类别,不返回词库和命中的词。
/{org_name}/{app_name}/moderation/text-check路径参数
org_name、app_name 见接入概述。
请求体
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
scene | String | 是 | 场景,按这个场景适用的词库和设置检查,取值见审核的内容和时机 |
text | String | 二选一 | 要检查的一段文本 |
fields | Object | 二选一 | 要检查的多个字段,键为字段名,值为文本,与 text 合计最多 10 个 |
with_provider | Boolean | 否 | 是否同时调用第三方审核,默认为 false。为 true 时按这个场景的设置选择审核账号同步调用,没有开启第三方审核的场景不调用。调用会计入服务商的用量和费用,使用平台账号的计入应用的用量 |
请求示例
检查一段文本:
curl -X POST "$IM_API/$ORG/$APP/moderation/text-check" \
-H "Authorization: Bearer $APP_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"scene": "message",
"text": "想要资料请扫二维码进群,你个笨蛋"
}'检查多个字段,同时调用第三方审核:
curl -X POST "$IM_API/$ORG/$APP/moderation/text-check" \
-H "Authorization: Bearer $APP_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"scene": "group_profile",
"fields": { "name": "周末兼职刷单群", "announcement": "欢迎新人" },
"with_provider": true
}'响应
成功返回 200 OK。只给出 text 时,响应体为一个检查结果对象:
{
"action": "reject",
"hits": [
{
"list_id": "100318615084990464",
"list_name": "联系方式导流(消息)",
"category": "ad",
"action": "reject",
"word": "二维码进群",
"start": 6,
"end": 11
},
{
"list_id": "100311111538049024",
"list_name": "不文明用语",
"category": "abuse",
"action": "replace",
"word": "笨蛋",
"start": 14,
"end": 16
}
],
"provider_result": null,
"text": "想要资料请扫二维码进群,你个**"
}给出 fields 时,响应体为 { "fields": { 字段名: 检查结果对象 } };同时给出了 text 的,结果中另有一个名为 text 的字段:
{
"fields": {
"announcement": {
"action": "reject",
"hits": [],
"provider_result": {
"categories": [
"gambling"
],
"suggestion": "block"
},
"text": "欢迎新人"
},
"name": {
"action": "review",
"hits": [
{
"list_id": "100311111852621824",
"list_name": "疑似诈骗",
"category": "fraud",
"action": "review",
"word": "兼职刷单",
"start": 2,
"end": 6
}
],
"provider_result": {
"categories": [
"vulgar"
],
"suggestion": "review"
},
"text": "周末兼职刷单群"
}
}
}错误
| HTTP 状态码 | code | 说明 |
|---|---|---|
| 400 | invalid_argument | details.field 为 scene:场景不合法;为 fields:text 和 fields 都没有给出,或合计超过 10 个 |
数据结构
审核配置对象
| 字段 | 类型 | 说明 |
|---|---|---|
scenes | Object | 全部场景的设置,键为场景,值为场景设置 |
custom_message_check | String | 自定义消息的检查方式:strings 检查 body 中的全部字符串值(默认),off 不检查 |
provider_account_id | String | 应用在控制台选择的审核账号 ID,没有选择时为 null |
category_actions | Object | 修改过的类别的处理,键为类别,值为类别的处理。没有修改过的类别取默认值;都没有修改过时不返回这个字段 |
sync_timeout_ms | Number | 同步调用第三方审核的等待时限,单位为毫秒,默认 800 |
on_timeout | String | 同步审核超时、出错或账号不可用时的处理:pass(默认)或 reject |
penalty_rules | Array<Object> | 自动处罚规则,没有规则时为 null 或空数组 |
platform | Object | 平台对本应用的设置,只读,见下表 |
version | Number | 配置的版本号,每次修改加一。没有修改过的应用为 1 |
updated_at | String | 最近一次修改的时间,没有修改过为 null |
platform 的字段:
| 字段 | 类型 | 说明 |
|---|---|---|
rules_enabled | Boolean | 平台规则是否对本应用生效 |
scenes | Object | 平台用平台的账号为本应用做第三方审核的场景,键为场景,值为 text_provider 和 media_provider;没有时为空对象 |
daily_quota | Number | 平台账号每天为本应用审核的次数上限,0 表示不限 |
enforced_categories | Array<String> | 平台强制处理的类别 |
inherited_scenes | Boolean | scenes 是否为平台的默认设置(平台没有为本应用单独设置) |
inherited_daily_quota | Boolean | daily_quota 是否为平台的默认设置 |
场景设置
| 字段 | 类型 | 说明 |
|---|---|---|
enabled | Boolean | 是否按你的规则检查这个场景,默认为 true。为 false 时只按平台规则检查 |
text_provider | String | 文本的第三方审核:off 不审核(默认)、sync 同步、async 事后 |
media_provider | String | 图片、语音、视频的第三方审核:off(默认)、sync、async |
include_server_sent | Boolean | 你的服务端和控制台提交的内容是否也按你的规则检查,默认为 false |
各场景可以使用的取值:
| 场景 | text_provider | media_provider | include_server_sent |
|---|---|---|---|
message、chatroom_message | off、sync、async | off、async | 可以设置 |
user_profile、group_profile | off、sync | off、sync(头像) | 可以设置 |
group_member、group_request、friend_request、chatroom_profile | off、sync | off | 可以设置 |
media_upload | off | off、async | 可以设置 |
chatroom_attribute | off | off | 只能为 false |
任何场景的 text_provider 或 media_provider 不为 off 时,应用必须已在控制台选择审核账号。
类别的处理
第三方审核结果的处理,平台强制处理的类别不受影响。
| 字段 | 类型 | 说明 |
|---|---|---|
block | String | 建议拦截时:reject 拒绝(默认)、review 送审 |
review | String | 建议人工审核时:review 送审(默认)、none 不处理 |
自动处罚规则
| 字段 | 类型 | 说明 |
|---|---|---|
window_hours | Number | 时间窗口,1 到 720 小时 |
threshold | Number | 时间窗口内的违规次数,1 到 1000 |
categories | Array<String> | 只统计这些类别的违规;null 统计全部类别 |
action | String | 处罚:mute 全局禁言、disable 封禁 |
mute_scopes | Array<String> | 禁言的场景,action 为 mute 时必填:chat、group、room 中的一个或多个;action 为 disable 时为 null |
duration_seconds | Number | 处罚的时长,1 到 315360000 秒(10 年);null 为永久 |
规则的执行方式见违规记录与自动处罚。
词库对象
| 字段 | 类型 | 说明 |
|---|---|---|
list_id | String | 词库 ID |
name | String | 名称 |
kind | String | 种类:block 屏蔽、allow 放行 |
action | String | 处理方式:reject、replace、review;放行词库为 null |
match_mode | String | 匹配方式:contains 包含、exact 完全相同 |
category | String | 命中时记入的类别 |
scenes | Array<String> | 适用的场景;null 表示全部场景 |
enabled | Boolean | 是否启用 |
word_count | Number | 词条数 |
created_at | String | 创建时间 |
updated_at | String | 最近一次修改词库或词条的时间 |
{
"list_id": "100318615084990464",
"name": "联系方式导流",
"kind": "block",
"action": "review",
"match_mode": "contains",
"category": "ad",
"scenes": [
"message",
"chatroom_message"
],
"enabled": true,
"word_count": 0,
"created_at": "2026-10-04T19:50:21.669Z",
"updated_at": "2026-10-04T19:50:21.669Z"
}词条对象
| 字段 | 类型 | 说明 |
|---|---|---|
word | String | 规范化之后的词条,匹配时使用它 |
original | String | 添加时提交的原样 |
created_at | String | 添加的时间 |
检查结果对象
| 字段 | 类型 | 说明 |
|---|---|---|
action | String | 结果:pass 通过、reject 拒绝、replace 替换、review 送审 |
text | String | 替换之后的文本;没有命中替换的词时与原文相同 |
hits | Array<Object> | 命中的词库,见下表;没有命中时为空数组 |
provider_result | Object | 第三方审核的结果:suggestion 为建议(pass 通过、review 建议人工审核、block 建议拦截),categories 为类别。没有调用或调用失败时为 null |
hits 的每一项:
| 字段 | 类型 | 说明 |
|---|---|---|
list_id | String | 词库 ID。平台词库的命中没有这个字段 |
list_name | String | 词库的名称。平台词库的命中没有这个字段 |
platform | Boolean | 平台词库的命中为 true,只带 category;你的词库的命中没有这个字段 |
category | String | 词库的类别 |
action | String | 词库的处理方式 |
word | String | 命中的词条(规范化之后的) |
start、end | Number | 命中在原文中的位置,按字符计算,从 0 开始,end 不包含 |
