Skip to main content
POST
JavaScript

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

An aggregate query: one or more measures over a time window, optionally filtered, broken down and compared. GET /v1/analytics/schema lists the metrics, filters and breakdowns available.

measures
object[]
required

What to aggregate: 1 to 10 measures.

Required array length: 1 - 10 elements
filters
object[]

Applied to every measure, on top of each measure's own filters.

Maximum array length: 20
interval
enum<string>

Bucket size. Defaults from the window's length and steps coarser when the window would exceed 500 buckets.

Available options:
HOUR,
DAY,
WEEK,
MONTH
comparisonMode
enum<string>

PREVIOUS_PERIOD adds the preceding window of the same length to every series.

Available options:
NONE,
PREVIOUS_PERIOD
comparisonGroups
object[]

Run every measure once per named filter set, e.g. one group per agent.

Required array length: 2 - 5 elements
timeRange
object

Defaults to the last 30 days.

timezone
string

IANA zone that buckets and calendar periods align to, e.g. America/New_York. Defaults to UTC.

Minimum string length: 1
includeBuckets
boolean

Set false to return only the window totals.

Response

The query result

data
object
required

One series per measure (or per breakdown value / comparison group). value is the aggregate over the whole window; buckets hold the per-interval values.