跳转到主要内容
POST
/
api
/
v1
/
UserPageAnalytics
获取用户页面分析数据
curl --request POST \
  --url https://server.codeium.com/api/v1/UserPageAnalytics \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "service_key": "<string>",
  "group_name": "<string>",
  "start_timestamp": "<string>",
  "end_timestamp": "<string>"
}
'
{
  "userTableStats": [
    {
      "name": "<string>",
      "email": "<string>",
      "lastUpdateTime": "<string>",
      "apiKey": "<string>",
      "activeDays": 123,
      "disableCodeium": true,
      "role": "<string>",
      "signupTime": "<string>",
      "lastAutocompleteUsageTime": "<string>",
      "lastChatUsageTime": "<string>",
      "lastCommandUsageTime": "<string>",
      "promptCreditsUsed": 123,
      "teamStatus": "<string>"
    }
  ],
  "billingCycleStart": "<string>",
  "billingCycleEnd": "<string>",
  "error": "<string>"
}

Documentation Index

Fetch the complete documentation index at: https://docs.devinenterprise.com/llms.txt

Use this file to discover all available pages before exploring further.

概览

获取团队页面上显示的用户活动统计信息,包括用户名、电子邮件、最近活动时间、活跃天数以及已使用的提示额度。

请求

service_key
string
必填
具有“Teams 只读”权限的服务密钥
group_name
string
将结果筛选为特定组中的用户 (可选)
start_timestamp
string
开始时间,采用 RFC 3339 格式 (例如:2023-01-01T00:00:00Z) 。仅影响 activeDays 的计算。 如果未提供,则默认为 1 年前。
end_timestamp
string
结束时间,采用 RFC 3339 格式 (例如:2023-12-31T23:59:59Z) 。仅影响 activeDays 的计算。 如果未提供,则默认为当前时间。

请求示例

curl -X POST --header "Content-Type: application/json" \
--data '{
  "service_key": "your_service_key_here",
  "group_name": "engineering_team",
  "start_timestamp": "2024-01-01T00:00:00Z",
  "end_timestamp": "2024-12-31T23:59:59Z"
}' \
https://server.codeium.com/api/v1/UserPageAnalytics

响应

userTableStats
array
用户统计对象数组
billingCycleStart
string
当前账单周期的开始时间,采用 RFC 3339 格式。userTableStats 中的 promptCreditsUsed 值对应此账单周期内的用量。
billingCycleEnd
string
当前账单周期的结束时间,采用 RFC 3339 格式。userTableStats 中的 promptCreditsUsed 值对应此账单周期内的用量。

响应示例

{
  "userTableStats": [
    {
      "name": "Alice",
      "email": "alice@windsurf.com",
      "lastUpdateTime": "2024-10-10T22:56:10.771591Z",
      "apiKey": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa",
      "activeDays": 178,
      "role": "admin",
      "signupTime": "2024-01-15T08:30:00Z",
      "lastAutocompleteUsageTime": "2024-10-10T22:56:10Z",
      "lastChatUsageTime": "2024-10-10T20:30:00Z",
      "promptCreditsUsed": 12500,
      "teamStatus": "USER_TEAM_STATUS_APPROVED"
    },
    {
      "name": "Bob",
      "email": "bob@windsurf.com",
      "lastUpdateTime": "2024-10-10T18:11:23.980237Z",
      "apiKey": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb",
      "activeDays": 210,
      "role": "member",
      "signupTime": "2024-02-01T10:00:00Z",
      "lastAutocompleteUsageTime": "2024-10-10T18:11:23Z",
      "lastChatUsageTime": "2024-10-09T14:22:00Z",
      "lastCommandUsageTime": "2024-10-08T09:15:00Z",
      "promptCreditsUsed": 8300,
      "teamStatus": "USER_TEAM_STATUS_APPROVED"
    }
  ],
  "billingCycleStart": "2024-10-01T00:00:00Z",
  "billingCycleEnd": "2024-11-01T00:00:00Z"
}

错误响应

error
string
说明出错原因的错误消息
常见错误情况:
  • 服务密钥无效或权限不足
  • 时间戳格式无效
  • 未找到组
  • 超出速率限制