X-Workspace-ID header:
Active users
Track daily, weekly, and monthly active users:
Each endpoint also has a
/raw variant (e.g. /metrics/dau/raw) that returns the underlying user-level data with pagination.
Events
Top lists (
/metrics/events/top, /metrics/logs/top, /metrics/sessions/top, and the top_events / top_logs:<field> metric keys) rank labels, so each entry is a label and its count, with no date:
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:
Example:
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:
Example — average events per user:
Sessions
Logs
service, level, source. source is the host or instance that sent the log: the client’s configured source, usually the host name. The Rust SDK still lets a per-log component replace it, for compatibility only; put a module or tracing target in a log property instead, so source stays one value per host.
Filter on a field inside a JSON log body with message.<path>:
"EventId": "4624" matches 4624, "EventId": 4624 does not.
Infrastructure metrics
Query a metric the SDKs or agents send with the keymetric:<name>:<fn>:
<fn> aggregates the point value: avg (default), sum, min, max, rate, last, count, median, p50, p75, p90, p95, p99.
A histogram point has no useful value; its data is the observation count, sum, and buckets. Use the histogram functions for it:
Cumulative histograms (the SDK default) count what was observed between consecutive points of each series (one source, service, and label set). A drop in the count is a restart: that point counts whole. The first point of each series in the range is its starting reading and adds nothing. Delta histograms count every point. A bucket with no observations has no point. Break down by
labels.<key>, service, or 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:
Example:
GET /api/v1/metrics/segments/:segment
Drill into a specific segment to see individual users. Parameters:
Example:
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:
Series metric values:
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:
Example:
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:
Step filter fields:
Example:
POST /api/v1/funnels/trend
Track funnel conversion rate over time. Same request body asPOST /api/v1/funnels, plus a granularity field.
Example:
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:
Example:
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.limit and offset to page.
POST /api/v1/audiences
Create an audience. Requires Editor role or above. Request body:
Example:
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: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:
Example:
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: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:
Raw endpoints add pagination:
A raw endpoint returns one page of rows:
has_more says whether another page follows; request it with offset set to offset + limit. total is present only with count_total=true.
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
What’s next
- Boards & Metrics — save and visualize query results
- Sharing — share metrics and boards publicly
- SQL Analytics — SQL query patterns and tips