---
title: "Get a container scan"
method: POST
path: "/api/v2/containerScans/get"
tags: ["Container Scanning"]
---

# Get a container scan

`POST /api/v2/containerScans/get`

## Request

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

Retrieve a single container scan by ID, including its ordered image layers (layerIndex ascending), finding count, and detected/recommended base-image fields.

## Request body

- ContainerScanGetRequest: Input for getting a single container scan.
  - `organizationId` string: Organization ID (optional).
  - `containerScanId` string, required: ID of the container scan to retrieve.

## Response `200`

Container scan retrieved

- ContainerScan: A single container scan run, with its ordered layers and finding count.
  - `id` string, required
  - `containerImageId` string, required
  - `repositoryId` string, required
  - `imageRef` string, required
  - `imageDigest` string, nullable
  - `imageSizeBytes` number, nullable
  - `imageCreatedAt` string, date-time, nullable: When the image was built (the image's own creation date); null when unknown.
  - `status` 'IMAGE_PULL' | 'LAYER_ANALYSIS' | 'VULN_DETECTION' | 'SUCCEEDED' | 'FAILED', required
  - `errored` boolean, required: True when the scan failed (status === FAILED). A failed scan is terminal: stop polling. The DB CHECK ((status = 'FAILED') = (genericErrorId IS NOT NULL)) guarantees this flag equals (status === FAILED) exactly.
  - `detectedBaseImageRef` string, nullable
  - `recommendedBaseImageRef` string, nullable
  - `recommendedBaseImageVulnReduction` number, nullable
  - `findingsCount` number, required
  - `layers` ContainerImageLayer[], required: Image layers ordered by layerIndex ascending.
    - `id` string, required
    - `layerDigest` string, required
    - `layerIndex` number, required: Zero-based position in the image manifest.
    - `sizeBytes` number, nullable, required: Layer size in bytes, or null when the scan engine does not report it.
    - `createdByCmd` string, nullable: Dockerfile directive that produced the layer (from image history).
    - `isBaseImageLayer` boolean, required: True when the layer belongs to the detected base image.
  - `createdAt` string, date-time, required
  - `updatedAt` string, date-time, required

## Other responses

- `401`: Error Response
- `404`: 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)
