---
title: "Query agent metric"
method: POST
path: "/beta/intelligence/agents/metrics/{metricId}"
tags: ["Intelligence"]
---

# Query agent metric

`POST /beta/intelligence/agents/metrics/{metricId}`

## Request

- Base URL: `https://dev.dixa.io`
- URL: `https://dev.dixa.io/beta/intelligence/agents/metrics/{metricId}`
- Auth: API key in header `Authorization`
- TypeScript: <https://skmtc.dev/dixa/apis/dixa-api/docs/beta/intelligence/agents/metrics/:metricId/post.ts> (a function with typed inputs; its response is checked against the schema)

Get the value of an agent metric for a period. All aggregates of the metric are returned. If nothing matches, `count` is 0 and the other aggregates are null, except presence durations, which are 0. Deactivated agents are included.

## Path parameters

- `metricId` string, required

## Request body

- AgentMetricDataRequest: An agent metric query
  - `primaryFilter` AgentPrimaryFilter, required: The period to query
    - `period` union, required: A period, given as either a preset, `{"preset": "Last7Days"}`, or an interval, `{"interval": {"from": "2026-06-01T00:00:00Z", "to": "2026-06-30T23:59:59.999Z"}}`
      - IntervalPeriod: A period between two points in time
        - `interval` IntelligenceInterval, required: A time range. Both ends are ISO 8601 timestamps that must end in `Z` or a UTC offset, such as `2026-06-01T00:00:00Z` or `2026-06-01T00:00:00+02:00`
          - `from` string, date-time, required: The start of the range, inclusive. Must be before `to`
          - `to` string, date-time, required: The end of the range, inclusive
      - PresetPeriod: A preset period, evaluated in the timezone of the query
        - `preset` string, required: The preset. The available presets are: - `Today` and `Yesterday` - `Last{Unit}` or `Previous{Unit}`: the previous full unit, e.g. `PreviousWeek` - `Last{N}{Unit}s`: for N of 2 or more, the last N units, including the current one, e.g. `Last7Days`. With N of 1 it is the same as `Previous{Unit}` - `This{Unit}`: the current unit so far, for `Week`, `Month`, `Quarter` or `Year`, e.g. `ThisMonth` The units are `Hour`, `Day`, `Week`, `Month`, `Quarter` and `Year`
  - `filters` SecondaryFilter[]: The filters to apply. All filters must match
    - `attribute` string, required: The attribute to filter on, from the `filters` of the metric or record. Any other attribute is rejected
    - `values` string[]: The values to filter on, as returned by List filter values. Send an empty list for `IsEmpty` and `IsNotEmpty`
    - `operator` 'IsEmpty' | 'IsNotEmpty' | 'IsOne' | 'IsNotOne' | 'IsAll' | 'GreaterThan' | 'GreaterThanOrEqual' | 'LessThan' | 'LessThanOrEqual': The operator. Defaults to the `defaultOperator` of the attribute. An operator the attribute does not support is rejected
  - `timezone` string, required: The timezone presets and days are evaluated in, such as `Europe/Copenhagen`

## Response `200`

The metric values, keyed by aggregate name

- IntelligenceMetricValues
  - `data` object, required: The metric values, keyed by the `name` of each of the metric's `aggregates`. All aggregates are included. If nothing matches, `count` is 0, `min`, `max`, `sum`, `average`, `stdDev` and `percentage` are null, and an object value is filled with zeros

## Other responses

- `400`
- `404`: An entity in this request could not be found
- `500`: Internal failure during request processing

## Changes

- **2026-10-19** `4c9e4ef864d1`: 1 breaking, 3 warning, 1 info
  - the request's body type changed from `object` to no type
  - removed the request property `filters`
  - removed the request property `primaryFilter`
  - removed the request property `timezone`
  - …1 more
- **2026-10-19** `b492695788bb`: 4 breaking
  - removed the enum value `Between` of the request property `filters/items/operator`
  - removed the enum value `Equals` of the request property `filters/items/operator`
  - removed the enum value `IsNotAll` of the request property `filters/items/operator`
  - removed the enum value `NotEquals` of the request property `filters/items/operator`
- **2026-10-14** `9e01458f1a5f`: 13 breaking, 13 info
  - removed the enum value `between` of the request property `filters/items/operator`
  - removed the enum value `equals` of the request property `filters/items/operator`
  - removed the enum value `gt` of the request property `filters/items/operator`
  - removed the enum value `gte` of the request property `filters/items/operator`
  - …22 more
- **2026-09-23** `eab8fd8df708`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/dixa/apis/dixa-api/changes/beta/intelligence/agents/metrics/:metricId/post.md)

---

[API](https://skmtc.dev/dixa/apis/dixa-api.md) - [All operations](https://skmtc.dev/dixa/apis/dixa-api/llms.txt) - [OpenAPI document](https://skmtc.dev/dixa/apis/dixa-api/revisions/4c9e4ef864d1?raw)
