Preview FeatureThe Analytics API is currently in preview and is available exclusively to Enterprise customers.
Important: Timezone and Data AvailabilityAll dates in requests and responses are interpreted and returned in UTC timezone. The most recent queryable date is “yesterday” (UTC), and data for the previous day becomes available at approximately 02:00 UTC each day.
Data FreshnessAnalytics data is updated once daily. Data for a given day becomes available the following day at approximately 02:00 UTC.
GET /analytics/v0/dau-count
Returns daily active user counts over a date range.
Query Parameters
| Parameter | Type | Required | Description |
|---|
| start_date | string | No | Start date in YYYY-MM-DD format (UTC) |
| end_date | string | No | End date in YYYY-MM-DD format (UTC) |
Date Range Behavior
| Scenario | Behavior |
|---|
| Neither date provided | Returns last 7 days ending at yesterday (UTC) |
Only start_date provided | Returns 7 days starting from start_date, capped at yesterday |
Only end_date provided | Returns 7 days ending at end_date |
| Both dates provided | Returns the specified inclusive range |
Constraints
| Constraint | Value |
|---|
| Maximum date range | 90 days |
| Maximum historical lookback | 2 years |
| Today and future dates | Not allowed (data available at ~02:00 UTC next day) |
| Timezone | All dates interpreted as UTC |
Example Request
curl -X GET "https://api.augmentcode.com/analytics/v0/dau-count?start_date=2025-10-15&end_date=2025-10-20" \
-H "Authorization: Bearer <your-api-token>"
Example Response
{
"daily_active_user_counts": [
{"date": "2025-10-15", "user_count": 100},
{"date": "2025-10-16", "user_count": 120},
{"date": "2025-10-17", "user_count": 95},
{"date": "2025-10-18", "user_count": 140},
{"date": "2025-10-19", "user_count": 88},
{"date": "2025-10-20", "user_count": 110}
],
"metadata": {
"effective_start_date": "2025-10-15",
"effective_end_date": "2025-10-20",
"generated_at": "2025-10-21T10:30:00Z",
"total_days": 6
}
}
Response Fields
| Field | Type | Description |
|---|
| daily_active_user_counts | array | Array of daily user counts, one per day |
| daily_active_user_counts[].date | string | Calendar date (YYYY-MM-DD) |
| daily_active_user_counts[].user_count | integer | Number of unique active users |
| metadata.effective_start_date | string | Actual start date used (UTC, after defaults/clamping) |
| metadata.effective_end_date | string | Actual end date used (UTC, after defaults/clamping) |
| metadata.generated_at | string | Response generation timestamp (ISO 8601) |
| metadata.total_days | integer | Number of days in the range |
GET /analytics/v0/dau
Returns the list of active users for a specific date. Supports pagination.
Query Parameters
| Parameter | Type | Required | Description |
|---|
| date | string | No | Date to query in YYYY-MM-DD format (UTC) |
| cursor | string | No | Pagination cursor from previous response |
| page_size | integer | No | Number of results per page |
Date Behavior
| Scenario | Behavior |
|---|
| Date not provided | Defaults to yesterday (UTC) |
| Date provided | Returns users active on that date (must be yesterday or earlier) |
| Parameter | Default | Maximum |
|---|
| page_size | 100 | 250 |
To paginate through results:
- Make initial request (optionally with
page_size)
- If
pagination.has_more is true, use pagination.next_cursor as the cursor parameter
- Repeat until
has_more is false
Constraints
| Constraint | Value |
|---|
| Maximum historical lookback | 2 years |
| Today and future dates | Not allowed (data available at ~02:00 UTC next day) |
| Timezone | All dates interpreted as UTC |
Example Request (First Page)
curl -X GET "https://api.augmentcode.com/analytics/v0/dau?date=2025-10-15&page_size=50" \
-H "Authorization: Bearer <your-api-token>"
Example Response
{
"users": [
{"user_email": "[email protected]"},
{"user_email": "[email protected]"},
{"service_account_name": "ci-bot"}
],
"pagination": {
"next_cursor": "eyJsYXN0X2lkIjoidXNlcjUwIn0=",
"has_more": true
},
"metadata": {
"effective_date": "2025-10-15",
"generated_at": "2025-10-16T10:30:00Z",
"returned_user_count": 3
}
}
Example Request (Next Page)
curl -X GET "https://api.augmentcode.com/analytics/v0/dau?date=2025-10-15&page_size=50&cursor=eyJsYXN0X2lkIjoidXNlcjUwIn0=" \
-H "Authorization: Bearer <your-api-token>"
Response Fields
| Field | Type | Description |
|---|
| users | array | Array of active users |
| users[].user_email | string | User’s email address (for regular users) |
| users[].service_account_name | string | Service account name (for service accounts) |
| pagination.next_cursor | string | Cursor for fetching next page (empty if no more results) |
| pagination.has_more | boolean | true if more results are available |
| metadata.effective_date | string | Actual date used (UTC, after defaults) |
| metadata.generated_at | string | Response generation timestamp (ISO 8601) |
| metadata.returned_user_count | integer | Number of users returned in this page |
Each user has either user_email or service_account_name, never both.
GET /analytics/v0/daily-usage
Returns daily usage metrics for your organization over a date range. Days with no activity are omitted from the response.
Query Parameters
| Parameter | Type | Required | Description |
|---|
| start_date | string | No | Start date in YYYY-MM-DD format (UTC) |
| end_date | string | No | End date in YYYY-MM-DD format (UTC) |
Date Range Behavior
| Scenario | Behavior |
|---|
| Neither date provided | Returns last 7 days ending at yesterday (UTC) |
Only start_date provided | Returns 7 days starting from start_date, capped at yesterday |
Only end_date provided | Returns 7 days ending at end_date |
| Both dates provided | Returns the specified inclusive range |
Constraints
| Constraint | Value |
|---|
| Maximum date range | 90 days |
| Maximum historical lookback | 2 years |
| Today and future dates | Not allowed (data available at ~02:00 UTC next day) |
| Timezone | All dates interpreted as UTC |
Example Request
curl -s -X GET "https://api.augmentcode.com/analytics/v0/daily-usage?start_date=2025-10-15&end_date=2025-10-20" \
-H "Authorization: Bearer <your-api-token>" | jq .
Example Response
{
"daily_usage": [
{
"date": "2025-10-15",
"metrics": {
"total_modified_lines_of_code": 1250,
"total_messages": 340,
"total_tool_calls": 890,
"completions_count": 1500,
"completions_accepted": 1120,
"completions_lines_of_code": 980,
"chat_messages": 85,
"remote_agent_messages": 45,
"remote_agent_lines_of_code": 120,
"ide_agent_messages": 150,
"ide_agent_lines_of_code": 95,
"cli_agent_interactive_messages": 40,
"cli_agent_interactive_lines_of_code": 35,
"cli_agent_non_interactive_messages": 20,
"cli_agent_non_interactive_lines_of_code": 20
}
}
],
"metadata": {
"effective_start_date": "2025-10-15",
"effective_end_date": "2025-10-20",
"generated_at": "2025-10-21T10:30:00Z",
"total_days": 1
}
}
Response Fields
| Field | Type | Description |
|---|
| daily_usage | array | Array of daily usage data points (days with no activity omitted) |
| daily_usage[].date | string | Calendar date (YYYY-MM-DD) |
| daily_usage[].metrics | object | Usage metrics for this date |
| daily_usage[].metrics.total_modified_lines_of_code | integer | Total lines of code modified across all interactions |
| daily_usage[].metrics.total_messages | integer | Total messages across all interaction types |
| daily_usage[].metrics.total_tool_calls | integer | Total tool calls across all agent types |
| daily_usage[].metrics.completions_count | integer | Number of completion requests |
| daily_usage[].metrics.completions_accepted | integer | Number of completions accepted by users |
| daily_usage[].metrics.completions_lines_of_code | integer | Lines of code from completions |
| daily_usage[].metrics.completions_suggested_lines_of_code | integer | Lines of code suggested by completions (before acceptance) |
| daily_usage[].metrics.chat_messages | integer | Number of chat messages |
| daily_usage[].metrics.remote_agent_messages | integer | Number of Remote Agent messages |
| daily_usage[].metrics.remote_agent_lines_of_code | integer | Lines of code from Remote Agent |
| daily_usage[].metrics.ide_agent_messages | integer | Number of IDE Agent messages |
| daily_usage[].metrics.ide_agent_lines_of_code | integer | Lines of code from IDE Agent |
| daily_usage[].metrics.cli_agent_interactive_messages | integer | Number of CLI Agent interactive messages |
| daily_usage[].metrics.cli_agent_interactive_lines_of_code | integer | Lines of code from CLI Agent interactive mode |
| daily_usage[].metrics.cli_agent_non_interactive_messages | integer | Number of CLI Agent non-interactive messages |
| daily_usage[].metrics.cli_agent_non_interactive_lines_of_code | integer | Lines of code from CLI Agent non-interactive mode |
| metadata.effective_start_date | string | Actual start date used (UTC, after defaults/clamping) |
| metadata.effective_end_date | string | Actual end date used (UTC, after defaults/clamping) |
| metadata.generated_at | string | Response generation timestamp (ISO 8601) |
| metadata.total_days | integer | Number of days with data in the response |
GET /analytics/v0/user-activity
Returns aggregated usage metrics per user over a date range. Users with no activity are omitted. Supports pagination.
Query Parameters
| Parameter | Type | Required | Description |
|---|
| start_date | string | No | Start date in YYYY-MM-DD format (UTC) |
| end_date | string | No | End date in YYYY-MM-DD format (UTC) |
| cursor | string | No | Pagination cursor from previous response |
| page_size | integer | No | Number of results per page |
Date Range Behavior
| Scenario | Behavior |
|---|
| Neither date provided | Returns last 7 days ending at yesterday (UTC) |
Only start_date provided | Returns 7 days starting from start_date, capped at yesterday |
Only end_date provided | Returns 7 days ending at end_date |
| Both dates provided | Returns the specified inclusive range |
| Parameter | Default | Maximum |
|---|
| page_size | 50 | 100 |
To paginate through results:
- Make initial request (optionally with
page_size)
- If
pagination.has_more is true, use pagination.next_cursor as the cursor parameter
- Repeat until
has_more is false
Constraints
| Constraint | Value |
|---|
| Maximum date range | 90 days |
| Maximum historical lookback | 2 years |
| Today and future dates | Not allowed (data available at ~02:00 UTC next day) |
| Timezone | All dates interpreted as UTC |
Example Request
curl -s -X GET "https://api.augmentcode.com/analytics/v0/user-activity?start_date=2025-10-15&end_date=2025-10-20&page_size=3" \
-H "Authorization: Bearer <your-api-token>" | jq .
Example Response
{
"users": [
{
"user_email": "[email protected]",
"active_days": 5,
"metrics": {
"total_modified_lines_of_code": 450,
"total_messages": 65,
"total_tool_calls": 120,
"completions_count": 320,
"completions_accepted": 280,
"completions_lines_of_code": 350,
"chat_messages": 25,
"remote_agent_messages": 10,
"remote_agent_lines_of_code": 45,
"ide_agent_messages": 30,
"ide_agent_lines_of_code": 40,
"cli_agent_interactive_messages": 8,
"cli_agent_interactive_lines_of_code": 10,
"cli_agent_non_interactive_messages": 5,
"cli_agent_non_interactive_lines_of_code": 5
}
},
{
"user_email": "[email protected]",
"active_days": 3,
"metrics": {
"total_modified_lines_of_code": 280,
"total_messages": 70,
"total_tool_calls": 75,
"completions_count": 150,
"completions_accepted": 120,
"completions_lines_of_code": 180,
"chat_messages": 40,
"remote_agent_messages": 5,
"remote_agent_lines_of_code": 25,
"ide_agent_messages": 20,
"ide_agent_lines_of_code": 55,
"cli_agent_interactive_messages": 3,
"cli_agent_interactive_lines_of_code": 15,
"cli_agent_non_interactive_messages": 2,
"cli_agent_non_interactive_lines_of_code": 5
}
},
{
"service_account_name": "ci-bot",
"active_days": 6,
"metrics": {
"total_modified_lines_of_code": 200,
"total_messages": 50,
"total_tool_calls": 85,
"completions_count": 0,
"completions_accepted": 0,
"completions_lines_of_code": 0,
"chat_messages": 0,
"remote_agent_messages": 0,
"remote_agent_lines_of_code": 0,
"ide_agent_messages": 0,
"ide_agent_lines_of_code": 0,
"cli_agent_interactive_messages": 0,
"cli_agent_interactive_lines_of_code": 0,
"cli_agent_non_interactive_messages": 50,
"cli_agent_non_interactive_lines_of_code": 200
}
}
],
"pagination": {
"next_cursor": "eyJsYXN0X2lkIjoidXNlcjMifQ==",
"has_more": true
},
"metadata": {
"effective_start_date": "2025-10-15",
"effective_end_date": "2025-10-20",
"generated_at": "2025-10-21T10:30:00Z",
"total_days": 6,
"returned_user_count": 3
}
}
Response Fields
| Field | Type | Description |
|---|
| users | array | Array of user activity records (users with no activity omitted) |
| users[].user_email | string | User’s email address (for regular users) |
| users[].service_account_name | string | Service account name (for service accounts) |
| users[].active_days | integer | Number of distinct days with activity in the date range |
| users[].metrics | object | Usage metrics for this user (summed over date range) |
| users[].metrics.total_modified_lines_of_code | integer | Total lines of code modified across all interactions |
| users[].metrics.total_messages | integer | Total messages across all interaction types |
| users[].metrics.total_tool_calls | integer | Total tool calls across all agent types |
| users[].metrics.completions_count | integer | Number of completion requests |
| users[].metrics.completions_accepted | integer | Number of completions accepted |
| users[].metrics.completions_lines_of_code | integer | Lines of code from completions |
| users[].metrics.completions_suggested_lines_of_code | integer | Lines of code suggested by completions (before acceptance) |
| users[].metrics.chat_messages | integer | Number of chat messages |
| users[].metrics.remote_agent_messages | integer | Number of Remote Agent messages |
| users[].metrics.remote_agent_lines_of_code | integer | Lines of code from Remote Agent |
| users[].metrics.ide_agent_messages | integer | Number of IDE Agent messages |
| users[].metrics.ide_agent_lines_of_code | integer | Lines of code from IDE Agent |
| users[].metrics.cli_agent_interactive_messages | integer | Number of CLI Agent interactive messages |
| users[].metrics.cli_agent_interactive_lines_of_code | integer | Lines of code from CLI Agent interactive mode |
| users[].metrics.cli_agent_non_interactive_messages | integer | Number of CLI Agent non-interactive messages |
| users[].metrics.cli_agent_non_interactive_lines_of_code | integer | Lines of code from CLI Agent non-interactive mode |
| pagination.next_cursor | string | Cursor for fetching next page (empty if no more results) |
| pagination.has_more | boolean | true if more results are available |
| metadata.effective_start_date | string | Actual start date used (UTC, after defaults/clamping) |
| metadata.effective_end_date | string | Actual end date used (UTC, after defaults/clamping) |
| metadata.generated_at | string | Response generation timestamp (ISO 8601) |
| metadata.total_days | integer | Total number of days in the queried date range |
| metadata.returned_user_count | integer | Number of users returned in this page |
Each user has either user_email or service_account_name, never both.
GET /analytics/v0/daily-user-activity-by-editor-language
Returns user activity metrics broken down by language and editor for a specific date. Supports pagination.
Query Parameters
| Parameter | Type | Required | Description |
|---|
| date | string | No | Date to query in YYYY-MM-DD format (UTC) |
| cursor | string | No | Pagination cursor from previous response |
| page_size | integer | No | Number of results per page |
Date Behavior
| Scenario | Behavior |
|---|
| Date not provided | Defaults to yesterday (UTC) |
| Date provided | Returns activity for that date (must be yesterday or earlier) |
| Parameter | Default | Maximum |
|---|
| page_size | 50 | 100 |
To paginate through results:
- Make initial request (optionally with
page_size)
- If
pagination.has_more is true, use pagination.next_cursor as the cursor parameter
- Repeat until
has_more is false
Constraints
| Constraint | Value |
|---|
| Maximum historical lookback | 2 years |
| Today and future dates | Not allowed (data available at ~02:00 UTC next day) |
| Timezone | All dates interpreted as UTC |
Example Request (First Page)
curl -X GET "https://api.augmentcode.com/analytics/v0/daily-user-activity-by-editor-language?date=2025-10-15&page_size=50" \
-H "Authorization: Bearer <your-api-token>"
Example Response
{
"records": [
{
"user_email": "[email protected]",
"language": "Python",
"editor": "VSCode",
"metrics": {
"total_modified_lines_of_code": 150,
"total_messages": 25,
"total_tool_calls": 40,
"completions_count": 80,
"completions_accepted": 65,
"completions_lines_of_code": 120,
"chat_messages": 10,
"remote_agent_messages": 5,
"remote_agent_lines_of_code": 15,
"ide_agent_messages": 8,
"ide_agent_lines_of_code": 12,
"cli_agent_interactive_messages": 2,
"cli_agent_interactive_lines_of_code": 3,
"cli_agent_non_interactive_messages": 0,
"cli_agent_non_interactive_lines_of_code": 0
}
},
{
"user_email": "[email protected]",
"language": "TypeScript",
"editor": "VSCode",
"metrics": {
"total_modified_lines_of_code": 80,
"total_messages": 12,
"total_tool_calls": 18,
"completions_count": 45,
"completions_accepted": 38,
"completions_lines_of_code": 60,
"chat_messages": 5,
"remote_agent_messages": 2,
"remote_agent_lines_of_code": 8,
"ide_agent_messages": 4,
"ide_agent_lines_of_code": 10,
"cli_agent_interactive_messages": 1,
"cli_agent_interactive_lines_of_code": 2,
"cli_agent_non_interactive_messages": 0,
"cli_agent_non_interactive_lines_of_code": 0
}
}
],
"pagination": {
"next_cursor": "eyJsYXN0X2lkIjoidXNlcjMifQ==",
"has_more": true
},
"metadata": {
"effective_date": "2025-10-15",
"generated_at": "2025-10-16T10:30:00Z",
"returned_record_count": 2
}
}
Example Request (Next Page)
curl -X GET "https://api.augmentcode.com/analytics/v0/daily-user-activity-by-editor-language?date=2025-10-15&page_size=50&cursor=eyJsYXN0X2lkIjoidXNlcjMifQ==" \
-H "Authorization: Bearer <your-api-token>"
Response Fields
| Field | Type | Description |
|---|
| records | array | Array of user/language/editor activity records |
| records[].user_email | string | User’s email address (for regular users) |
| records[].service_account_name | string | Service account name (for service accounts) |
| records[].language | string | Programming language (e.g., “Python”, “TypeScript”, “Unknown”) |
| records[].editor | string | Editor/IDE name (e.g., “VSCode”, “JetBrains”, “CLI”, “Unknown”) |
| records[].metrics | object | Usage metrics for this user/language/editor combination |
| records[].metrics.total_modified_lines_of_code | integer | Total lines of code modified across all interactions |
| records[].metrics.total_messages | integer | Total messages across all interaction types |
| records[].metrics.total_tool_calls | integer | Total tool calls across all agent types |
| records[].metrics.completions_count | integer | Number of completion requests |
| records[].metrics.completions_accepted | integer | Number of completions accepted |
| records[].metrics.completions_lines_of_code | integer | Lines of code from completions |
| records[].metrics.completions_suggested_lines_of_code | integer | Lines of code suggested by completions (before acceptance) |
| records[].metrics.chat_messages | integer | Number of chat messages |
| records[].metrics.remote_agent_messages | integer | Number of Remote Agent messages |
| records[].metrics.remote_agent_lines_of_code | integer | Lines of code from Remote Agent |
| records[].metrics.ide_agent_messages | integer | Number of IDE Agent messages |
| records[].metrics.ide_agent_lines_of_code | integer | Lines of code from IDE Agent |
| records[].metrics.cli_agent_interactive_messages | integer | Number of CLI Agent interactive messages |
| records[].metrics.cli_agent_interactive_lines_of_code | integer | Lines of code from CLI Agent interactive mode |
| records[].metrics.cli_agent_non_interactive_messages | integer | Number of CLI Agent non-interactive messages |
| records[].metrics.cli_agent_non_interactive_lines_of_code | integer | Lines of code from CLI Agent non-interactive mode |
| pagination.next_cursor | string | Cursor for fetching next page (empty if no more results) |
| pagination.has_more | boolean | true if more results are available |
| metadata.effective_date | string | Actual date used (UTC, after defaults) |
| metadata.generated_at | string | Response generation timestamp (ISO 8601) |
| metadata.returned_record_count | integer | Number of records returned in this page |
Each record has either user_email or service_account_name, never both. A single user may have multiple records if they used different language/editor combinations on the queried date.
Rate Limiting
The Analytics API enforces rate limits to ensure fair usage and system stability.
| Limit Type | Value |
|---|
| Requests per minute | 10 requests/minute |
| Burst allowance | 20 requests |
When you exceed the rate limit, the API returns HTTP status code 429 Too Many Requests. Your requests will be blocked for the duration specified above before you can make new requests.
Best Practices
-
Batch your requests: Instead of making many small requests, use larger date ranges (up to 90 days) to retrieve more data per request.
-
Implement exponential backoff: If you receive a
429 response, wait before retrying. Start with a short delay and increase it with each consecutive failure.
-
Cache responses: Analytics data is updated only once daily, so cache responses and avoid re-fetching the same data within a 24-hour period.
-
Use pagination efficiently: When paginating through large result sets, process each page before requesting the next one rather than fetching all pages as fast as possible.
-
Spread requests over time: If you need to make multiple API calls, distribute them evenly rather than sending them all at once.
Error Responses
The API returns standard HTTP status codes:
| Status Code | Description |
|---|
| 400 | Invalid request (e.g., invalid date format, range exceeds 90 days) |
| 401 | Missing or invalid authentication token |
| 403 | Insufficient permissions |
| 429 | Too many requests (rate limit exceeded) |
| 500 | Internal server error |
Example Error Response
{
"error": {
"code": "InvalidArgument",
"message": "end_date cannot be later than yesterday (UTC)"
}
}