---
title: "List AI pentest agents for a scan"
method: GET
path: "/scans/{scanId}/agents"
tags: ["Scans", "Beta"]
---

# List AI pentest agents for a scan

`GET /scans/{scanId}/agents`

## Request

- Base URL: `https://public.escape.tech/v3`
- URL: `https://public.escape.tech/v3/scans/{scanId}/agents`
- Auth: API key in header `X-ESCAPE-API-KEY`

Returns the AI pentest agents that ran during a scan. Filter by title or by text found in any related reasoning log.

## Path parameters

- `scanId` string, uuid, required: The scan ID

## Query parameters

- `cursor` string: The cursor to start the pagination from. Returned by the previous page response. If not provided, the first page will be returned.
- `size` integer: The number of items to return per page
- `sortType` 'CREATED_AT' | 'STARTED_AT': The type to sort by
- `sortDirection` 'asc' | 'desc': The direction to sort by
- `search` string: Filter agents by title
- `eventSearch` string: Filter agents that have reasoning logs matching this text
- `rootsOnly` boolean, nullable: When true, return only root agents (no parent)

## Response `200`

OK

- object
  - `nextCursor` string, nullable, required
  - `totalCount` integer
  - `data` object[], required
    - `id` string, uuid, required: The id of the agent
    - `title` string, required: The title of the agent
    - `status` 'FAILED' | 'FINISHED' | 'RUNNING', required: The status of the agent
    - `parentId` string, uuid, nullable, required: The parent agent id, when nested
    - `hasChildren` boolean, required: Whether the agent spawned child agents
    - `duration` number, nullable, required: The agent run duration in milliseconds
    - `issuesCount` number, required: The number of issues reported by the agent
    - `summary` string, nullable, required: AI-generated summary of what the agent did. Credentials and secrets are redacted.
    - `startedAt` string, nullable, required: The date and time the agent started
    - `finishedAt` string, nullable, required: The date and time the agent finished

## Other responses

- `400`: Pagination error
- `404`: Not found

---

[API](https://skmtc.dev/escape/apis/escape-public-api.md) - [All operations](https://skmtc.dev/escape/apis/escape-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/escape/apis/escape-public-api/revisions/2eab35df40c7?raw)
