Skip to main content
The query stats endpoint does not change any data.POST is used because the query is a nested JSON body. A successful call only reads stats and returns them.
Query insights for the company that owns your API key.
The API reference lists every metric, filter, and breakdown. This page shows how a query is put together.

Request

A metric can also carry its own filters. Those apply to that metric only, together with the shared filters. timeframe, breakdown, and segment are single objects. Send one timeframe, and at most one breakdown and one segment.

Timeframe

Preset values are TODAY, PAST_7_DAYS, PAST_30_DAYS, PAST_90_DAYS, and PAST_365_DAYS. Preset ranges include the current day. A custom range sets from and to to a YYYY-MM-DD date, or to an object with date and hours:

Filters

The operators depend on the kind of value the filter takes. Select. Pick from a list. value is an array, including when you send one value. is matches any listed value. is-not matches none of them. String. value is text. is is an exact match, and is-not is any other text. contains matches when the text includes the value, and not-contains matches when it does not. Multiselect. A ticket can have several values. value is an array.
  • include-any matches when at least one listed value is present.
  • include-all matches when every listed value is present.
  • exclude-any matches when none of the listed values are present.
  • exclude-all matches when at least one listed value is missing.
Boolean. Use is with true or false. Some filters also accept is-set and is-not-set with "value": null. Those match when a value is present, or when it is missing.

Examples

A timeframe plus shared filters:
Two metrics, a metric-specific filter, and a breakdown:
A matching response echoes the query and returns one number per metric. breakdown on each row is the display name, and timeframe on each row is the resolved range: