API 概览与频控
更新时间: 2025/08/21 17:27:49
本文罗列了网易云信即时通讯(NIM)的 10.x.x 系列 API 列表,以及各 API 的使用限制(频控)。10.x.x 系列大部分 API 都对应并兼容 3.1.0 ~ 9.x.x 系列 API(统称 V9 系列 API),对应关系也在下列表格中说明。
频控说明
超过网易云信 IM API 调用限制会返回 416 错误码,并触发一段时间的调用屏蔽。服务端 API 频控分两类:
单次类 API 频控:
- 用户&关系:用户账号、名片、好友关系、静音、黑名单等
- 会话:会话、会话分组、未读数等,存储模式区分云端会话和本地会话
- 消息:发送消息、查询消息、系统通知等(例外情况:批量发送单聊消息 和 批量发送自定义系统通知 至 批量发送消息 分类调整。发送广播消息 和 发送聊天室全服广播 至 广播消息 分类调整,删除和查询广播消息 API 仍在 消息 分类中调整。)
- 群组:创建群、获取群列表、管理群成员等
- 聊天室:聊天室地址、信息、用户管理、队列等
- 圈组:创建服务器、获取频道列表、管理身份组等
- 其他:文本翻译等
批量类 API 频控:
- 批量发送消息:批量发送单聊消息、批量发送自定义系统通知
- 发送广播消息:发送广播消息、发送聊天室全服广播
频控限制
IM 各套餐包下不同 频控类别 的 API 频控限制情况不同,具体限值需要参考对应的套餐包。各套餐详情请参考 计费概述。
10.x.x 系列 API 频控均遵从以下调用频率限制:
套餐版本 | 默认值 | 可配置最高值 | 增值费用(国内) | 增值费用(海外) |
---|---|---|---|---|
2024 标准版 | 100/s | 不可调整 | - | - |
2024 高级版 | 100/s | 5000/s | 每超 100 功能费+400 元/月 | 每超 100 功能费+600 元/月 |
2024 旗舰版 | 500/s | 10000/s | 每超 100 功能费+300 元/月 | 每超 100 功能费+500 元/月 |
2024 专属版 | 5000/s | 50000/s | 每超 100 功能费+500 元/月 | 每超 100 功能费+800 元/月 |
套餐版本 | 默认值 | 可配置最高值 | 增值费用(国内) | 增值费用(海外) |
---|---|---|---|---|
2024 标准版 | 120/min | 不可调整 | - | - |
2024 高级版 | 120/min | 2000/min | 每超 100 功能费+1000 元/月 | 每超 10 功能费+1000 元/月 |
2024 旗舰版 | 200/min | 5000/min | 每超 100 功能费+800 元/月 | 每超 10 功能费+800 元/月 |
2024 专属版 | 2000/min | 10000/min | 每超 100 功能费+300 元/月 | 每超 10 功能费+300 元/月 |
套餐版本 | 默认值 | 可配置最高值 | 增值费用(国内) | 增值费用(海外) |
---|---|---|---|---|
2024 标准版 | 不支持 | 不支持 | - | - |
2024 高级版 | 10/min | 1000/min | 每超 10 功能费+800 元/月 | 每超 10 功能费+1000 元/月 |
2024 旗舰版 | 50/min | 2000/min | 每超 10 功能费+500 元/月 | 每超 10 功能费+800 元/月 |
2024 专属版 | 1000/min | 5000/min | 每超 10 功能费+200 元/月 | 每超 10 功能费+300 元/月 |
若根据业务需要调整部分 API 的频控,可在 网易云信控制台 上,参考下文 自行调整 API 频控,或通过官网首页右侧的联系方式联系网易云信商务经理进行调整。
用户&关系
包含用户账号、用户名片、好友关系、用户在线状态事件订阅、静音以及黑名单等用户管理相关的单次类 API。
API 调用频控限制,请参考上文 频控限制。
IM 账号管理
API | 请求 URL | 对应并兼容的 V9 API |
---|---|---|
注册 IM 账号 | POST https://open.yunxinapi.com/im/v2/accounts |
注册 IM 账号 |
更新账号属性 | PATCH https://open.yunxinapi.com/im/v2/accounts/{account_id} |
账号功能模块禁言 |
刷新 Token | PATCH https://open.yunxinapi.com/im/v2/accounts/{account_id}/actions/refresh_token |
刷新 Token |
封禁账号 | PATCH https://open.yunxinapi.com/im/v2/accounts/{account_id}/actions/disable |
封禁账号 |
更新移动端推送配置 | PATCH https://open.yunxinapi.com/im/v2/accounts/{account_id}/actions/push_config |
设置移动端是否需要推送(桌面端在线时) |
查询账号属性 | GET https://open.yunxinapi.com/im/v2/accounts/{account_id} |
- |
批量查询账号信息 | GET https://open.yunxinapi.com/im/v2/accounts |
- |
强制账号下线 | POST https://open.yunxinapi.com/im/v2/accounts/{account_id}/actions/kick |
- |
用户名片管理
API | 请求 URL | 对应并兼容的 V9 API |
---|---|---|
更新用户名片 | PATCH https://open.yunxinapi.com/im/v2/users/{account_id} |
更新用户名片 |
查询用户名片 | GET https://open.yunxinapi.com/im/v2/users/{account_id} |
- |
批量查询用户名片 | GET https://open.yunxinapi.com/im/v2/users |
获取用户名片 |
批量查询用户在线状态 | POST https://open.yunxinapi.com/im/v2/users/actions/onlineStatus |
批量查询账号在线状态 |
好友管理
API | 请求 URL | 对应并兼容的 V9 API |
---|---|---|
添加好友 | POST https://open.yunxinapi.com/im/v2.1/friends |
添加好友 |
删除好友 | DELETE https://open.yunxinapi.com/im/v2/friends/{account_id} |
删除好友关系 |
更新好友信息 | PATCH https://open.yunxinapi.com/im/v2.1/friends/{account_id} |
更新好友相关信息 |
同意/拒绝添加好友 | POST https://{endpoint}/im/v2.1/friends/actions/handle_friend_addition |
- |
查询好友信息 | GET https://open.yunxinapi.com/im/v2.1/friends/{account_id} |
获取好友关系 |
分页查询好友信息 | GET https://open.yunxinapi.com/im/v2.1/friends |
获取好友列表 |
静音管理
API | 请求 URL | 对应并兼容的 V9 API |
---|---|---|
设置静音 | POST https://open.yunxinapi.com/im/v2/mute_contacts |
设置黑名单/静音 |
解除静音 | DELETE https://open.yunxinapi.com/im/v2/mute_contacts/{account_id} |
|
分页查询静音列表 | GET https://open.yunxinapi.com/im/v2/mute_contacts |
查看指定用户的黑名单和静音列表 |
黑名单管理
API | 请求 URL | 对应并兼容的 V9 API |
---|---|---|
列入黑名单 | POST https://open.yunxinapi.com/im/v2/block_contacts |
设置黑名单/静音 |
移出黑名单 | DELETE https://open.yunxinapi.com/im/v2/block_contacts/{account_id} |
|
分页查询黑名单列表 | GET https://open.yunxinapi.com/im/v2/block_contacts |
查看指定用户的黑名单和静音列表 |
用户在线状态事件订阅
API | 请求 URL | 对应并兼容的 V9 API |
---|---|---|
订阅用户在线状态事件 | POST https://open.yunxinapi.com/im/v2/subscription/{account_id} |
订阅在线状态事件 |
取消用户在线状态事件的订阅 | POST https://open.yunxinapi.com/im/v2/subscription/{account_id} |
|
查询订阅的用户在线状态事件 | PATCH https://open.yunxinapi.com/im/v2/subscription/{account_id} |
查询在线状态事件订阅关系 |
消息功能
API 调用频控限制,请参考上文 频控限制。
消息管理
API | 请求 URL | 对应并兼容的 V9 API |
---|---|---|
发送消息 | POST https://open.yunxinapi.com/im/v2/conversations/{conversation_id}/messages |
发送消息 |
批量发送单聊消息 | POST https://open.yunxinapi.com/im/v2/conversations/messages |
批量发送单聊消息 |
更新消息 | POST https://open.yunxinapi.com/im/v2/messages/actions/modify |
- |
撤回/删除消息 | DELETE https://open.yunxinapi.com/im/v2/conversations/{conversation_id}/messages/{message_server_id} |
|
删除会话中的漫游和历史消息 | DELETE https://open.yunxinapi.com/im/v2/conversations/{conversation_id}/messages |
删除漫游消息 |
发送单聊已读回执 | POST https://open.yunxinapi.com/im/v2/messages/actions/p2p_read_receipt |
发送单聊已读回执 |
发送高级群已读回执 | POST https://open.yunxinapi.com/im/v2/messages/actions/team_read_receipt |
发送群聊消息回执 |
查询群消息已读未读详情 | GET https://open.yunxinapi.com/im/v2/messages/actions/team_read_receipt |
获取群消息已读未读详情 |
查询单条消息 | GET https://open.yunxinapi.com/im/v2.1/conversations/{conversation_id}/messages/{message_server_id} |
单聊云端历史消息查询 |
搜索历史消息 | GET https://open.yunxinapi.com/im/v2.1/messages/actions/search_messages |
- |
分页查询历史消息 | GET https://open.yunxinapi.com/im/v2.1/conversations/{conversation_id}/messages |
|
发送聊天室消息 | POST https://open.yunxinapi.com/im/v2/chatrooms/{room_id}/messages |
发送聊天室消息 |
批量发送聊天室消息 | POST https://open.yunxinapi.com/im/v2/chatrooms/messages |
批量发送聊天室消息 |
撤回/删除聊天室历史消息 | DELETE https://open.yunxinapi.com/im/v2/chatrooms/{room_id}/messages/{message_client_id} |
|
分页查询聊天室历史消息 | GET https://open.yunxinapi.com/im/v2.1/chatrooms/{room_id}/messages |
聊天室云端历史消息查询 |
根据消息 ID 查询历史消息 | POST https://open.yunxinapi.com/im/v2.1/conversations/{conversation_id}/batch_messages |
- |
查询 Thread 消息 | GET https://open.yunxinapi.com/im/v2.1/messages/actions/thread_messages |
- |
添加快捷评论 | PATCH https://open.yunxinapi.com/im/v2/messages/actions/quick_comment |
- |
删除快捷评论 | DELETE https://open.yunxinapi.com/im/v2/messages/actions/quick_comment |
- |
查询快捷评论 | POST https://open.yunxinapi.com/im/v2/messages/actions/quick_comment |
- |
广播消息管理
API | 请求 URL | 对应并兼容的 V9 API |
---|---|---|
发送广播消息 | POST https://open.yunxinapi.com/im/v2/broadcast_notification |
发送广播消息 |
删除广播消息 | DELETE https://open.yunxinapi.com/im/v2/broadcast_notification/{broadcast_id} |
删除单条广播消息 |
查询广播消息 | GET https://open.yunxinapi.com/im/v2/broadcast_notification/{broadcast_id} |
查询单条广播消息 |
分页查询广播消息 | GET https://open.yunxinapi.com/im/v2/broadcast_notification |
批量查询广播消息 |
发送聊天室全服广播消息 | POST https://open.yunxinapi.com/im/v2.1/broadcast_notification/actions/chatroom |
发送聊天室全服广播消息 |
系统通知管理
API | 请求 URL | 对应并兼容的 V9 API |
---|---|---|
发送自定义系统通知 | POST https://open.yunxinapi.com/im/v2/custom_notification |
发送自定义系统通知 |
批量发送自定义系统通知 | POST https://open.yunxinapi.com/im/v2/custom_notification/batch |
批量发送自定义系统通知 |
会话功能
API 调用频控限制,请参考上文 频控限制。
会话未读数管理
API | 请求 URL | 对应并兼容的 V9 API |
---|---|---|
获取会话总未读数 | GET https://open.yunxinapi.com/im/v2/conversation_overviews/{account_id} |
- |
清空指定会话未读数 | PATCH https://open.yunxinapi.com/im/v2/conversations/{conversation_id}/actions/clear_conversation_unread |
- |
会话分组
API | 请求 URL | 对应并兼容的 V9 API |
---|---|---|
创建会话分组 | POST https://open.yunxinapi.com/im/v2/conversation_groups |
- |
更新会话分组 | PATCH https://open.yunxinapi.com/im/v2/conversation_groups/{group_id} |
- |
删除会话分组 | DELETE https://open.yunxinapi.com/im/v2/conversation_groups/{group_id} |
- |
查询会话分组 | GET https://open.yunxinapi.com/im/v2/conversation_groups/{group_id} |
- |
批量查询会话分组 | GET https://open.yunxinapi.com/im/v2/conversation_groups/actions/group_ids |
- |
查询所有会话分组 | GET https://open.yunxinapi.com/im/v2/conversation_groups |
- |
会话管理
API | 请求 URL | 对应并兼容的 V9 API |
---|---|---|
创建会话 | POST https://open.yunxinapi.com/im/v2.1/conversations |
- |
更新会话 | PATCH https://open.yunxinapi.com/im/v2/conversations/{conversation_id} |
- |
删除会话 | DELETE https://open.yunxinapi.com/im/v2/conversations/{conversation_id} |
- |
批量删除会话 | DELETE https://open.yunxinapi.com/im/v2/conversations/actions/conversation_ids |
- |
查询会话信息 | GET https://open.yunxinapi.com/im/v2.1/conversations/{conversation_id} |
- |
批量查询会话信息 | GET https://open.yunxinapi.com/im/v2.1/conversations/actions/conversation_ids |
- |
分页查询用户的所有会话列表 | GET https://open.yunxinapi.com/im/v2.1/conversations |
- |
设置会话置顶 | POST https://open.yunxinapi.com/im/v2/conversations/{conversation_id}/actions/stick_top_conversation |
- |
群组功能
API 调用频控限制,请参考上文 频控限制。
群组管理
API | 请求 URL | 对应并兼容的 V9 API |
---|---|---|
创建群组 | POST https://open.yunxinapi.com/im/v2.1/teams |
|
更新群组信息 | PATCH https://open.yunxinapi.com/im/v2.1/teams/{team_id} |
|
转让群组 | PATCH https://open.yunxinapi.com/im/v2/teams/{team_id}/actions/transfer_owner |
|
添加管理员 | POST https://open.yunxinapi.com/im/v2/teams/{team_id}/actions/add_manager |
|
移除管理员 | DELETE https://open.yunxinapi.com/im/v2/teams/{team_id}/actions/remove_manager |
|
解散群组 | DELETE https://open.yunxinapi.com/im/v2.1/teams/{team_id} |
|
查询群组信息 | GET https://open.yunxinapi.com/im/v2.1/teams/{team_id} |
|
批量查询群组信息列表 | GET https://open.yunxinapi.com/im/v2.1/teams |
批量获取群组信息与成员列表 |
查询高级群在线成员列表 | GET https://open.yunxinapi.com/im/v2/teams/{team_id}/actions/list_online_members |
获取群组的在线成员列表 |
批量查询高级群在线成员数 | GET https://open.yunxinapi.com/im/v2/teams/actions/online_members_count |
批量获取群组的在线成员数量 |
分页查询群成员列表 | GET https://open.yunxinapi.com/im/v2.1/teams/{team_id}/actions/list_members |
群成员管理
API | 请求 URL | 对应并兼容的 V9 API |
---|---|---|
拉人入群 | POST https://open.yunxinapi.com/im/v2/team_members |
|
踢人出群 | DELETE https://open.yunxinapi.com/im/v2/team_members/actions/kick_member |
|
主动退群 | DELETE https://open.yunxinapi.com/im/v2/team_members/actions/leave |
|
更新群成员信息 | PATCH https://open.yunxinapi.com/im/v2.1/team_members/{account_id} |
|
批量禁言群成员 | PATCH https://open.yunxinapi.com/im/v2/team_members/actions/batch_mute |
禁言指定超大群成员 |
分页查询指定账号已加入的群组信息 | GET https://open.yunxinapi.com/im/v2.1/team_members/{account_id}/actions/joined_teams |
聊天室
频控限制
API 调用频控限制,请参考上文 频控限制。
聊天室管理
API | 请求 URL | 对应并兼容的 V9 API |
---|---|---|
创建聊天室 | POST https://open.yunxinapi.com/im/v2/chatrooms |
创建聊天室 |
获取聊天室地址 | GET https://open.yunxinapi.com/im/v2/chatrooms/{room_id}/actions/address |
获取聊天室地址 |
更新聊天室信息 | PATCH https://open.yunxinapi.com/im/v2/chatrooms/{room_id} |
更新聊天室信息 |
开放/关闭聊天室 | PATCH https://open.yunxinapi.com/im/v2/chatrooms/{room_id}/actions/update_status |
开放/关闭聊天室 |
聊天室禁言 | PATCH https://open.yunxinapi.com/im/v2/chatrooms/{room_id}/actions/chat_banned |
将聊天室整体禁言 |
开启/关闭进出聊天室事件通知 | PATCH https://open.yunxinapi.com/im/v2/chatrooms/{room_id}/actions/in_out_notification |
开启/关闭进出聊天室事件通知 |
查询聊天室信息 | GET https://open.yunxinapi.com/im/v2/chatrooms/{room_id} |
查询聊天室信息 |
查询开放状态的聊天室 | GET https://open.yunxinapi.com/im/v2/chatrooms/actions/opend_chatrooms |
查询开放状态的聊天室 |
分页查询聊天室在线成员列表 | GET https://open.yunxinapi.com/im/v2/chatrooms/{room_id}/actions/list_online_members |
获取聊天室成员列表 |
查询聊天室固定成员列表 | GET https://open.yunxinapi.com/im/v2/chatrooms/{room_id}/actions/list_members |
聊天室成员管理
API | 请求 URL | 对应并兼容的 V9 API |
---|---|---|
设置聊天室成员角色 | POST https://open.yunxinapi.com/im/v2/room_members/{account_id} |
管理聊天室用户角色 |
更新聊天室成员信息 | PATCH https://open.yunxinapi.com/im/v2/room_members/{account_id} |
|
禁言聊天室成员 | PATCH https://open.yunxinapi.com/im/v2/room_members/{account_id}/actions/chat_banned |
设置角色 |
临时禁言聊天室成员 | PATCH https://open.yunxinapi.com/im/v2/room_members/{account_id}/actions/temp_chat_banned |
设置临时禁言状态 |
拉黑聊天室成员 | PATCH https://open.yunxinapi.com/im/v2/room_members/{account_id}/actions/blocked |
设置角色 |
查询聊天室禁言列表 | GET https://open.yunxinapi.com/im/v2.1/room_members/{room_id}/actions/chat_banned |
获取聊天室成员列表 |
查询聊天室黑名单列表 | GET https://open.yunxinapi.com/im/v2.1/room_members/{room_id}/actions/blocked |
|
批量查询聊天室固定成员信息 | GET https://open.yunxinapi.com/im/v2/room_members/{room_id}/actions/batch |
|
聊天室标签禁言 | PATCH https://open.yunxinapi.com/im/v2/room_members/actions/chat_banned_tagged_members |
标签禁言 |
修改聊天室在线成员标签 | PATCH https://open.yunxinapi.com/im/v2/room_members/{account_id}/actions/tags |
修改聊天室用户标签 |
查询标签下的在线成员数 | GET https://open.yunxinapi.com/im/v2/room_members/{room_id}/actions/tagged_members_count |
查询标签下的在线用户数 |
分页查询标签下的在线成员列表 | GET https://open.yunxinapi.com/im/v2/room_members/{room_id}/actions/list_tag_members |
根据标签查询在线成员列表 |
添加聊天室虚构用户 | POST https://open.yunxinapi.com/im/v2/room_members/actions/virtual_members |
添加聊天室机器人 |
删除聊天室虚构用户 | DELETE https://open.yunxinapi.com/im/v2/room_members/actions/virtual_members |
删除聊天室机器人 |
清空聊天室虚构用户 | DELETE https://open.yunxinapi.com/im/v2/room_members/actions/clear_virtual_members |
清空聊天室机器人 |
查询聊天室虚构用户 | GET https://open.yunxinapi.com/im/v2.1/room_members/actions/virtual_members |
- |
聊天室队列管理
API | 请求 URL | 对应并兼容的 V9 API |
---|---|---|
初始化聊天室队列 | POST https://open.yunxinapi.com/im/v2/room_queues/{room_id} |
初始化聊天室队列 |
更新聊天室队列 | PATCH https://open.yunxinapi.com/im/v2/room_queues/{room_id} |
|
删除聊天室队列 | DELETE https://open.yunxinapi.com/im/v2/room_queues/{room_id} |
删除清理队列 |
查询聊天室队列元素 | POST https://open.yunxinapi.com/im/v2/room_queues/{room_id}/actions/query |
|
从聊天室队列中取出元素 | PATCH https://open.yunxinapi.com/im/v2/room_queues/{room_id}/actions/poll |
从队列中取出元素 |
工具
包含文本翻译、语音转文字等其他相关的单次类 API。
API 调用频控限制,请参考上文 频控限制。
API | 请求 URL | 对应并兼容的 V9 API |
---|---|---|
文本翻译 | POST https://open.yunxinapi.com/im/v2/translations |
文本翻译 |
语音转文字 | POST https://open.yunxinapi.com/im/v2/tools/asr |
- |
圈组
批量发送消息
API 调用频控限制,请参考上文 频控限制。
V10 版本 API | 请求 URL | V9 版本 API |
---|---|---|
批量发送单聊消息 | POST https://open.yunxinapi.com/im/v2/conversations/messages |
批量发送单聊消息 |
批量发送自定义系统通知 | POST https://open.yunxinapi.com/im/v2/custom_notification/batch |
批量发送自定义系统通知 |
广播消息
API 调用频控限制,请参考上文 频控限制。
V10 版本 API | 请求 URL | V9 版本 API |
---|---|---|
发送广播消息 | POST https://open.yunxinapi.com/im/v2/broadcast_notification |
发送广播消息 |
发送聊天室全服广播消息 | POST https://open.yunxinapi.com/im/v2.1/broadcast_notification/actions/chatroom |
发送聊天室全服广播消息 |
调整频控
对于部分 API 支持在 网易云信控制台 自行调整,其他 API 频控的变更需要联系网易云信商务经理处理。自行调整的步骤如下:
-
在 网易云信控制台 首页 应用管理 中选择应用,然后单击 IM 即时通讯 下的 功能配置 按钮进入功能配置页。
-
顶部选择 服务端频控 页签,开启需要调整的 API 频控。
-
开启后,可单击 编辑,输入频控值。
后续会根据新设置的频控进行计费。