---
title: "Get agent invocation exchange"
method: GET
path: "/agent-history/agent-invocation-exchanges/{exchangeId}"
tags: ["Agent Invocation Exchanges"]
---

# Get agent invocation exchange

`GET /agent-history/agent-invocation-exchanges/{exchangeId}`

## Request

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

## Path parameters

- `exchangeId` string, required

## Response `200`

Indicates the request was successful.

- AgentInvocationExchangeResponse: Response for an agent invocation exchange
  - `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

## Other responses

- `400`: Indicates the request had some invalid arguments.
- `403`: Indicates that the user does not have access to get an agent invocation exchange
- `404`: Indicates that agent invocation exchange does not exist or the user does not have access to it.

---

[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)
