---
title: "Get logs for an agent"
method: GET
path: "/agents/{agentId}/logs"
tags: ["agents"]
---

# Get logs for an agent

`GET /agents/{agentId}/logs`

## Path parameters

- `agentId` string, required — Agent ID

## Query parameters

- `environmentId` string, required — Environment ID

## Headers

- `Authorization` string, required
- `X-Disable-Hooks` 'true', required

## Response `200`

Response with status 200

- TypeAgentsGetAgentLogsResponse
  - `pagination` TypeCommonsPagination — pagination info
    - `currentPage` integer, required — current page of results
    - `pageCount` integer, required — total number of pages of results
    - `totalCount` integer, required — total available results
  - `data` TypeAgentsAgentLog[]
    - `id` string, required — Agent Log ID
    - `agentId` string, required — Agent ID
    - `eventId` string, required — Event ID
    - `success` boolean, required — Whether the agent execution was successful
    - `createdAt` string, required
    - `completedAt` string, required
    - `log` string — The log of the agent execution
    - `queueLag` integer — The time difference between when the event was created and when the agent started processing it
    - `namespaces` string[] — The namespaces associated with the event
    - `context` object — The context of the agent execution
    - `topic` string — The topic of the agent execution
    - `duration` integer — The duration of the agent execution in milliseconds
    - `memoryUsage` integer — The memory usage of the agent execution in bytes
    - `requestTime` integer — The amount of time the agent spent making HTTP requests in milliseconds
    - `requestCount` integer — The number of HTTP requests made by the agent
    - `bytesReceived` integer — The total amount of data received by the agent during execution in bytes
    - `bytesSent` integer — The total amount of data sent by the agent during execution in bytes

## Other responses

- `400` — Error response with status 400
- `404` — Error response with status 404

---

[API](https://skmtc.net/flatfile/apis/api-reference.md) · [All operations](https://skmtc.net/flatfile/apis/api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/flatfile/api-reference/versions/9d3a9979cd96/schema)
