# Query AI agent records

URL: https://docs.dixa.io/openapi/dixa-api/beta/intelligence/postintelligenceaiagentsrecordsrecordid

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.

## POST /beta/intelligence/aiagents/records/{recordId}

- Server: https://dev.dixa.io
- Auth: `Authorization: <API token>` header

### Request example

aiAgentFeedback · Interval · One AI agent:

```bash
curl -X POST 'https://dev.dixa.io/beta/intelligence/aiagents/records/aiAgentFeedback' \
  -H 'Authorization: <API token>' \
  -H 'Content-Type: application/json' \
  -d '{
  "primaryFilter": {
    "period": {
      "interval": {
        "from": "2026-06-01T00:00:00Z",
        "to": "2026-07-01T00:00:00Z"
      }
    }
  },
  "filters": [
    {
      "attribute": "aiAgent",
      "values": [
        "0b7e4c2d-5a91-4f38-b6e2-9d1c3a8f5e47"
      ],
      "operator": "IsOne"
    }
  ],
  "timezone": "Europe/Copenhagen",
  "pagination": {
    "pageLimit": 50
  },
  "includeLabels": true
}'
```

aiAgentJoined · Preset · All AI agents, no labels:

```bash
curl -X POST 'https://dev.dixa.io/beta/intelligence/aiagents/records/aiAgentJoined' \
  -H 'Authorization: <API token>' \
  -H 'Content-Type: application/json' \
  -d '{
  "primaryFilter": {
    "period": {
      "preset": "PreviousWeek"
    }
  },
  "timezone": "Europe/Copenhagen",
  "includeLabels": false
}'
```

aiAgentToolCalls · Interval · One AI agent, chat only:

```bash
curl -X POST 'https://dev.dixa.io/beta/intelligence/aiagents/records/aiAgentToolCalls' \
  -H 'Authorization: <API token>' \
  -H 'Content-Type: application/json' \
  -d '{
  "primaryFilter": {
    "period": {
      "interval": {
        "from": "2026-06-01T00:00:00Z",
        "to": "2026-07-01T00:00:00Z"
      }
    }
  },
  "filters": [
    {
      "attribute": "aiAgent",
      "values": [
        "0b7e4c2d-5a91-4f38-b6e2-9d1c3a8f5e47"
      ],
      "operator": "IsOne"
    },
    {
      "attribute": "channel",
      "values": [
        "Messenger"
      ],
      "operator": "IsOne"
    }
  ],
  "timezone": "Europe/Copenhagen"
}'
```

### Response examples

#### 200 One page of rows, and the keys of the previous and next pages

aiAgentFeedback · Interval · One AI agent:

```json
{
  "data": [
    {
      "channel": {
        "id": "Messenger",
        "label": "Messenger"
      },
      "aiAgent": {
        "id": "0b7e4c2d-5a91-4f38-b6e2-9d1c3a8f5e47",
        "label": "Support assistant"
      },
      "submittedAt": "2026-06-20T10:42:13.208+00:00",
      "tags": [
        {
          "id": "b3c81f6d-7a95-4e28-8c40-1f6b9d3a5e72",
          "label": "refund"
        }
      ],
      "score": 1,
      "responseId": "f3c9a1e7-62b4-4d8f-a5c0-8e2b7d41f693",
      "feedbackType": {
        "id": "Thumbs",
        "label": "Thumbs"
      },
      "queue": {
        "id": "2f9b6d51-38c4-4a72-9e15-7c8b3f6a2d90",
        "label": "Support"
      },
      "conversationId": 8123517,
      "initialDirection": {
        "id": "Inbound",
        "label": "Inbound"
      }
    },
    {
      "channel": {
        "id": "Messenger",
        "label": "Messenger"
      },
      "aiAgent": {
        "id": "0b7e4c2d-5a91-4f38-b6e2-9d1c3a8f5e47",
        "label": "Support assistant"
      },
      "submittedAt": "2026-06-20T11:05:47.9+00:00",
      "feedbackType": {
        "id": "Thumbs",
        "label": "Thumbs"
      },
      "score": 0,
      "responseId": "6a1d8e3b-07f2-4c95-b4e8-2d9f5a7c1e30",
      "conversationId": 8123529,
      "initialDirection": {
        "id": "Inbound",
        "label": "Inbound"
      }
    }
  ],
  "meta": {
    "pageLimit": 50
  }
}
```

aiAgentJoined · Preset · All AI agents, no labels:

```json
{
  "data": [
    {
      "channel": {
        "id": "Messenger"
      },
      "aiAgent": {
        "id": "0b7e4c2d-5a91-4f38-b6e2-9d1c3a8f5e47"
      },
      "queue": {
        "id": "2f9b6d51-38c4-4a72-9e15-7c8b3f6a2d90"
      },
      "joinedAt": "2026-06-20T10:41:02.5+00:00",
      "variant": {
        "id": "Support"
      },
      "chatbotType": {
        "id": "Mim"
      },
      "systemUser": {
        "id": "5f2a9d61-c3e8-4b07-91d4-7e6b2a0c8f15"
      },
      "conversationId": 8123517,
      "initialDirection": {
        "id": "Inbound"
      }
    }
  ],
  "meta": {
    "pageLimit": 50
  }
}
```

aiAgentToolCalls · Interval · One AI agent, chat only:

```json
{
  "data": [
    {
      "channel": {
        "id": "Messenger",
        "label": "Messenger"
      },
      "tags": [
        {
          "id": "b3c81f6d-7a95-4e28-8c40-1f6b9d3a5e72",
          "label": "refund"
        }
      ],
      "aiAgent": {
        "id": "0b7e4c2d-5a91-4f38-b6e2-9d1c3a8f5e47",
        "label": "Support assistant"
      },
      "calledAt": "2026-06-20T10:41:39.114+00:00",
      "queue": {
        "id": "2f9b6d51-38c4-4a72-9e15-7c8b3f6a2d90",
        "label": "Support"
      },
      "tool": {
        "id": "8d3f1b72-6e04-4a9c-b5d1-2c7e9f0a4b68",
        "label": "Look up order"
      },
      "conversationId": 8123517,
      "initialDirection": {
        "id": "Inbound",
        "label": "Inbound"
      }
    }
  ],
  "meta": {
    "pageLimit": 50
  }
}
```

#### 400

```json
{
  "message": "Decoding failure in request"
}
```

#### 404 An entity in this request could not be found

```json
{
  "message": "The requested resource could not be found"
}
```

#### 500 Internal failure during request processing

```json
{
  "message": "There was an internal server error while processing the request"
}
```

## OpenAPI definition

The operation and the schemas used, from the full spec at https://docs.dixa.io/openapi-specs/dixa-beta.yaml. Request and response examples are above.

```yaml
openapi: 3.0.3
info:
  title: Dixa API
  version: beta
servers:
  - url: https://dev.dixa.io
security:
  - ApiKeyAuth: []
paths:
  /beta/intelligence/aiagents/records/{recordId}:
    post:
      tags:
        - Intelligence
      summary: Query AI agent records
      description: 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.
      operationId: postIntelligenceAiagentsRecordsRecordid
      parameters:
        - name: recordId
          in: path
          description: The id of an AI agent record
          required: true
          schema:
            type: string
          examples:
            aiAgentFeedback · Interval · One AI agent:
              value: aiAgentFeedback
            aiAgentJoined · Preset · All AI agents, no labels:
              value: aiAgentJoined
            aiAgentToolCalls · Interval · One AI agent, chat only:
              value: aiAgentToolCalls
      requestBody:
        description: The query
        content:
          application/json:
            schema:
              oneOf:
                - $ref: "#/components/schemas/AiAgentRecordDataRequest"
        required: true
      responses:
        "200":
          description: One page of rows, and the keys of the previous and next pages
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/IntelligenceRecordPage"
        "400":
          description: ""
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadRequest"
        "404":
          description: An entity in this request could not be found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NotFound"
        "500":
          description: Internal failure during request processing
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ServerError"
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      name: Authorization
      in: header
  schemas:
    AiAgentRecordDataRequest:
      title: AiAgentRecordDataRequest
      description: An AI agent record query
      type: object
      required:
        - primaryFilter
        - timezone
      properties:
        primaryFilter:
          $ref: "#/components/schemas/AiAgentPrimaryFilter"
        filters:
          description: The filters to apply. All filters must match
          type: array
          items:
            $ref: "#/components/schemas/SecondaryFilter"
        timezone:
          description: The timezone presets and days are evaluated in, such as
            `Europe/Copenhagen`
          type: string
        pagination:
          $ref: "#/components/schemas/PageRequest"
        includeLabels:
          description: Whether references include a `label`. Defaults to true
          type: boolean
    AiAgentPrimaryFilter:
      title: AiAgentPrimaryFilter
      description: The period to query
      type: object
      required:
        - period
      properties:
        period:
          $ref: "#/components/schemas/Period"
    Period:
      title: Period
      description: '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"}}`'
      oneOf:
        - $ref: "#/components/schemas/IntervalPeriod"
        - $ref: "#/components/schemas/PresetPeriod"
    IntervalPeriod:
      title: IntervalPeriod
      description: A period between two points in time
      type: object
      required:
        - interval
      properties:
        interval:
          $ref: "#/components/schemas/IntelligenceInterval"
    IntelligenceInterval:
      title: IntelligenceInterval
      description: 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`
      type: object
      required:
        - from
        - to
      properties:
        from:
          description: The start of the range, inclusive. Must be before `to`
          type: string
          format: date-time
        to:
          description: The end of the range, inclusive
          type: string
          format: date-time
    PresetPeriod:
      title: PresetPeriod
      description: A preset period, evaluated in the timezone of the query
      type: object
      required:
        - preset
      properties:
        preset:
          description: >-
            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`
          type: string
    SecondaryFilter:
      title: SecondaryFilter
      description: A filter on an attribute
      type: object
      required:
        - attribute
      properties:
        attribute:
          description: The attribute to filter on, from the `filters` of the metric or
            record. Any other attribute is rejected
          type: string
        values:
          description: The values to filter on, as returned by List filter values. Send an
            empty list for `IsEmpty` and `IsNotEmpty`
          type: array
          items:
            type: string
        operator:
          description: The operator. Defaults to the `defaultOperator` of the attribute.
            An operator the attribute does not support is rejected
          type: string
          enum:
            - IsEmpty
            - IsNotEmpty
            - IsOne
            - IsNotOne
            - IsAll
            - GreaterThan
            - GreaterThanOrEqual
            - LessThan
            - LessThanOrEqual
    PageRequest:
      title: PageRequest
      description: The page to fetch. If not provided, the first page is returned
      type: object
      properties:
        pageKey:
          description: The key of the page to fetch, taken from `meta.next` or
            `meta.previous` in a previous response
          type: string
        pageLimit:
          description: The number of rows per page, up to 200
          default: 50
          type: integer
          format: int32
          minimum: 1
          maximum: 200
    IntelligenceRecordPage:
      title: IntelligenceRecordPage
      type: object
      required:
        - meta
      properties:
        data:
          description: The rows of the page. The columns a row can contain are listed
            under `fields` in the record's catalogue entry
          type: array
          items:
            description: A row, keyed by the `name` of each of the record's `fields`.
              Columns without a value are left out, so rows can have different
              keys
            type: object
            additionalProperties: {}
        meta:
          $ref: "#/components/schemas/PageResponse"
    PageResponse:
      title: PageResponse
      description: The keys of the previous and next pages, and the page size
      type: object
      required:
        - pageLimit
      properties:
        previous:
          description: The key of the previous page. Not set on the first page
          type: string
        next:
          description: The key of the next page. Not set on the last page
          type: string
        pageLimit:
          description: The page size used
          type: integer
          format: int32
    BadRequest:
      title: BadRequest
      type: object
      required:
        - message
      properties:
        message:
          type: string
    NotFound:
      title: NotFound
      type: object
      required:
        - message
      properties:
        message:
          type: string
    ServerError:
      title: ServerError
      type: object
      required:
        - message
      properties:
        message:
          type: string
```
