---
title: "Get Agent Scan History"
method: POST
path: "/api/agents/scan/history"
tags: ["Agent Analysis"]
---

# Get Agent Scan History

`POST /api/agents/scan/history`

Retrieves the history of all agent analysis scans for a repository, sorted by most recent first. Each entry includes metadata about the scan such as the branch, commit, prompt used, and number of files analyzed.

## Request body

- AgentScanHistoryRequest
  - `repo` string, required — Repository identifier

## Response `200`

Scan history retrieved successfully

- AgentScanHistoryResponse
  - `scans` object[] — List of past agent scans, sorted by most recent first
    - `service` string — VCS service used for the scan
    - `repo_name` string — Repository name
    - `branch` string — Branch that was scanned
    - `commit_id` string — Commit SHA that was scanned
    - `scan_id` string — Unique scan identifier
    - `prompt` string — Analysis prompt or type used for the scan
    - `timestamp` string, date-time — When the scan was initiated
    - `num_files` integer — Number of files that were analyzed

## Other responses

- `400` — Missing or invalid repo parameter
- `500` — Failed to retrieve scan history

---

[API](https://skmtc.dev/codeant/apis/codeant-ai-api.md) · [All operations](https://skmtc.dev/codeant/apis/codeant-ai-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/codeant/codeant-ai-api/revisions/d1eb7c083a39/schema)
