---
title: "Get secret scanning scan history for a repository"
method: GET
path: "/repos/{owner}/{repo}/secret-scanning/scan-history"
tags: ["secret-scanning"]
---

# Get secret scanning scan history for a repository

`GET /repos/{owner}/{repo}/secret-scanning/scan-history`

Lists the latest default incremental and backfill scans by type for a repository.

> [!NOTE]
> This endpoint requires [GitHub Advanced Security](https://docs.github.com/enterprise-cloud@latest/get-started/learning-about-github/about-github-advanced-security).

OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead.

## Path parameters

- `owner` string, required
- `repo` string, required

## Response `200`

Response

- SecretScanningScanHistory
  - `incremental_scans` SecretScanningScan[]
    - `type` string — The type of scan
    - `status` string — The state of the scan. Either "completed", "running", "pending", "failed", or "unknown". "failed": this scan type has hit its retry limit and has been marked permanently failed. This usually resolves on its own at the next scheduled scan attempt. If "failed" persists, contact Support. "unknown": the scan is in an unrecognized or currently unhandled state.
    - `completed_at` string, date-time, nullable — The time that the scan was completed. Empty if the scan is running
    - `started_at` string, date-time, nullable — The time that the scan was started. Empty if the scan is pending
  - `pattern_update_scans` SecretScanningScan[]
    - `type` string — The type of scan
    - `status` string — The state of the scan. Either "completed", "running", "pending", "failed", or "unknown". "failed": this scan type has hit its retry limit and has been marked permanently failed. This usually resolves on its own at the next scheduled scan attempt. If "failed" persists, contact Support. "unknown": the scan is in an unrecognized or currently unhandled state.
    - `completed_at` string, date-time, nullable — The time that the scan was completed. Empty if the scan is running
    - `started_at` string, date-time, nullable — The time that the scan was started. Empty if the scan is pending
  - `backfill_scans` SecretScanningScan[]
    - `type` string — The type of scan
    - `status` string — The state of the scan. Either "completed", "running", "pending", "failed", or "unknown". "failed": this scan type has hit its retry limit and has been marked permanently failed. This usually resolves on its own at the next scheduled scan attempt. If "failed" persists, contact Support. "unknown": the scan is in an unrecognized or currently unhandled state.
    - `completed_at` string, date-time, nullable — The time that the scan was completed. Empty if the scan is running
    - `started_at` string, date-time, nullable — The time that the scan was started. Empty if the scan is pending
  - `custom_pattern_backfill_scans` object[]
    - `type` string — The type of scan
    - `status` string — The state of the scan. Either "completed", "running", "pending", "failed", or "unknown". "failed": this scan type has hit its retry limit and has been marked permanently failed. This usually resolves on its own at the next scheduled scan attempt. If "failed" persists, contact Support. "unknown": the scan is in an unrecognized or currently unhandled state.
    - `completed_at` string, date-time, nullable — The time that the scan was completed. Empty if the scan is running
    - `started_at` string, date-time, nullable — The time that the scan was started. Empty if the scan is pending
    - `pattern_name` string — Name of the custom pattern for custom pattern scans
    - `pattern_scope` string — Level at which the custom pattern is defined, one of "repository", "organization", or "enterprise"
  - `generic_secrets_backfill_scans` SecretScanningScan[]
    - `type` string — The type of scan
    - `status` string — The state of the scan. Either "completed", "running", "pending", "failed", or "unknown". "failed": this scan type has hit its retry limit and has been marked permanently failed. This usually resolves on its own at the next scheduled scan attempt. If "failed" persists, contact Support. "unknown": the scan is in an unrecognized or currently unhandled state.
    - `completed_at` string, date-time, nullable — The time that the scan was completed. Empty if the scan is running
    - `started_at` string, date-time, nullable — The time that the scan was started. Empty if the scan is pending

## Other responses

- `404` — Repository does not have GitHub Advanced Security or secret scanning enabled
- `503` — Service unavailable

---

[API](https://skmtc.net/github/apis/github-v3-rest-api-2.md) · [All operations](https://skmtc.net/github/apis/github-v3-rest-api-2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/github/github-v3-rest-api-2/versions/8ae6d0c8716e/schema)
