---
title: "List scans (beta)"
method: POST
path: "/api/v1/deployments/{deploymentId}/scans/search"
tags: ["ScansService"]
---

# List scans (beta)

`POST /api/v1/deployments/{deploymentId}/scans/search`

List the scans associated with a particular repository over the past 30 days.

## Path parameters

- `deploymentId` string, int64, required — Deployment ID (numeric). Example: `123`. Can be found at `/deployments`, or in your Settings in the web UI.

## Request body

- ProtosOpenapiV1SearchScansRequest
  - `branch` string — Only get scans from the specified branch
  - `cursor` string — Cursor to paginate through the results
  - `deploymentId` string, int64 — Deployment ID (numeric). Example: `123`. Can be found at `/deployments`, or in your Settings in the web UI.
  - `is_full_scan` integer — Only get scans that are full scans (if false, only get diff scans)
  - `limit` integer — Page size to paginate through the results (default is 100, max is 500)
  - `products` string[] — Only get scans that have these enabled products | value | description | |-------|---------------| | PRODUCT_SAST | | | PRODUCT_SCA | | | PRODUCT_SECRETS | | | PRODUCT_AI_SAST | |
  - `repository_id` integer — Only get scans for this repo
  - `since` string, date-time — Only get scans created after this time. Provide time in ISO 8601 format.
  - `statuses` integer — Only get scans that have one of these statuses | value | description | |-------|---------------| | SCAN_STATUS_RUNNING | The scan is currently running | | SCAN_STATUS_COMPLETED | The scan has completed successfully (0 or 1 exit code) | | SCAN_STATUS_PENDING | The scan is queued and waiting to start | | SCAN_STATUS_CANCELLED | The scan was cancelled before completion | | SCAN_STATUS_ERROR | The scan has exited with a failure (exit code not 0 or 1) | | SCAN_STATUS_NEVER_FINISHED | The scan did not report an error or success after over an hour |
  - `total_time` ProtosCommonV1FloatRange
    - `max` number, float — End of the range
    - `min` number, float — Start of the range

## Response `200`

OK

- ProtosOpenapiV1SearchScansResponse
  - `cursor` string — Cursor to retrieve the next page of results.
  - `scans` ProtosScanV1ScanPublic[] — List of scans.
    - `branch` string — The scanned branch
    - `commit` string — The commit hash that was scanned
    - `completed_at` string, date-time — The timestamp when this scan completed (if it has completed).
    - `deployment_id` string, int64 — Unique identifier for the deployment of the scan.
    - `enabled_products` string[] — The products used when running the scan.
    - `exit_code` string, int64 — The exit_code of the scan (see https://semgrep.dev/docs/cli-reference#exit-codes)
    - `findings_counts` ProtosScanV1ScanFindingsCounts
      - `code` string, int64 — Total number of Code findings in the scan
      - `secrets` string, int64 — Total number of Secrets findings in the scan
      - `supply_chain` string, int64 — Total number of Supply Chain findings in the scan
      - `total` string, int64 — Total number of findings in the scan
    - `id` string, int64 — ID of the scan.
    - `is_full_scan` boolean — Whether the scan was a full scan (true) or a diff scan (false)
    - `repository_id` string, int64 — Unique identifier for the repository of the scan.
    - `started_at` string, date-time — The timestamp when this scan started.
    - `status` 'SCAN_STATUS_RUNNING' | 'SCAN_STATUS_COMPLETED' | 'SCAN_STATUS_PENDING' | 'SCAN_STATUS_CANCELLED' | 'SCAN_STATUS_ERROR' | 'SCAN_STATUS_NEVER_FINISHED', enum — The current status of the scan | value | description | |-------|---------------| | SCAN_STATUS_RUNNING | The scan is currently running | | SCAN_STATUS_COMPLETED | The scan has completed successfully (0 or 1 exit code) | | SCAN_STATUS_PENDING | The scan is queued and waiting to start | | SCAN_STATUS_CANCELLED | The scan was cancelled before completion | | SCAN_STATUS_ERROR | The scan has exited with a failure (exit code not 0 or 1) | | SCAN_STATUS_NEVER_FINISHED | The scan did not report an error or success after over an hour |
    - `total_time` number, float — Duration of scan, in seconds

---

[API](https://skmtc.net/semgrep/apis/semgrep-web-app.md) · [All operations](https://skmtc.net/semgrep/apis/semgrep-web-app/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/semgrep/semgrep-web-app/versions/6483eeecd582/schema)
