X-Workspace-ID header:
Active users
Track daily, weekly, and monthly active users:| Endpoint | Metric |
|---|---|
/metrics/dau | Daily active users |
/metrics/wau | Weekly active users |
/metrics/mau | Monthly active users |
/raw variant (e.g. /metrics/dau/raw) that returns the underlying user-level data with pagination.
Events
| Endpoint | What it returns |
|---|---|
/metrics/events | Event count over time |
/metrics/events/top | Most frequent events ranked by count |
/metrics/events/top/{name}/raw | Raw data for a specific event |
/metrics/events/properties | Property breakdown (requires event and property params) |
/metrics/events/custom | Aggregation on a property — sum, avg, min, max, count |
/metrics/events/raw | Raw event data |
/metrics/events/first-time | First-time event users per period |
/metrics/events/per-actor | Per-user event aggregation (avg, p90) |
First-time events
Count users whose first occurrence of an event falls within the query range. See Events — First-time events for usage.GET /api/v1/metrics/events/first-time
Parameters:| Parameter | Type | Required | Description |
|---|---|---|---|
event | string | Yes | Event name to analyze. |
match_mode | boolean | No | Default: false. When true, filter conditions apply to the historical scan (first-match mode). |
lookback_days | integer | No | Limit historical scan to this many days. Omit for full history. |
range | string | No | Time range. Default: 30d. |
granularity | string | No | Time bucketing. Default: daily. |
breakdown | string | No | Break down by a field (e.g., country, properties.plan). |
compare | string | No | previous or yoy. |
breakdown=country, each point includes a dimension field:
Per-actor metrics
Two-level aggregation: first per user, then across users. See Events — Per-actor metrics for usage.GET /api/v1/metrics/events/per-actor
Parameters:| Parameter | Type | Required | Description |
|---|---|---|---|
event | string | Yes | Event name to analyze. |
metric | string | No | Outer aggregation function. Default: avg. Options: avg, median, p50, p75, p90, p95, p99, min, max, sum. |
property | string | No | Property to aggregate per user (e.g., properties.amount). If omitted, counts events per user. |
range | string | No | Time range. Default: 30d. |
granularity | string | No | Time bucketing. Default: daily. |
breakdown | string | No | Break down by a field (e.g., country, properties.plan). |
Sessions
Logs
service, level, source.
Users and stickiness
Lifecycle
Classify active users into lifecycle states over time. See Events — Lifecycle for usage.GET /api/v1/metrics/lifecycle
Returns a time series with each active user classified asnew, returning, or resurrected per period.
Parameters: Standard common parameters. Default granularity is weekly.
Example:
Segments
Snapshot classification of all users into lifecycle and engagement segments. See Segments for definitions.GET /api/v1/metrics/segments
Returns user counts for all 8 built-in segments. Parameters:| Parameter | Type | Required | Description |
|---|---|---|---|
range | string | No | Time range for computation. Default: 30d. |
GET /api/v1/metrics/segments/:segment
Drill into a specific segment to see individual users. Parameters:| Parameter | Type | Required | Description |
|---|---|---|---|
range | string | No | Time range. Default: 30d. |
limit | integer | No | Max users returned. Default: 50, max: 100. |
Formulas
Combine multiple metric series with a math expression. See Events — Formulas for syntax and usage.POST /api/v1/metrics/formula
Evaluate a formula across multiple metric series. Request body:| Field | Type | Required | Description |
|---|---|---|---|
series | array | Yes | Metric series to evaluate. Each has metric (string), optional filters (array), optional breakdown (string), optional range (string override). |
formula | string | Yes | Math expression using series references A–Z. |
range | string | No | Time range. Default: 30d. |
granularity | string | No | Time bucketing. Default: daily. |
dau, wau, mau, events, event:<name>, sessions, users, logs.
Example:
Grouped metrics
Proportional composition with two metrics per group. See Events — Grouped metrics for usage.POST /api/v1/metrics/grouped
Compute grouped metrics for treemap visualization. Request body:| Field | Type | Required | Description |
|---|---|---|---|
group_by | string | Yes | Field to group by (e.g., country, event_name, properties.plan). |
size | object | Yes | Size metric: { "type": "count" }, { "type": "unique_actors" }, or { "type": "sum", "property": "properties.revenue" }. |
intensity | object | Yes | Intensity metric: { "type": "avg_per_actor" }, { "type": "percentile_per_actor", "percentile": 0.9 }, { "type": "unique_actors" }, or { "type": "avg", "property": "properties.load_time" }. |
event | string | No | Filter to a specific event. |
range | string | No | Time range. Default: 30d. |
max_groups | integer | No | Max groups returned. Default: 20. |
Funnels
Analyze step-by-step conversion. See the Funnels product guide for concepts and examples.POST /api/v1/funnels
Run a funnel analysis across a sequence of events. Request body:| Field | Type | Required | Description |
|---|---|---|---|
steps | array | Yes | 2–10 funnel steps. Each step has event (string) and optional filters (array of conditions). |
window_seconds | integer | No | Max seconds for a user to complete all steps. Default: 604800 (7 days). |
breakdown | string | No | Split results by a dimension (e.g., country, device_type). |
range | string | No | Time range. Default: 30d. |
| Field | Type | Required | Description |
|---|---|---|---|
field | string | Yes | Property to filter on (e.g., properties.plan). |
operator | string | No | Comparison operator. Default: eq. |
value | any | No | Value to compare against. String, number, or array (for in/not_in). |
POST /api/v1/funnels/trend
Track funnel conversion rate over time. Same request body asPOST /api/v1/funnels, plus a granularity field.
| Field | Type | Required | Description |
|---|---|---|---|
granularity | string | No | Time bucket size: minute, hourly, daily, weekly, monthly. Default: daily. |
Retention
Cohort retention analysis. See the Retention product guide for how to read the cohort matrix.POST /api/v1/retention
Run a cohort retention analysis. Request body:| Field | Type | Required | Description |
|---|---|---|---|
granularity | string | No | Cohort bucketing: daily, weekly, monthly. Default: weekly. |
periods | integer | No | Number of periods to track (1–52). Default: 8. |
start_event | string | No | Cohort entry event. Default: any event. |
return_event | string | No | Return activity event. Default: any event. |
range | string | No | Time range. Default: 90d. |
Audiences
Manage saved user groups. See the Audiences product guide for definition syntax and usage.GET /api/v1/audiences
List all audiences in the workspace. Requires Viewer role or above.POST /api/v1/audiences
Create an audience. Requires Editor role or above. Request body:| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Audience name (1–200 characters). |
description | string | No | Description (max 2000 characters). |
definition | object | Yes | Audience rules. Contains filters (array), events (array), and optional lookback_days (integer). |
GET /api/v1/audiences/:id
Get a single audience by ID.PUT /api/v1/audiences/:id
Update an audience. Only the owner or a workspace admin can update. All fields are optional — omit a field to keep its current value. Request body:| Field | Type | Required | Description |
|---|---|---|---|
name | string | No | New name. |
description | string | No | New description. |
definition | object | No | Updated audience rules. |
DELETE /api/v1/audiences/:id
Delete an audience. Only the owner or a workspace admin can delete.GET /api/v1/audiences/:id/count
Get the number of users matching an audience’s rules. Response:Marks
Timeline annotations that overlay on charts. See Boards — Marks for product usage.GET /api/v1/marks
List marks in the workspace. Public marks are visible to all members. Private marks are only visible to their creator. Query parameters:| Parameter | Type | Required | Description |
|---|---|---|---|
from | string | No | Start time (ISO 8601). |
to | string | No | End time (ISO 8601). |
category | string | No | Filter by category: release, news, incident. |
source | string | No | Filter by source: manual, api, plugin. |
limit | integer | No | Max results. Default: 500. |
GET /api/v1/marks/:id
Get a single mark by ID. Returns 404 for private marks belonging to other users.POST /api/v1/marks
Create a mark. Requires Editor role or above. Request body:| Field | Type | Required | Description |
|---|---|---|---|
title | string | Yes | Mark title (1–200 characters). |
description | string | No | Description (max 2000 characters). |
timestamp | string | No | When the event happened (ISO 8601). Default: now. |
category | string | No | release, news, or incident. Default: release. |
source_ref | string | No | URL, commit SHA, or other reference. |
scope | string | No | public or private. Default: public. |
metadata | string | No | JSON blob (max 10KB). |
DELETE /api/v1/marks/:id
Delete a mark. Only the creator or a workspace admin can delete.Common parameters
Most metric endpoints share these query parameters:| Parameter | Default | Options |
|---|---|---|
range | 30d | 7d, 30d, 90d, or custom: 2025-01-01,2025-01-31 |
granularity | daily | minute, hourly, daily, weekly, monthly |
breakdown | — | Any dimension: country, platform, device_type, os, etc. |
compare | — | previous (previous period) or yoy (year-over-year) |
conditions[N][field] | — | Filter conditions (see Filtering) |
| Parameter | Default | Description |
|---|---|---|
limit | 100 | Max rows returned |
offset | 0 | Skip rows for pagination |
count_total | false | Include total count (slower) |
SQL queries
For full flexibility, execute SQL directly against your analytics data. Rate-limited to 30 requests per minute.SELECT statements are allowed. Queries are automatically scoped to your workspace database. Max 10,000 rows per query (default 1,000).
Data exploration
Discover what data is available before writing queries:Available sources
| Source | Table | Description |
|---|---|---|
events | events_v1 | Custom events and page views |
logs | logs_v1 | Structured logs |
context | context_v1 | Device and session context |
user_traits | user_traits_v1 | User properties set via identify |
users | users_v1 | Unique users |
user_devices | user_devices | Device-to-user mappings |
What’s next
- Boards & Metrics — save and visualize query results
- Sharing — share metrics and boards publicly
- SQL Analytics — SQL query patterns and tips