获取指定时间范围内,企业在各客户端的活跃成员数。
statistics:read
GET{域名}/openapi/v1/statistics/active-users时间跨度最长为 180 天。
| Header 参数 | 是否必填 | 描述 |
|---|---|---|
Authorization |
是 | 固定取值为 Bearer {access_token}。关于如何获取访问令牌,参考鉴权。 |
| 参数 | 类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
start_date |
string | 是 | - | 开始日期。格式:YYYY-MM-DD。 |
end_date |
string | 是 | - | 结束日期。格式:YYYY-MM-DD。 |
timezone |
string | 否 | "Asia/Shanghai" |
时区。需使用 IANA 时区名称。 |
|
|
string |
否 |
- |
目标部门的 ID。若传入该参数,则仅返回该部门的数据。省略则统计整个企业的数据。 部门 ID 可以通过 “获取单个父部门的子部门” 接口或 ”按关键词搜索部门“ 接口获取。 |
|
|
bool |
否 |
|
是否返回目标部门的所有后代部门的数据:
该参数仅在传入 |
该接口独有的响应参数如下,参数位于 data 中。通用响应参数参考此文档。
| 参数 | 类型 | 描述 |
|---|---|---|
total_active_users |
int64 | 所有客户端去重后的活跃成员总数。如果同一成员在多个客户端上活跃,只会被计算一次。 |
ide_active_users |
int64 | TraeCode 中的活跃成员数。 |
plugin_active_users |
int64 | TraeCode Plugin 中的活跃成员数。 |
cli_active_users |
int64 | TraeCode CLI 中的活跃成员数。 |
solo_desktop_code_active_users |
int64 | TraeWork 桌面版 Code 模式中的活跃成员数。 |
solo_desktop_work_active_users |
int64 | TraeWork 桌面版 Work 模式中的活跃成员数。 |
solo_web_code_active_users |
int64 | TraeWork 网页版 Code 模式中的活跃成员数。 |
solo_web_work_active_users |
int64 | TraeWork 网页版 Work 模式中的活跃成员数。 |
curl -X GET "${HOST}/openapi/v1/statistics/active-users?start_date=2026-08-01&end_date=2026-08-15&department_id=20001&include_subtree=false" \
-H "Authorization: Bearer ${ACCESS_TOKEN}"
{
"code": 0,
"message": "success",
"request_id": "req_xxx",
"data": {
"total_active_users": 120,
"ide_active_users": 100,
"plugin_active_users": 30,
"cli_active_users": 8,
"solo_desktop_code_active_users": 5,
"solo_desktop_work_active_users": 2,
"solo_web_code_active_users": 3,
"solo_web_work_active_users": 1
}
}
若该接口的请求返回错误码,参考错误码文档进行排查。