> ## Documentation Index
> Fetch the complete documentation index at: https://docs.windsurf.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 获取用户页面 Analytics 数据

> 从 Teams 页面获取用户活动统计数据，包括姓名、emails、最近活动时间和活跃天数。

<div id="overview">
  ## 概览
</div>

获取显示在 Teams 页面上的用户活动统计信息，包括用户名、emails、最近活动时间和活跃天数。

<div id="request">
  ## 请求
</div>

<ParamField body="service_key" type="string" required>
  具备“Teams Read-only”权限的服务密钥
</ParamField>

<ParamField body="group_name" type="string">
  将结果筛选为特定群组内的用户（可选）
</ParamField>

<ParamField body="start_timestamp" type="string">
  按 RFC 3339 格式的开始时间（例如：`2023-01-01T00:00:00Z`）
</ParamField>

<ParamField body="end_timestamp" type="string">
  按 RFC 3339 格式的结束时间（例如：`2023-12-31T23:59:59Z`）
</ParamField>

<div id="example-request">
  ### 示例请求
</div>

```bash theme={null}
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
```

<div id="response">
  ## 响应
</div>

<ResponseField name="userTableStats" type="array">
  用户统计对象数组

  <Expandable title="用户统计对象">
    <ResponseField name="name" type="string">
      用户的显示名称
    </ResponseField>

    <ResponseField name="email" type="string">
      用户的电子邮件地址
    </ResponseField>

    <ResponseField name="lastUpdateTime" type="string">
      用户上次活动的时间戳，格式为 RFC 3339
    </ResponseField>

    <ResponseField name="apiKey" type="string">
      用户 API Key 的哈希值
    </ResponseField>

    <ResponseField name="activeDays" type="number">
      在查询时间范围内用户保持活跃的总天数
    </ResponseField>

    <ResponseField name="disableCodeium" type="boolean">
      指示管理员是否已为该用户禁用对 Windsurf 的访问。仅当访问被明确禁用时该字段才会出现，并且在这种情况下其值始终为 true。
    </ResponseField>

    <ResponseField name="lastAutocompleteUsageTime" type="string">
      最近一次使用 Tab/Autocomplete 模式的时间戳，格式为 RFC 3339
    </ResponseField>

    <ResponseField name="lastChatUsageTime" type="string">
      最近一次使用 Cascade 模式的时间戳，格式为 RFC 3339
    </ResponseField>

    <ResponseField name="lastCommandUsageTime" type="string">
      最近一次使用 Command 模式的时间戳，格式为 RFC 3339
    </ResponseField>

    <ResponseField name="teamStatus" type="string">
      用户的团队成员状态。可能的取值：`USER_TEAM_STATUS_UNSPECIFIED`、`USER_TEAM_STATUS_PENDING`、`USER_TEAM_STATUS_APPROVED`、`USER_TEAM_STATUS_REJECTED`。请注意，API 会返回所有用户（无论团队状态如何），而 Manage Members 界面仅显示已批准的用户。
    </ResponseField>
  </Expandable>
</ResponseField>

<div id="example-response">
  ### 示例回复
</div>

```json theme={null}
{
  "userTableStats": [
    {
      "name": "Alice",
      "email": "alice@windsurf.com",
      "lastUpdateTime": "2024-10-10T22:56:10.771591Z",
      "apiKey": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa",
      "activeDays": 178,
      "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": 462,
      "teamStatus": "USER_TEAM_STATUS_APPROVED"
    },
    {
      "name": "Charlie",
      "email": "charlie@windsurf.com",
      "lastUpdateTime": "2024-10-10T16:43:46.117870Z",
      "apiKey": "cccccccc-cccc-cccc-cccc-cccccccccccc",
      "activeDays": 237,
      "teamStatus": "USER_TEAM_STATUS_PENDING"
    }
  ]
}
```

<div id="error-responses">
  ## 错误响应
</div>

<ResponseField name="error" type="string">
  描述出错原因的错误信息
</ResponseField>

常见错误情况：

* 服务密钥无效或权限不足
* 时间戳格式无效
* 找不到群组
* 超过速率限制
