---
title: "List Scans"
method: POST
path: "/api/v2/scans/list"
tags: ["Scans"]
---

# List Scans

`POST /api/v2/scans/list`

## Request

- Base URL: `https://zeropath.com`
- URL: `https://zeropath.com/api/v2/scans/list`
- Auth: API key in header `X-ZeroPath-API-Token-Id` and API key in header `X-ZeroPath-API-Token-Secret`

Retrieves a list of scans with cursor-based pagination, supporting both PR and Full scans by default

## Request body

- ListScansInput: Input for listing scans with cursor-based pagination
  - `organizationId` string: Organization ID (optional)
  - `repositoryIds` string[]: Filter scans to specific repositories
  - `cursor` string: Cursor for pagination (obtained from nextCursor in previous response)
  - `limit` number: Number of items to return
  - `searchQuery` string: Optional search query to filter scans
  - `projectId` string: Filter by project ID
  - `scanTypes` string[]: Filter by scan types. Defaults to FullScan and PrScan if not specified.
  - `scoreLevels` string[]: Filter scans by vulnerability score levels
  - `showEphemeral` boolean: Whether to include ephemeral scans in results
  - `getCounts` boolean: Whether to fetch vulnerability counts for scans. Set to false for better performance.

## Response `200`

Scans retrieved successfully

- ListScansResponse: Response from listing scans
  - `items` GetScanResponse[], required: List of scans
    - `name` string
    - `githubRepositoryId` string
    - `gitlabRepositoryId` string
    - `bitbucketRepositoryId` string
    - `azureRepositoryId` string
    - `gerritRepositoryId` string
    - `genericGitRepositoryId` string
    - `cvsRepositoryId` string
    - `projectId` string
    - `applicationId` string
    - `scanId` string, required
    - `prTargetBranch` string, nullable
    - `scanTargetBranch` string
    - `codeScanType` 'FullScan' | 'PrScan' | 'SCAScan'
    - `prTriggeredURL` string, nullable
    - `isStaged` boolean
    - `status` 'Scheduled' | 'Queued' | 'Running' | 'Errored' | 'Finished' | 'Cloning repository' | 'Scanning for vulnerabilities' | 'Generating patches' | 'Setting up repository' | 'Identifying application(s)' | 'Generating AST' | 'Identifying source(s)' | 'Detecting vulnerabilities' | 'Validating results': Current status of the scan
    - `statusNum` number: Numeric status indicator (0-10, higher means more progress)
    - `issueCounts` object
      - `PENDING_REVIEW` number
      - `REVIEWING` number
      - `PATCHING` number
      - `NON_EXPLOITABLE` number
      - `FALSE_POSITIVE` number
      - `ACCEPTED_RISK` number
      - `RESOLVED` number
      - `BACKLOG` number
      - `newOpen` number: Open, non-duplicate vulnerabilities detected in this scan
      - `open` number: Current open + duplicate open issues
    - `finished` boolean, required
    - `createdAt` string, date-time, required
    - `updatedAt` string, date-time, required
    - `scanFinishedAt` string, date-time, nullable
    - `trigger` 'Scheduled' | 'Manual'
    - `repositoryId` string, required
    - `repositoryName` string
    - `errorMessage` string, nullable
    - `prBypassedAt` boolean
    - `sastScan` object, nullable
      - `id` string
    - `scaScan` object, nullable
      - `id` string
      - `inventoryRetiredAt` string, date-time, nullable: When this scan's dependency inventory was retired because a newer scan superseded it; null while present.
    - `scanType` 'code' | 'sca', required
  - `nextCursor` string, nullable, required: Cursor for next page, null if no more results
  - `hasMore` boolean, required: Whether there are more results available

## Other responses

- `401`: Error Response

---

[API](https://skmtc.dev/zeropath/apis/zeropath-api.md) - [All operations](https://skmtc.dev/zeropath/apis/zeropath-api/llms.txt) - [OpenAPI document](https://skmtc.dev/zeropath/apis/zeropath-api/revisions/126e9c80ba0d?raw)
