Skip to main content
POST
https://server.codeium.com
/
api
/
v1
/
UserPageAnalytics
Get User Page Analytics
curl --request POST \
  --url https://server.codeium.com/api/v1/UserPageAnalytics \
  --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>"
}

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

service_key
string
required
Your service key with “Teams Read-only” permissions
group_name
string
Filter results to users in a specific group (optional)
start_timestamp
string
Start time in RFC 3339 format (e.g., 2023-01-01T00:00:00Z). Only affects the activeDays calculation. If not provided, defaults to 1 year ago.
end_timestamp
string
End time in RFC 3339 format (e.g., 2023-12-31T23:59:59Z). Only affects the activeDays calculation. If not provided, defaults to the current time.

Example Request

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

userTableStats
array
Array of user statistics objects
billingCycleStart
string
The start of the current billing cycle in RFC 3339 format. The promptCreditsUsed values in userTableStats correspond to usage within this billing cycle.
billingCycleEnd
string
The end of the current billing cycle in RFC 3339 format. The promptCreditsUsed values in userTableStats correspond to usage within this billing cycle.

Example Response

{
  "userTableStats": [
    {
      "name": "Alice",
      "email": "[email protected]",
      "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": "[email protected]",
      "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

error
string
Error message describing what went wrong
Common error scenarios:
  • Invalid service key or insufficient permissions
  • Invalid timestamp format
  • Group not found
  • Rate limit exceeded