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

# Get User Page Analytics

> Retrieve user activity statistics including names, emails, last activity times, active days, and prompt credits used from the teams page.

## Overview

Get user activity statistics that appear on the teams page, including user names, emails, last activity times, active days, and prompt credits used.

## Request

<ParamField body="service_key" type="string" required>
  Your service key with "Teams Read-only" permissions
</ParamField>

<ParamField body="group_name" type="string">
  Filter results to users in a specific group (optional)
</ParamField>

<ParamField body="start_timestamp" type="string">
  Start time in RFC 3339 format (e.g., `2023-01-01T00:00:00Z`). Sets the start of the time range used for `activeDays` and `promptCreditsUsed`. If not provided, defaults to 1 year ago.
</ParamField>

<ParamField body="end_timestamp" type="string">
  End time in RFC 3339 format (e.g., `2023-12-31T23:59:59Z`). Sets the end of the time range used for `activeDays` and `promptCreditsUsed`. If not provided, defaults to the current time.
</ParamField>

### Example Request

```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
```

## Response

<Warning>
  For non-Devin teams, `apiKey` contains a raw user API key, not a hash. Treat it as a secret: remove or redact it before logging, exporting, or sharing analytics. If you must retain unredacted responses, restrict access and store them securely.
</Warning>

<ResponseField name="userTableStats" type="array">
  Array of user statistics objects

  <Expandable title="User Statistics Object">
    <ResponseField name="name" type="string">
      User's display name
    </ResponseField>

    <ResponseField name="email" type="string">
      User's email address
    </ResponseField>

    <ResponseField name="lastUpdateTime" type="string">
      Timestamp of user's last activity in RFC 3339 format
    </ResponseField>

    <ResponseField name="apiKey" type="string">
      For non-Devin teams, the user's raw API key. Handle this value as a secret, not as a public analytics identifier. For Devin teams, this field contains the Devin user ID instead.
    </ResponseField>

    <ResponseField name="activeDays" type="number">
      The number of days the user was active within the queried time range (defined by `start_timestamp` and `end_timestamp`). A day is counted as active if the user had any autocomplete acceptances, Cascade usage, or command usage on that day.
    </ResponseField>

    <ResponseField name="disableCodeium" type="boolean">
      Indicates whether Devin Desktop access has been disabled for the user by an admin. This field is only present if access has been explicitly disabled, and will always be set to true in that case.
    </ResponseField>

    <ResponseField name="role" type="string">
      The user's role within the team (e.g., admin, member)
    </ResponseField>

    <ResponseField name="signupTime" type="string">
      Timestamp of when the user signed up, in RFC 3339 format
    </ResponseField>

    <ResponseField name="lastAutocompleteUsageTime" type="string">
      The most recent timestamp the Tab/Autocomplete modality was used, in RFC 3339 format
    </ResponseField>

    <ResponseField name="lastChatUsageTime" type="string">
      The most recent timestamp the Cascade modality was used, in RFC 3339 format
    </ResponseField>

    <ResponseField name="lastCommandUsageTime" type="string">
      The most recent timestamp the Command modality was used, in RFC 3339 format
    </ResponseField>

    <ResponseField name="promptCreditsUsed" type="number">
      The total number of prompt credits used by this user on this team within the queried time range (defined by `start_timestamp` and `end_timestamp`), returned in **cents** (1 credit = 100 cents). To get the actual credit usage, divide this value by 100. Usage is recorded in hourly buckets, and a bucket counts only when the start of its hour falls within the range. For example, a range of 10:30–11:30 includes all usage from 11:00–11:59 and none from 10:00–10:59, and a range of 10:15–10:45 includes no usage. Users with no usage in the range return `0`. This value is **not** tied to the current billing cycle reported in `billingCycleStart` and `billingCycleEnd`.
    </ResponseField>

    <ResponseField name="teamStatus" type="string">
      The user's team membership status. Possible values: `USER_TEAM_STATUS_UNSPECIFIED`, `USER_TEAM_STATUS_PENDING`, `USER_TEAM_STATUS_APPROVED`, `USER_TEAM_STATUS_REJECTED`. Note that the API returns all users regardless of team status, while the Manage Members UI only shows approved users.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="billingCycleStart" type="string">
  The start of the team's current billing cycle in RFC 3339 format. This field is independent of the requested time range and does not bound the `promptCreditsUsed` values in `userTableStats`.
</ResponseField>

<ResponseField name="billingCycleEnd" type="string">
  The end of the team's current billing cycle in RFC 3339 format. This field is independent of the requested time range and does not bound the `promptCreditsUsed` values in `userTableStats`.
</ResponseField>

### Example Response

The `apiKey` values below are example placeholders, not real credentials.

```json theme={null}
{
  "userTableStats": [
    {
      "name": "Alice",
      "email": "alice@cognition.ai",
      "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@cognition.ai",
      "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 Responses

<ResponseField name="error" type="string">
  Error message describing what went wrong
</ResponseField>

Common error scenarios:

* Invalid service key or insufficient permissions
* Invalid timestamp format
* Group not found
* Rate limit exceeded


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.