Restful API 调用频率限制

大约 17 分钟

Restful API 调用频率限制

概述

API 的调用频率限制计算

除部分 API 接口有特殊说明外,API 调用频率限制默认为 100 次/秒,你可以按模块查看每个接口的调用频率限制。

在即时通讯 IM 系统中,大部分客户端接口的调用实际上是通过对应的 RESTful API 来实现的。

  • 下表中标注 * 的 RESTful API 没有对应的客户端接口,因此它们的调用频率仅由相应的 RESTful API 的调用频率决定。若这些接口的调用频率达到上限,你可以联系声网商务提升。
  • 其他接口,其调用频率则为 RESTful API 和对应客户端接口调用频率的总和。若这些接口的调用频率达到上限,你可以查看是否是客户端 API 调用过于频繁。如果需要提升调用频率上限,可联系声网商务。

API 调用频率限制周期

API 限流周期按照 UTC 时间计算,即当日的 00:00:00 至次日的 00:00:00,转换成北京时间为当日的 08:00:00 至次日的 08:00:00。

超额计费

每个特性的接口表格列明了接口调用频率上限是否可调,并按收费情况将接口分为 6 种类型,如下表所示:

RESTful API 类型超额收费
API 类型 150 QPS,100 元/月
API 类型 250 QPS,200 元/月
API 类型 350 QPS,400 元/月
API 类型 410 次/分钟/App,100 元/月
API 类型 520 QPS,400 元/月
API 类型 66000 条/分钟,100 元/月

消息管理

RESTful API 接口方法接口 URL接口最高调用频率(默认值)是否可调API 类型超额费用
* 发送单聊消息POST/app-id/{app_id}/messages/users对于单个 app,该 REST API 存在以下三个限制:
- 100 次/秒/App ID
- 6000 条/分钟
- 600 人/次。若一次向 600 人发消息,视为 600 条消息。
API 类型 66000条/分钟,100元/月
* 发送群聊消息POST/app-id/{app_id}/messages/chatgroups对于单个 app,该 REST API 存在以下三个限制:
- 20 条/秒/App ID
- 20 次/秒
- 3 个群/次
API 类型 520QPS,400元/月
* 发送聊天室消息POST/app-id/{app_id}/messages/chatrooms对于单个 app,该 REST API 存在以下三个限制:
- 100 条/秒
- 20 次/秒
- 10 个聊天室/次
API 类型 250 QPS,200 元/月
* 发送聊天室广播消息POST/app-id/{app_id}/messages/chatrooms/broadcast每分钟最多可发 10 次,而且每天最多可发 100 次广播消息。
上传文件POST/app-id/{app_id}/chatfiles100 次/秒/App IDAPI 类型 150 QPS,100 元/月
下载文件GET/app-id/{app_id}/chatfiles/{file_uuid}100 次/秒/App IDAPI 类型 150 QPS,100 元/月
* 获取历史消息(聊天记录)文件GET/app-id/{app_id}/chatmessages/${time}10 次/分钟/App IDAPI 类型 410 次/分钟/App,100 元/月
* 撤回单条消息POST/app-id/{app_id}/messages/recall100 次/秒/App IDAPI 类型 150 QPS,100 元/月
单向删除会话DELETE/app-id/{app_id}/users/{userName}/user_channel5 次/分钟/单用户 ID,100 次/秒/App IDAPI 类型 150 QPS,100 元/月
修改文本或自定义消息PUT/app-id/{app_id}/messages/rewrite/{msg_id}100 次/秒/App IDAPI 类型 250 QPS,200 元/月
根据消息 ID 单向删除单聊漫游消息DELETE/app-id/{app_id}/rest/message/roaming/chat/user/{userId}?userId={userId}&msgIdList={msgIdList}100 次/秒/App IDAPI 类型 250 QPS,200 元/月
根据消息 ID 单向删除群聊漫游消息DELETE/app-id/{app_id}/rest/message/roaming/group/user/{userId}?groupId={groupId}&msgIdList={msgIdList}100 次/秒/App IDAPI 类型 250 QPS,200 元/月
单向清空指定用户的漫游消息POST/app-id/{app_id}/rest/message/roaming/user/{userId}/delete/all100 次/秒/App IDAPI 类型 150 QPS,100 元/月
单向清空单聊会话某个时间点及之前的漫游消息POST/app-id/{app_id}/rest/message/roaming/chat/user/{userId}/time?userId={userId}&delTime={delTime}100 次/秒/App IDAPI 类型 250 QPS,200 元/月
单向清空群组或聊天室会话某个时间点及之前的漫游消息POST/app-id/{app_id}/rest/message/roaming/group/user/{userId}/time?groupId={groupId}&delTime={delTime}100 次/秒/App IDAPI 类型 250 QPS,200 元/月
导入单聊消息POST/app-id/{app_id}/messages/users/import100 条/秒/App IDAPI 类型 150 QPS,100 元/月

消息表情回复 Reaction

RESTful API 接口方法接口 URL接口最高调用频率(默认值)是否可调API 类型超额费用
创建/添加 ReactionPOST/app-id/{app_id}/reaction/user/{userId}100 次/秒/App IDAPI 类型 250 QPS,200 元/月
根据消息 ID 获取 ReactionGET/app-id/{app_id}/reaction/user/{userId}100 次/秒/App IDAPI 类型 350 QPS,400 元/月
删除 ReactionDELETE/app-id/{app_id}/reaction/user/{userId}100 次/秒/App IDAPI 类型 250 QPS,200 元/月
根据消息 ID 和表情 ID 获取 Reaction 信息GET/app-id/{app_id}/reaction/user/{userId}/detail100 次/秒/App IDAPI 类型 350 QPS,400 元/月

群组

群组管理

RESTful API 接口方法接口 URL接口最高调用频率(默认值)是否可调API 类型超额费用
查看指定用户是否已加入群组POST/app-id/{app_id}/chatgroups/{group_id}/user/{user_id}/is_joined100 次/秒/App IDAPI 类型 250 QPS,200 元/月
获取群组详情GET/app-id/{app_id}/chatgroups/{group_ids}100 次/秒/App IDAPI 类型 250 QPS,200 元/月
创建群组POST/app-id/{app_id}/chatgroups100 次/秒/App IDAPI 类型 150 QPS,100 元/月
修改群组信息PUT/app-id/{app_id}/chatgroups/{group_id}100 次/秒/App IDAPI 类型 150 QPS,100 元/月
解散群组DELETE/app-id/{app_id}/chatgroups/{group_id}100 次/秒/App IDAPI 类型 250 QPS,200 元/月
获取群组公告GET/app-id/{app_id}/chatgroups/{group_id}/announcement100 次/秒/App IDAPI 类型 150 QPS,100 元/月
修改群组公告POST/app-id/{app_id}/chatgroups/{group_id}/announcement100 次/秒/App IDAPI 类型 150 QPS,100 元/月
分页获取群组共享文件GET/app-id/{app_id}/chatgroups/{group_id}/share_files?pagenum=1&pagesize=10100 次/秒/App IDAPI 类型 150 QPS,100 元/月
上传群组共享文件POST/app-id/{app_id}/chatgroups/{group_id}/share_files100 次/秒/App IDAPI 类型 150 QPS,100 元/月
下载群组共享文件GET/app-id/{app_id}/chatgroups/{group_id}/share_files/{file_id}100 次/秒/App IDAPI 类型 150 QPS,100 元/月
删除群组共享文件DELETE/app-id/{app_id}/chatgroups/{group_id}/share_files/{file_id}100 次/秒/App IDAPI 类型 150 QPS,100 元/月

群成员管理

RESTful API 接口方法接口 URL接口最高调用频率(默认值)是否可调API 类型超额费用
分页获取群组成员GET/app-id/{app_id}/chatgroups/{group_id}/users100 次/秒/App IDAPI 类型 250 QPS,200 元/月
添加单个群组成员POST/app-id/{app_id}/chatgroups/{group_id}/users/{username}100 次/秒/App IDAPI 类型 250 QPS,200 元/月
批量添加群组成员POST/app-id/{app_id}/chatgroups/{group_id}/users100 次/秒/App IDAPI 类型 250 QPS,200 元/月
移除单个群组成员DELETE/app-id/{app_id}/chatgroups/{group_id}/users/{username}100 次/秒/App IDAPI 类型 250 QPS,200 元/月
批量移除群组成员DELETE/app-id/{app_id}/chatgroups/{group_id}/users/{usernames}100 次/秒/App IDAPI 类型 250 QPS,200 元/月
获取群管理员列表GET/app-id/{app_id}/chatgroups/{group_id}/admin100 次/秒/App IDAPI 类型 150 QPS,100 元/月
添加群管理员POST/app-id/{app_id}/chatgroups/{group_id}/admin100 次/秒/App IDAPI 类型 150 QPS,100 元/月
移除群管理员DELETE/app-id/{app_id}/chatgroups/{group_id}/admin/{oldadmin}100 次/秒/App IDAPI 类型 150 QPS,100 元/月
查询群组黑名单GET/app-id/{app_id}/chatgroups/{group_id}/blocks/users100 次/秒/App IDAPI 类型 250 QPS,200 元/月
添加单个用户至群组黑名单POST/app-id/{app_id}/chatgroups/{group_id}/blocks/users/{username}100 次/秒/App IDAPI 类型 150 QPS,100 元/月
批量添加用户至群组黑名单POST/app-id/{app_id}/chatgroups/{group_id}/blocks/users100 次/秒/App IDAPI 类型 250 QPS,200 元/月
从群组黑名单移除单个用户DELETE/app-id/{app_id}/chatgroups/{group_id}/blocks/users/{username}100 次/秒/App IDAPI 类型 250 QPS,200 元/月
批量从群组黑名单移除用户DELETE/app-id/{app_id}/chatgroups/{group_id}/blocks/users/{usernames}100 次/秒/App IDAPI 类型 250 QPS,200 元/月
查询群组白名单GET/app-id/{app_id}/chatgroups/{group_id}/white/users100 次/秒/App IDAPI 类型 150 QPS,100 元/月
添加单个用户至群组白名单POST/app-id/{app_id}/chatgroups/{group_id}/white/users/{username}100 次/秒/App IDAPI 类型 150 QPS,100 元/月
批量添加用户至群组白名单POST/app-id/{app_id}/chatgroups/{group_id}/blocks/users100 次/秒/App IDAPI 类型 150 QPS,100 元/月
将用户移除群组白名单DELETE/app-id/{app_id}/chatgroups/{group_id}/white/users/{username}100 次/秒/App IDAPI 类型 150 QPS,100 元/月
获取禁言列表GET/app-id/{app_id}/chatgroups/{group_id}/mute100 次/秒/App IDAPI 类型 150 QPS,100 元/月
禁言单个群成员POST/app-id/{app_id}/chatgroups/{group_id}/mute100 次/秒/App IDAPI 类型 150 QPS,100 元/月
禁言全体成员POST/app-id/{app_id}/chatgroups/{group_id}/ban100 次/秒/App IDAPI 类型 150 QPS,100 元/月
解除成员禁言DELETE/app-id/{app_id}/chatgroups/{group_id}/mute/{member1}(,{member2},…)100 次/秒/App IDAPI 类型 150 QPS,100 元/月
解除全员禁言DELETE/app-id/{app_id}/chatgroups/{group_id}/ban100 次/秒/App IDAPI 类型 150 QPS,100 元/月

聊天室

聊天室管理

RESTful API 接口方法接口 URL接口最高调用频率(默认值)是否可调API 类型超额费用
获取 app 中的聊天室GET/app-id/{app_id}/chatrooms?limit={N}&cursor={cursor}50 次/秒/App IDAPI 类型 250 QPS,200 元/月
获取用户加入的聊天室GET/app-id/{app_id}/users/{username}/joined_chatrooms50 次/秒/App IDAPI 类型 350 QPS,400 元/月
获取聊天室详情GET/app-id/{app_id}/chatrooms/{chatroom_id}100 次/秒/App IDAPI 类型 250 QPS,200 元/月
创建一个聊天室POST/app-id/{app_id}/chatrooms50 次/秒/App IDAPI 类型 150 QPS,100 元/月
修改聊天室信息PUT/app-id/{app_id}/chatrooms/{chatroom_id}100 次/秒/App IDAPI 类型 150 QPS,100 元/月
转让聊天室PUT/app-id/{app_id}/chatrooms/{chatroom_id}100 次/秒/App IDAPI 类型 250 QPS,200 元/月
解散聊天室DELETE/app-id/{app_id}/chatrooms/{chatroom_id}100 次/秒/App IDAPI 类型 250 QPS,200 元/月
获取聊天室公告GET/app-id/{app_id}/chatrooms/{chatroom_id}/announcement100 次/秒/App IDAPI 类型 150 QPS,100 元/月
修改聊天室公告POST/app-id/{app_id}/chatrooms/{chatroom_id}/announcement100 次/秒/App IDAPI 类型 150 QPS,100 元/月
获取聊天室自定义属性POST/app-id/{app_id}/metadata/chatroom/{chatroom_id}100 次/秒/App IDAPI 类型 250 QPS,200 元/月
设置聊天室自定义属性PUT/app-id/{app_id}/metadata/chatroom/{chatroom_id}/user/{username}100 次/秒/App IDAPI 类型 350 QPS,400 元/月
强制设置聊天室自定义属性PUT/app-id/{app_id}/metadata/chatroom/{chatroom_id}/user/{username}/forced100 次/秒/App IDAPI 类型 350 QPS,400 元/月
删除聊天室自定义属性DELETE/app-id/{app_id}/metadata/chatroom/{chatroom_id}/user/{username}100 次/秒/App IDAPI 类型 350 QPS,400 元/月
强制删除聊天室自定义属性DELETE/app-id/{app_id}/metadata/chatroom/{chatroom_id}/user/{username}/forced100 次/秒/App IDAPI 类型 350 QPS,400 元/月

聊天室成员管理

RESTful API 接口方法接口 URL接口最高调用频率(默认值)是否可调API 类型超额费用
分页获取聊天室成员GET/app-id/{app_id}/chatrooms/{chatroom_id}/users100 次/秒/App IDAPI 类型 250 QPS,200 元/月
添加单个聊天室成员POST/app-id/{app_id}/chatrooms/{chatroom_id}/users/{username}100 次/秒/App IDAPI 类型 150 QPS,100 元/月
批量添加聊天室成员POST/app-id/{app_id}/chatrooms/{chatroom_id}/users100 次/秒/App IDAPI 类型 250 QPS,200 元/月
删除单个聊天室成员DELETE/app-id/{app_id}/chatrooms/{chatroom_id}/users/{username}100 次/秒/App IDAPI 类型 150 QPS,100 元/月
批量删除聊天室成员DELETE/app-id/{app_id}/chatrooms/{chatroom_id}/users/{usernames}100 次/秒/App IDAPI 类型 250 QPS,200 元/月
获取聊天室管理员列表GET/app-id/{app_id}/chatrooms/{chatroom_id}/admin100 次/秒/App IDAPI 类型 150 QPS,100 元/月
添加聊天室管理员POST/app-id/{app_id}/chatrooms/{chatroom_id}/admin100 次/秒/App IDAPI 类型 150 QPS,100 元/月
移除聊天室管理员DELETE/app-id/{app_id}/chatrooms/{chatroom_id}/admin/{oldadmin}100 次/秒/App IDAPI 类型 150 QPS,100 元/月
查询聊天室黑名单GET/app-id/{app_id}/chatrooms/{chatroom_id}/blocks/users100 次/秒/App IDAPI 类型 150 QPS,100 元/月
添加单个用户至聊天室黑名单POST/app-id/{app_id}/chatrooms/{chatroom_id}/blocks/users/{username}100 次/秒/App IDAPI 类型 150 QPS,100 元/月
批量添加用户至聊天室黑名单POST/app-id/{app_id}/chatrooms/{chatroom_id}/blocks/users100 次/秒/App IDAPI 类型 150 QPS,100 元/月
从聊天室黑名单移除单个用户DELETE/app-id/{app_id}/chatrooms/{chatroom_id}/blocks/users/{username}100 次/秒/App IDAPI 类型 150 QPS,100 元/月
批量从聊天室黑名单移除用户DELETE/app-id/{app_id}/chatrooms/{chatroom_id}/blocks/users/{usernames}100 次/秒/App IDAPI 类型 150 QPS,100 元/月
查询聊天室白名单GET/app-id/{app_id}/chatrooms/{chatroom_id}/white/users`100 次/秒/App IDAPI 类型 150 QPS,100 元/月
添加单个用户至聊天室白名单POST/app-id/{app_id}/chatrooms/{chatroom_id}/white/users/{username}100 次/秒/App IDAPI 类型 150 QPS,100 元/月
批量添加用户至聊天室白名单POST/app-id/{app_id}/chatrooms/{chatroom_id}/white/users100 次/秒/App IDAPI 类型 150 QPS,100 元/月
将用户移除聊天室白名单DELETE/app-id/{app_id}/chatrooms/{chatroom_id}/white/users/{username}100 次/秒/App IDAPI 类型 150 QPS,100 元/月
获取聊天室的禁言列表GET/app-id/{app_id}/chatrooms/{chatroom_id}/mute100 次/秒/App IDAPI 类型 150 QPS,100 元/月
禁言聊天室成员POST/app-id/{app_id}/chatrooms/{chatroom_id}/mute100 次/秒/App ID
禁言聊天室全体成员POST/app-id/{app_id}/chatrooms/{chatroom_id}/ban100 次/秒/App IDAPI 类型 150 QPS,100 元/月
解除聊天室禁言成员DELETE/app-id/{app_id}/chatrooms/{chatroom_id}/mute/{member1}(,{member2},…)100 次/秒/App IDAPI 类型 150 QPS,100 元/月
解除聊天室全员禁言DELETE/app-id/{app_id}/chatrooms/{chatroom_id}/ban100 次/秒/App IDAPI 类型 150 QPS,100 元/月
获取超级管理员列表GET/app-id/{app_id}/chatrooms/super_admin100 次/秒/App IDAPI 类型 150 QPS,100 元/月
添加超级管理员POST/app-id/{app_id}/chatrooms/super_admin100 次/秒/App IDAPI 类型 150 QPS,100 元/月
移除超级管理员DELETE/app-id/{app_id}/chatrooms/super_admin/{superAdmin}100 次/秒/App IDAPI 类型 150 QPS,100 元/月

用户相关

用户体系管理

Restful API 接口方法接口 URL
注册单个/批量用户POST/app-id/{app_id}/users
RESTful API 接口方法接口 URL接口最高调用频率(默认值)
获取单个用户GET/app-id/{app_id}/users/{username}100 次/秒/App ID
设置推送消息显示昵称/展示方式PUT/app-id/{app_id}/users/{userId}100 次/秒/App ID
* 批量获取用户GET/app-id/{app_id}/users100 次/秒/App ID
* 删除单个用户DELETE/app-id/{app_id}/users/{username}100 次/秒/App ID
* 批量删除用户DELETE/app-id/{app_id}/users30 次/秒/App ID
* 修改用户密码POST/app-id/{app_id}/users/{username}/password100 次/秒/App ID
* 获取用户在线状态GET/app-id/{app_id}/users/{username}/status100 次/秒/App ID
* 批量获取用户在线状态POST/app-id/{app_id}/users/batch/status50 次/秒/App ID
* 获取离线消息数GET/app-id/{app_id}/users/{owner_username}/offline_msg_count100 次/秒/App ID
* 获取离线消息的状态GET/app-id/{app_id}/users/{username}/offline_msg_status/{msg_id}100 次/秒/App ID
* 账号封禁POST/app-id/{app_id}/users/{username}/deactivate100 次/秒/App ID
* 账号解禁POST/app-id/{app_id}/users/{username}/activate100 次/秒/App ID
* 强制用户下线GET/app-id/{app_id}/users/{username}/disconnect100 次/秒/App ID
* 强制用户从单设备下线DELETE/app-id/{app_id}/users/{username}/disconnect/{resourceId}100 次/秒/App ID
* 获取指定账号的在线登录设备列表GET/app-id/{app_id}/users/{username}/resources100 次/秒/App ID

用户属性

RESTful API 接口方法接口 URL接口最高调用频率(默认值)
设置用户属性PUT/app-id/{app_id}/metadata/user/{username}100 次/秒/App ID
批量获取用户属性POST/app-id/{app_id}/metadata/user/get100 次/秒/App ID
删除用户属性DELETE/app-id/{app_id}/metadata/user/{username}100 次/秒/App ID
获取指定用户的所有用户属性GET/app-id/{app_id}/metadata/user/{username}100 次/秒/App ID
* 获取 app 下的用户属性总大小GET/app-id/{app_id}/metadata/user/capacity100 次/秒/App ID

用户在线状态订阅

RESTful API 接口方法接口 URL接口最高调用频率(默认值)
设置用户在线状态信息POST/app-id/{app_id}/users/{uid}/presence/{resource}/{status}50 次/秒/App ID
批量订阅在线状态POST/app-id/{app_id}/users/{uid}/presence/{expiry}50 次/秒/App ID
批量获取在线状态信息POST/app-id/{app_id}/users/{uid}/presence50 次/秒/App ID
查询单个群组的在线成员数量GET/app-id/{app_id}/presence/online/{group_id}/type/{query_type}100 次/秒/App ID
取消订阅多个用户的在线状态DELETE/app-id/{app_id}/users/{uid}/presence50 次/秒/App ID
查询订阅列表GET/app-id/{app_id}/users/{uid}/presence/sublist?pageNum={pagenumber}&pageSize={pagesize}50 次/秒/App ID

全局禁言

RESTful API 接口方法接口 URL接口最高调用频率(默认值)
* 设置用户全局禁言POST/app-id/{app_id}/mutes100 次/秒/App ID
* 查询单个用户 ID 全局禁言GET/{org_name}/{appName}/mutes/username100 次/秒/App ID
* 查询 app 下的所有全局禁言的用户GET/app-id/{app_id}/mutes100 次/秒/App ID

用户关系管理

RESTful API 接口方法接口 URL接口最高调用频率
添加好友POST/app-id/{app_id}/users/{owner_username}/contacts/users/{friend_username}100 次/秒/App ID
移除好友DELETE/app-id/{app_id}/users/{owner_username}/contacts/users/{friend_username}100 次/秒/App ID
设置好友备注PUT/app-id/{app_id}/user/{owner_username}/contacts/users/{friend_username}100 次/秒/App ID
一次性获取好友列表GET/app-id/{app_id}/users/{owner_username}/contacts/users100 次/秒/App ID
获取黑名单列表GET/app-id/{app_id}/users/{owner_username}/blocks/users50 次/秒/App ID
添加用户至黑名单POST/app-id/{app_id}/users/{owner_username}/blocks/users50 次/秒/App ID
从黑名单移除用户DELETE/app-id/{app_id}/users/{owner_username}/blocks/users/{blocked_username}50 次/秒/App ID

回调

RESTful API 接口方法接口 URL接口最高调用频率(默认值)是否可调API 类型超额费用
查询回调储存详情GET/app-id/callbacks/storage/info100 次/秒/App KeyAPI 类型 250 QPS,200 元/月
补发回调存储信息POST/app-id/callbacks/storage/retry100 次/秒/App KeyAPI 类型 250 QPS,200 元/月
上次编辑于: