---
title: "Query agent invocation exchanges"
method: GET
path: "/agent-history/agent-invocation-exchanges"
tags: ["Agent Invocation Exchanges"]
---

# Query agent invocation exchanges

`GET /agent-history/agent-invocation-exchanges`

## Request

- Base URL: `http://localhost:8090/agent-api`
- URL: `http://localhost:8090/agent-api/agent-history/agent-invocation-exchanges`
- Auth: HTTP basic
- TypeScript: <https://skmtc.dev/flowable/apis/flowable-agent-engine-rest-api/docs/agent-history/agent-invocation-exchanges/get.ts> (a function with typed inputs; its response is checked against the schema)

## Query parameters

- `agentDefinitionId` string
- `agentDefinitionKey` string
- `agentInstanceId` string
- `agentInvocationId` string
- `operationKey` string
- `order` string
- `size` integer
- `sort` string
- `start` integer
- `subType` string
- `subTypeLike` string
- `tenantId` string
- `type` string
- `userId` string

## Response `200`

Indicates the request was successful.

- DataResponseAgentInvocationExchangeResponse
  - `data` AgentInvocationExchangeResponse[]
    - `id` string, required: The unique identifier for the agent invocation exchange.
    - `agentInstanceId` string, required: The identifier for the correlating agent instance.
    - `invocationId` string, required: The identifier for the correlating agent invocation.
    - `agentDefinitionId` string: The identifier for the agent definition.
    - `agentDefinitionKey` string: The key of the agent definition.
    - `creationTime` integer, required: The time when the exchange was created
    - `endTime` integer: The time when the exchange ended
    - `duration` Duration
      - `seconds` integer
      - `zero` boolean
      - `nano` integer
      - `negative` boolean
      - `positive` boolean
      - `units` TemporalUnit[]
        - `durationEstimated` boolean
        - `duration` Duration (recursive)
        - `timeBased` boolean
        - `dateBased` boolean
    - `type` string: The type of the exchange
    - `subType` string: The sub type of the exchange
    - `userId` string: The id of the user that triggered the exchange
    - `promptTokenCount` integer: The amount of tokens used for the prompt
    - `outputTokenCount` integer: The amount of tokens used for the output
    - `cachedTokenCount` integer: The amount of cached tokens used for the prompt
  - `total` integer
  - `start` integer
  - `sort` string
  - `order` string
  - `size` integer

## Other responses

- `400`: Indicates the request had some invalid arguments.
- `403`: Indicates that the user does not have access to query agent invocation exchanges

---

[API](https://skmtc.dev/flowable/apis/flowable-agent-engine-rest-api.md) - [All operations](https://skmtc.dev/flowable/apis/flowable-agent-engine-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/flowable/apis/flowable-agent-engine-rest-api/revisions/54fc1189496f?raw)
