在线调试
批量禁言群成员
更新时间: 2025/11/28 10:24:27
该接口用于批量禁言指定的群成员,包括高级群成员和超大群成员。
功能描述
- 一次最多禁言 10 个群成员。
- 对于高级群,只有群主可以批量禁言群成员。
- 对于超大群,只有群主和管理员可以批量禁言普通群成员。管理员只有群主可以禁言,管理员不能禁言其他管理员。
调用频率
单个应用默认最高调用频率请参考 频控说明。
请求信息
请求 URL
PATCH https://{endpoint}/im/v2/team_members/actions/batch_mute
请求 URL 中的 {endpoint} 代表服务地址域名,您可以根据用户服务区域选择中国大陆和海外服务地址,并支持搭建高可用主备域名机制。详情请参考 调用方式 服务地址章节。
请求头参数
请求 Header 的参数说明请参考 请求 Header。
请求体参数
| 参数名称 | 类型 | 是否必选 | 描述 |
|---|---|---|---|
operator_id |
String | 是 | 操作者(群主或管理员)账号 ID。 |
team_type |
Integer | 是 | 群组类型。1:高级群;2:超大群。 |
team_id |
Long | 是 | 群组 ID。 |
chat_ban_account_ids |
Array of strings | 是 | 需要禁言的群成员账号 ID 列表。一次最多禁言 10 个群成员。 |
chat_banned |
Boolean | 否 | 在本群中是否禁言目标成员列表,false(默认):不禁言;true:禁言。 |
请求体示例
JSON{
"team_id": 2350583282,
"chat_ban_account_ids": ["ciaos12", "ciaos13"],
"chat_banned": true,
"team_type": 1,
"operator_id": "ciaos11"
}
响应信息
响应头参数
响应 Header 的参数说明请参考 响应 Header。
响应体参数
| 参数名称 | 类型 | 说明 | 是否必返回 |
|---|---|---|---|
code |
Integer | 状态码,200 表示请求成功。 | 是 |
msg |
String | 提示信息。请求失败时返回错误信息,请求成功时返回 "success"。 | 是 |
-
data |
Object | 返回的 JSON 数据对象,请求失败则返回空对象。 | 是 |
success_list |
Array of strings | 禁言成功的用户账号 ID 列表。 | 是 |
-
failed_list |
Array of objects | 禁言失败的账号列表。 | 否 |
account_id |
String | 禁言失败的 IM 账号 ID。 | 否 |
error_code |
Integer | 操作失败的错误码。 | 否 |
error_msg |
String | 操作失败的错误信息。 | 否 |
响应体示例
JSON{
"code": 200,
"msg": "success",
"data": {
"success_list": [
"account_id1",
"account_id2"
],
"failed_list": [
{
"account_id": "account_id1",
"error_code": 102404,
"error_msg": "%s not valid"
}
]
}
}
错误码
本文仅列举部分业务接口错误码,完整列表请参考客户端 API 错误码。
| 错误码 | 错误码描述 | 错误信息示例 |
|---|---|---|
| 200 | 请求成功 | success |
| 414 | 参数错误 | parameter error |
| 416 | 频率超限 | rate limit exceeded |
| 102404 | 用户不存在 | account not exist |
| 108311 | 超大群服务未开通 | super team service disabled |
| 108404 | 群组不存在 | team not exist |
| 109404 | 群成员不存在 | team member not exist |
| 109301 | 禁言列表包含非群成员 | list of chat banned users contains non team members |
| 109303 | 禁言列表包含操作人 | list of chat banned users contains the operator |
| 109304 | 禁言列表包含群主 | list of chat banned users contains the team owner |
| 109305 | 不允许操作管理员 | operation on team manager not allowed |
| 109432 | 仅允许群主或管理员操作 | team owner or manager operation permission required |
| 500 | 服务端内部错误 | internal server error |
| 503 | 服务器繁忙 | server busy |
此文档是否对你有帮助?





