latestOpenAPI 3.1.02026-08-213914255.9 MB

715c4defcbbf

Stats

Metric stats

Query an aggregated metric. Returns data grouped by period with optional breakdowns.

Required permissions:

  • stats:read
get/stats/metric

Query parameters

resourcestring required

Metric resource using : as separator (e.g., 'receipts:gross_revenue', 'members:new_users').

granularitystring

Time granularity (daily, weekly, monthly).

breakdownsstring[]

Columns to break down the metric by.

filtersobject

Key-value pairs to filter the data.

time_zonestring

IANA timezone for period bucketing (e.g. 'America/New_York'). Defaults to UTC. Only applies to ClickHouse metrics.

fromstring date-time

Start of time range (unix timestamp).

Example:2023-12-01T05:00:00.401Z
tostring date-time

End of time range (unix timestamp).

Example:2023-12-01T05:00:00.401Z
company_idstring

Scope query to a specific company.

Example:biz_xxxxxxxxxxxxxx
user_idstring

Scope query to a specific user.

Example:user_xxxxxxxxxxxxx

Response

A successful response

columnsstring[] nullable required

Column names in the order they appear in each data row.

dataobject[] nullable required

Array of data rows, where each row is an array of values matching the columns order.

nodestring nullable required

The node path that was queried.

typename'Result' required

The typename of this object