# Query AI agent records

Get the rows of an AI agent record for a period. To get the next page, send the same query with `meta.next` as `pagination.pageKey`. Without filters, all AI agents are included, also deleted ones.

Endpoint: POST /beta/intelligence/aiagents/records/{recordId}
Version: beta
Security: ApiKeyAuth

## Path parameters:

  - `recordId` (string, required)
    The id of an AI agent record

## Request fields (application/json):

  - `primaryFilter` (object, required)
    The period to query

  - `primaryFilter.period` (any, 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"}}`

  - `primaryFilter.period.interval` (object, 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`

  - `primaryFilter.period.interval.from` (string, required)
    The start of the range, inclusive. Must be before `to`

  - `primaryFilter.period.interval.to` (string, required)
    The end of the range, inclusive

  - `primaryFilter.period.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` (array)
    The filters to apply. All filters must match

  - `filters.attribute` (string, required)
    The attribute to filter on, from the `filters` of the metric or record. Any other attribute is rejected

  - `filters.values` (array)
    The values to filter on, as returned by List filter values. Send an empty list for `IsEmpty` and `IsNotEmpty`

  - `filters.operator` (string)
    The operator. Defaults to the `defaultOperator` of the attribute. An operator the attribute does not support is rejected
    Enum: "IsEmpty", "IsNotEmpty", "IsOne", "IsNotOne", "IsAll", "GreaterThan", "GreaterThanOrEqual", "LessThan", "LessThanOrEqual"

  - `timezone` (string, required)
    The timezone presets and days are evaluated in, such as `Europe/Copenhagen`

  - `pagination` (object)
    The page to fetch. If not provided, the first page is returned

  - `pagination.pageKey` (string)
    The key of the page to fetch, taken from `meta.next` or `meta.previous` in a previous response

  - `pagination.pageLimit` (integer)
    The number of rows per page, up to 1000

  - `includeLabels` (boolean)
    Whether references include a `label`. Defaults to true

## Response 200 fields (application/json):

  - `data` (array)
    The rows of the page. The columns a row can contain are listed under `fields` in the record's catalogue entry

  - `meta` (object, required)
    The keys of the previous and next pages, and the page size

  - `meta.previous` (string)
    The key of the previous page. Not set on the first page

  - `meta.next` (string)
    The key of the next page. Not set on the last page

  - `meta.pageLimit` (integer, required)
    The page size used

## Response 400 fields (application/json):

  - `message` (string, required)

## Response 404 fields (application/json):

  - `message` (string, required)

## Response 500 fields (application/json):

  - `message` (string, required)

