v9

OpenAPI 3.1.02026-08-043703845.2 MB
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 nullable

Time granularity (daily, weekly, monthly).

breakdownsstring[] nullable

Columns to break down the metric by.

filtersobject nullable

Key-value pairs to filter the data.

time_zonestring nullable

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

fromstring date-time nullable

Start of time range (unix timestamp).

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

End of time range (unix timestamp).

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

Scope query to a specific company.

Example:biz_xxxxxxxxxxxxxx
user_idstring nullable

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