---
title: "Get agent invocation"
method: GET
path: "/agent-history/agent-invocations/{invocationId}"
tags: ["Agent Invocations"]
---

# Get agent invocation

`GET /agent-history/agent-invocations/{invocationId}`

## Request

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

## Path parameters

- `invocationId` string, required

## Response `200`

Indicates the request was successful.

- AgentInvocationResponse: Response for an agent invocation
  - `id` string, required: The unique identifier for the agent invocation.
  - `agentInstanceId` string, required: The identifier for the correlating agent instance.
  - `agentDefinitionId` string: The identifier for the agent definition.
  - `agentDefinitionKey` string: The key of the agent definition.
  - `operationKey` string, required: The key of the operation that the invocation belongs to
  - `startTime` integer, required: The time when the invocation was started
  - `endTime` integer: The time when the invocation was ended
  - `duration` Duration
    - `seconds` integer
    - `zero` boolean
    - `nano` integer
    - `negative` boolean
    - `positive` boolean
    - `units` TemporalUnit[]
      - `durationEstimated` boolean
      - `duration` Duration (recursive)
      - `timeBased` boolean
      - `dateBased` boolean
  - `userId` string: The id of the user that triggered the invocation
  - `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
- `404`: Indicates that agent invocation 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)
