Skip to main content
threadTimeSeriesMetric returns a metric as one value per time bucket, such as threads created per day or median first response time per week. Use it for line and bar charts.
For TypeScript, the GraphQL SDK gives you a fully typed client for these operations.
This query requires the metrics:read permission, or metricsAgent:read for agent_ metrics. See Permissions.

Get a time series

input takes these fields:
  • metricName: any time series metric from the metrics reference
  • from and to: the date range, in UTC. See Dates and time zones
  • interval: the bucket size, with unit set to HOUR, DAY, WEEK, MONTH, QUARTER, or YEAR
  • mode: METRIC for values, or THREAD_IDS for the threads behind them
  • percentile: for duration metrics, an integer from 1 to 99. Defaults to 50
  • filters and groupBy: see Filter and group reporting queries
This query returns the daily 90th percentile first response time for email and Slack threads in September, split into the 5 slowest tiers plus __OTHER__:
Query
Variables

Read the response

timestamps lists the start of every bucket in the range, in order. Each entry in series has a values list that lines up with timestamps index by index, and a group that says which group the series belongs to. Without groupBy, series has one entry and its group is null. A null in values means there was no data in that bucket. Buckets are never dropped, so the list always covers the whole range. Threads in Todo, Snoozed, and Done (threads_status_count__*) carry the last known count forward instead.

Get the threads behind a bucket

Set mode to THREAD_IDS to get the distinct IDs of the threads behind the value. The IDs cover the whole range, so narrow from and to to one bucket to get its threads. To get one group’s threads, add the group as a filter instead of using groupBy, which isn’t allowed in this mode. This query returns the Enterprise tier threads that moved to Done on September 14:
Query
Variables
timestamps and series are null in this mode.