> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/api-reference/security-testing-agent-apis/security-testing-orchestration/scans.md).

# Scans

Access and modify Security Test Scans

## GET /api/v2/scans

> List a collection of Security Test Scans

```json
{"openapi":"3.0.3","info":{"title":"Harness Security Test Orchestration API","version":"1.0.0"},"tags":[{"name":"Scans","description":"Access and modify Security Test Scans"}],"servers":[{"url":"https://app.harness.io/gateway/sto"},{"url":"http://127.0.0.1:4000"}],"security":[{"X-Api-Key_header_X-Api-Key":[],"jwt_header_Authorization":["sto_scan_view"]}],"components":{"securitySchemes":{"X-Api-Key_header_X-Api-Key":{"type":"apiKey","name":"X-Api-Key","in":"header"},"jwt_header_Authorization":{"type":"http","scheme":"bearer"}},"schemas":{"ScansListScansResponseBody":{"type":"object","properties":{"pagination":{"$ref":"#/components/schemas/Pagination"},"results":{"type":"array","items":{"$ref":"#/components/schemas/Scan"}}},"required":["results","pagination"]},"Pagination":{"type":"object","properties":{"link":{"type":"string","description":"Link-based paging"},"page":{"type":"integer","description":"Page number (starting from 0)","format":"int64"},"pageSize":{"type":"integer","description":"Requested page size","format":"int64"},"totalItems":{"type":"integer","description":"Total results available","format":"int64"},"totalPages":{"type":"integer","description":"Total pages available","format":"int64"}},"required":["page","pageSize","totalPages","totalItems"]},"Scan":{"type":"object","properties":{"codeCoverage":{"type":"number","description":"The Code Coverage value for the Scan","format":"float"},"created":{"type":"integer","description":"Unix timestamp at which the resource was created","format":"int64"},"executionId":{"type":"string","description":"Pipeline Execution ID associated with the Scan","pattern":"^[a-zA-Z0-9_-]{22}$"},"gitMetadata":{"$ref":"#/components/schemas/GitMetadata"},"id":{"type":"string","description":"Resource identifier","pattern":"^[a-zA-Z0-9_-]{22}$"},"lastModified":{"type":"integer","description":"Unix timestamp at which the resource was most recently modified","format":"int64"},"metadata":{"$ref":"#/components/schemas/ScanMetadata"},"orgId":{"type":"string","description":"Harness Organization ID","pattern":"^[A-Za-z_][A-Za-z0-9_]*$","maxLength":128},"pipelineId":{"type":"string","description":"Harness Organization ID","pattern":"^[A-Za-z_][A-Za-z0-9_]*$","maxLength":128},"productId":{"type":"string","description":"The Scan Product used for the Scan","pattern":"^[a-zA-Z0-9_-]{22}$"},"productName":{"type":"string","description":"The machine name of the Scan Product (scanner), e.g. snyk. Optional; populated by endpoints that join the product table."},"productPrettyName":{"type":"string","description":"The human-readable display name of the Scan Product (scanner), e.g. Snyk. Optional; populated by endpoints that join the product table."},"projectId":{"type":"string","description":"Harness Project ID","pattern":"^[A-Za-z_][A-Za-z0-9_]*$","maxLength":128},"refinementVersion":{"type":"string","description":"The Issue refinement version used for this Scan"},"scannerDiffKey":{"type":"string","description":"Key used to differentiate scanner configurations for scan comparison (e.g. sast, sca, sast_sca)"},"stageId":{"type":"string","description":"Pipeline Stage ID associated with the Scan","pattern":"^[A-Za-z_][A-Za-z0-9_]*$","maxLength":128},"status":{"type":"string","description":"Current status of the Scan","enum":["Pending","Running","Succeeded","Failed"]},"stepId":{"type":"string","description":"Pipeline Step ID associated with the Scan","pattern":"^[A-Za-z_][A-Za-z0-9_]*$","maxLength":128},"subproduct":{"type":"string","description":"The Scan Subproduct used for the Scan","format":"binary"},"targetVariantId":{"type":"string","description":"The Target Variant associated with the Scan","pattern":"^[a-zA-Z0-9_-]{22}$"}},"description":"Information about a Security Test Scan","required":["targetVariantId","orgId","projectId","pipelineId","executionId","stageId","stepId","productId","status","refinementVersion","id","created","lastModified"]},"GitMetadata":{"type":"object","properties":{"commit":{"type":"string","description":"Git Commit SHA scanned"},"detectedName":{"type":"string","description":"Detected Name"},"detectedVariant":{"type":"string","description":"Detected Variant"},"droneCorrelated":{"type":"boolean","description":"Drone Correlated"},"provider":{"type":"string","description":"Git Provider"},"pullRequestNumber":{"type":"integer","description":"Git Pull Request Number","format":"int64"},"repositoryHttp":{"type":"string","description":"Git HTTP Repository"},"repositoryPath":{"type":"array","items":{"type":"string"},"description":"Git Repository Path"},"repositorySsh":{"type":"string","description":"Git SSH Repository"},"sourceBranch":{"type":"string","description":"Git Source Branch"},"targetBranch":{"type":"string","description":"Git Target Branch"},"workspace":{"type":"string","description":"Git Workspace Root"}},"description":"Git Metadata associated with the Scan"},"ScanMetadata":{"type":"object","properties":{"appId":{"type":"string","description":"Application identifier assigned by the scanner"},"appName":{"type":"string","description":"Application name used by the scanner"},"applicationName":{"type":"string","description":"Application name used by the scanner"},"artifactSource":{"type":"string","description":"Artifact source for container scans. Pipeline container_type is authoritative unless it equals docker_v2; docker_v2 may be refined from registryUrl to harness, aws_ecr, google, azure, github, docker_hub, or jfrog_artifactory. Unknown docker_v2 registry remains docker_v2."},"artifactUrl":{"type":"string","description":"Exact container image scanned, including its tag or digest"},"baseImageDigest":{"type":"string","description":"Digest of the base image"},"baseImageName":{"type":"string","description":"Name of the base image"},"baseImageTag":{"type":"string","description":"Tag of the base image"},"buildId":{"type":"string","description":"CI build/sequence id for the run that produced this scan (Harness HARNESS_BUILD_ID / <+pipeline.sequenceId>; non-Harness BUILD_ID). Not a product/scanner build id.","maxLength":128},"deduplicatedCount":{"type":"integer","description":"Total number of deduplicated issues found in the scan","format":"int32"},"executionSource":{"type":"string","description":"CI/CD platform that ran the scan (harness, jenkins, github_actions, gitlab_ci, ...)"},"executionUrl":{"type":"string","description":"URL of the CI execution from scan metadata (Jenkins/GHA BUILD_URL). For Harness, FE constructs the URL from pipelineId, executionId, and org/project when this is empty."},"honorGracePeriod":{"type":"boolean","description":"Honor vendor-issued grace period when bucketing issue counts (Prisma/Twistlock only)"},"imageBuildMetadata":{"$ref":"#/components/schemas/ImageBuildMetadata"},"imageDomain":{"type":"string","description":"Domain of the container image registry"},"imageName":{"type":"string","description":"Name of the container image"},"imageTag":{"type":"string","description":"Tag of the container image"},"ingestToolSeverityFlag":{"type":"boolean","description":"Scan ran with ingest_tool_severity enabled in the pipeline"},"normalizedCount":{"type":"integer","description":"Total number of normalized issues found in the scan","format":"int32"},"polyglotScanId":{"type":"string","description":"ShiftLeft/Qwiet polyglot scan ID for SCA package lookups"},"projectId":{"type":"string","description":"Project identifier assigned by the scanner"},"projectKey":{"type":"string","description":"Project key used by the scanner"},"projectName":{"type":"string","description":"Project name used by the scanner"},"publicId":{"type":"string","description":"Public application identifier assigned by the scanner"},"registryUrl":{"type":"string","description":"OCI pull base of the container image without a tag or digest"},"scanConfig":{"type":"string","description":"Scan configuration selected for this scan (e.g. default, oss, code, iac)"},"scannerConsoleUrl":{"type":"string","description":"URL to view scan results in the scanner's console"},"triggeredBy":{"type":"string","description":"Actor that triggered this scan. For PAT ingest, sto-core fills this from the token owner (NG username/email) when the plugin omits it. Harness pipeline runs are filled from pipeline-service instead.","maxLength":256}},"description":"Metadata specific to the entity being scanned"},"ImageBuildMetadata":{"type":"object","properties":{"dockerfilePath":{"type":"string","description":"Repository-relative Dockerfile path (io.harness.image.dockerfile)"},"repoUrl":{"type":"string","description":"Source repository HTTPS URL (org.opencontainers.image.source)"},"sourceBranch":{"type":"string","description":"Exact non-tag ref the image build ran on (io.harness.image.source.branch) — the image's build branch, not the branch the scan ran on"}},"description":"Self-asserted build metadata read off the scanned image's config labels; lookup hints, not proof of the build revision"},"NotFound":{"type":"object","properties":{"message":{"type":"string"},"status":{"type":"integer","default":404,"format":"int64"}},"required":["message"]}}},"paths":{"/api/v2/scans":{"get":{"tags":["Scans"],"description":"List a collection of Security Test Scans","operationId":"Scans#ListScans","parameters":[{"name":"accountId","in":"query","description":"Harness Account ID","allowEmptyValue":true,"required":true,"schema":{"type":"string","description":"Harness Account ID","pattern":"^[a-zA-Z0-9_-]{22}$"}},{"name":"page","in":"query","description":"Page number to fetch (starting from 0)","allowEmptyValue":true,"schema":{"type":"integer","description":"Page number to fetch (starting from 0)","default":0,"format":"int64","minimum":0}},{"name":"pageSize","in":"query","description":"Number of results per page","allowEmptyValue":true,"schema":{"type":"integer","description":"Number of results per page","default":30,"format":"int64","minimum":1,"maximum":100}},{"name":"executionId","in":"query","description":"Harness Execution ID","allowEmptyValue":true,"schema":{"type":"string","description":"Harness Execution ID","pattern":"^[a-zA-Z0-9_-]{22}$"}},{"name":"X-Api-Key","in":"header","description":"Harness personal or service access token","allowEmptyValue":true,"schema":{"type":"string","description":"Harness personal or service access token"}}],"responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScansListScansResponseBody"}}}},"400":{"description":"BadRequest: Bad Request response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"401":{"description":"Unauthorized: Unauthorized response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"403":{"description":"Forbidden: Forbidden response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"404":{"description":"NotFound: Not Found response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"429":{"description":"TooManyRequests: Too Many Requests response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"500":{"description":"InternalServerError: Internal Server Error response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}}}}}}}
```

## POST /api/v2/scans

> Create a new Security Test Scan

```json
{"openapi":"3.0.3","info":{"title":"Harness Security Test Orchestration API","version":"1.0.0"},"tags":[{"name":"Scans","description":"Access and modify Security Test Scans"}],"servers":[{"url":"https://app.harness.io/gateway/sto"},{"url":"http://127.0.0.1:4000"}],"security":[{"X-Api-Key_header_X-Api-Key":[],"jwt_header_Authorization":["sto_scan_edit"]}],"components":{"securitySchemes":{"X-Api-Key_header_X-Api-Key":{"type":"apiKey","name":"X-Api-Key","in":"header"},"jwt_header_Authorization":{"type":"http","scheme":"bearer"}},"schemas":{"CreateScanRequestBody":{"type":"object","properties":{"codeCoverage":{"type":"number","description":"The Code Coverage value for the Scan","format":"float"},"executionId":{"type":"string","description":"Pipeline Execution ID associated with the Scan","pattern":"^[a-zA-Z0-9_-]{22}$"},"gitMetadata":{"$ref":"#/components/schemas/GitMetadata"},"orgId":{"type":"string","description":"Harness Organization ID","pattern":"^[A-Za-z_][A-Za-z0-9_]*$","maxLength":128},"pipelineId":{"type":"string","description":"Harness Organization ID","pattern":"^[A-Za-z_][A-Za-z0-9_]*$","maxLength":128},"productId":{"type":"string","description":"The Scan Product used for the Scan","pattern":"^[a-zA-Z0-9_-]{22}$"},"productName":{"type":"string","description":"The machine name of the Scan Product (scanner), e.g. snyk. Optional; populated by endpoints that join the product table."},"productPrettyName":{"type":"string","description":"The human-readable display name of the Scan Product (scanner), e.g. Snyk. Optional; populated by endpoints that join the product table."},"projectId":{"type":"string","description":"Harness Project ID","pattern":"^[A-Za-z_][A-Za-z0-9_]*$","maxLength":128},"refinementVersion":{"type":"string","description":"The Issue refinement version used for this Scan"},"scannerDiffKey":{"type":"string","description":"Key used to differentiate scanner configurations for scan comparison (e.g. sast, sca, sast_sca)"},"stageId":{"type":"string","description":"Pipeline Stage ID associated with the Scan","pattern":"^[A-Za-z_][A-Za-z0-9_]*$","maxLength":128},"status":{"type":"string","description":"Current status of the Scan","enum":["Pending","Running","Succeeded","Failed"]},"stepId":{"type":"string","description":"Pipeline Step ID associated with the Scan","pattern":"^[A-Za-z_][A-Za-z0-9_]*$","maxLength":128},"subproduct":{"type":"string","description":"The Scan Subproduct used for the Scan","format":"binary"},"targetVariantId":{"type":"string","description":"The Target Variant associated with the Scan","pattern":"^[a-zA-Z0-9_-]{22}$"}},"required":["targetVariantId","orgId","projectId","pipelineId","executionId","stageId","stepId","productId","status","refinementVersion","id","created","lastModified"]},"GitMetadata":{"type":"object","properties":{"commit":{"type":"string","description":"Git Commit SHA scanned"},"detectedName":{"type":"string","description":"Detected Name"},"detectedVariant":{"type":"string","description":"Detected Variant"},"droneCorrelated":{"type":"boolean","description":"Drone Correlated"},"provider":{"type":"string","description":"Git Provider"},"pullRequestNumber":{"type":"integer","description":"Git Pull Request Number","format":"int64"},"repositoryHttp":{"type":"string","description":"Git HTTP Repository"},"repositoryPath":{"type":"array","items":{"type":"string"},"description":"Git Repository Path"},"repositorySsh":{"type":"string","description":"Git SSH Repository"},"sourceBranch":{"type":"string","description":"Git Source Branch"},"targetBranch":{"type":"string","description":"Git Target Branch"},"workspace":{"type":"string","description":"Git Workspace Root"}},"description":"Git Metadata associated with the Scan"},"ExemptionRulesCreateExemptionRuleResponseBody":{"$ref":"#/components/schemas/IDResult"},"IDResult":{"type":"object","properties":{"id":{"type":"string","description":"Resource identifier","pattern":"^[a-zA-Z0-9_-]{22}$"}},"required":["id"]},"NotFound":{"type":"object","properties":{"message":{"type":"string"},"status":{"type":"integer","default":404,"format":"int64"}},"required":["message"]}}},"paths":{"/api/v2/scans":{"post":{"tags":["Scans"],"description":"Create a new Security Test Scan","operationId":"Scans#CreateScan","parameters":[{"name":"accountId","in":"query","description":"Harness Account ID","allowEmptyValue":true,"required":true,"schema":{"type":"string","description":"Harness Account ID","pattern":"^[a-zA-Z0-9_-]{22}$"}},{"name":"X-Api-Key","in":"header","description":"Harness personal or service access token","allowEmptyValue":true,"schema":{"type":"string","description":"Harness personal or service access token"}},{"name":"X-Harness-User-Id","in":"header","description":"Harness User ID","allowEmptyValue":true,"schema":{"type":"string","description":"Harness User ID"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateScanRequestBody"}}}},"responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExemptionRulesCreateExemptionRuleResponseBody"}}}},"400":{"description":"BadRequest: Bad Request response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"401":{"description":"Unauthorized: Unauthorized response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"403":{"description":"Forbidden: Forbidden response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"429":{"description":"TooManyRequests: Too Many Requests response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"500":{"description":"InternalServerError: Internal Server Error response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}}}}}}}
```

## GET /api/v2/scans/{id}

> Find Security Test Scan by ID

```json
{"openapi":"3.0.3","info":{"title":"Harness Security Test Orchestration API","version":"1.0.0"},"tags":[{"name":"Scans","description":"Access and modify Security Test Scans"}],"servers":[{"url":"https://app.harness.io/gateway/sto"},{"url":"http://127.0.0.1:4000"}],"security":[{"X-Api-Key_header_X-Api-Key":[],"jwt_header_Authorization":["sto_scan_view"]}],"components":{"securitySchemes":{"X-Api-Key_header_X-Api-Key":{"type":"apiKey","name":"X-Api-Key","in":"header"},"jwt_header_Authorization":{"type":"http","scheme":"bearer"}},"schemas":{"Scan":{"type":"object","properties":{"codeCoverage":{"type":"number","description":"The Code Coverage value for the Scan","format":"float"},"created":{"type":"integer","description":"Unix timestamp at which the resource was created","format":"int64"},"executionId":{"type":"string","description":"Pipeline Execution ID associated with the Scan","pattern":"^[a-zA-Z0-9_-]{22}$"},"gitMetadata":{"$ref":"#/components/schemas/GitMetadata"},"id":{"type":"string","description":"Resource identifier","pattern":"^[a-zA-Z0-9_-]{22}$"},"lastModified":{"type":"integer","description":"Unix timestamp at which the resource was most recently modified","format":"int64"},"metadata":{"$ref":"#/components/schemas/ScanMetadata"},"orgId":{"type":"string","description":"Harness Organization ID","pattern":"^[A-Za-z_][A-Za-z0-9_]*$","maxLength":128},"pipelineId":{"type":"string","description":"Harness Organization ID","pattern":"^[A-Za-z_][A-Za-z0-9_]*$","maxLength":128},"productId":{"type":"string","description":"The Scan Product used for the Scan","pattern":"^[a-zA-Z0-9_-]{22}$"},"productName":{"type":"string","description":"The machine name of the Scan Product (scanner), e.g. snyk. Optional; populated by endpoints that join the product table."},"productPrettyName":{"type":"string","description":"The human-readable display name of the Scan Product (scanner), e.g. Snyk. Optional; populated by endpoints that join the product table."},"projectId":{"type":"string","description":"Harness Project ID","pattern":"^[A-Za-z_][A-Za-z0-9_]*$","maxLength":128},"refinementVersion":{"type":"string","description":"The Issue refinement version used for this Scan"},"scannerDiffKey":{"type":"string","description":"Key used to differentiate scanner configurations for scan comparison (e.g. sast, sca, sast_sca)"},"stageId":{"type":"string","description":"Pipeline Stage ID associated with the Scan","pattern":"^[A-Za-z_][A-Za-z0-9_]*$","maxLength":128},"status":{"type":"string","description":"Current status of the Scan","enum":["Pending","Running","Succeeded","Failed"]},"stepId":{"type":"string","description":"Pipeline Step ID associated with the Scan","pattern":"^[A-Za-z_][A-Za-z0-9_]*$","maxLength":128},"subproduct":{"type":"string","description":"The Scan Subproduct used for the Scan","format":"binary"},"targetVariantId":{"type":"string","description":"The Target Variant associated with the Scan","pattern":"^[a-zA-Z0-9_-]{22}$"}},"description":"Information about a Security Test Scan","required":["targetVariantId","orgId","projectId","pipelineId","executionId","stageId","stepId","productId","status","refinementVersion","id","created","lastModified"]},"GitMetadata":{"type":"object","properties":{"commit":{"type":"string","description":"Git Commit SHA scanned"},"detectedName":{"type":"string","description":"Detected Name"},"detectedVariant":{"type":"string","description":"Detected Variant"},"droneCorrelated":{"type":"boolean","description":"Drone Correlated"},"provider":{"type":"string","description":"Git Provider"},"pullRequestNumber":{"type":"integer","description":"Git Pull Request Number","format":"int64"},"repositoryHttp":{"type":"string","description":"Git HTTP Repository"},"repositoryPath":{"type":"array","items":{"type":"string"},"description":"Git Repository Path"},"repositorySsh":{"type":"string","description":"Git SSH Repository"},"sourceBranch":{"type":"string","description":"Git Source Branch"},"targetBranch":{"type":"string","description":"Git Target Branch"},"workspace":{"type":"string","description":"Git Workspace Root"}},"description":"Git Metadata associated with the Scan"},"ScanMetadata":{"type":"object","properties":{"appId":{"type":"string","description":"Application identifier assigned by the scanner"},"appName":{"type":"string","description":"Application name used by the scanner"},"applicationName":{"type":"string","description":"Application name used by the scanner"},"artifactSource":{"type":"string","description":"Artifact source for container scans. Pipeline container_type is authoritative unless it equals docker_v2; docker_v2 may be refined from registryUrl to harness, aws_ecr, google, azure, github, docker_hub, or jfrog_artifactory. Unknown docker_v2 registry remains docker_v2."},"artifactUrl":{"type":"string","description":"Exact container image scanned, including its tag or digest"},"baseImageDigest":{"type":"string","description":"Digest of the base image"},"baseImageName":{"type":"string","description":"Name of the base image"},"baseImageTag":{"type":"string","description":"Tag of the base image"},"buildId":{"type":"string","description":"CI build/sequence id for the run that produced this scan (Harness HARNESS_BUILD_ID / <+pipeline.sequenceId>; non-Harness BUILD_ID). Not a product/scanner build id.","maxLength":128},"deduplicatedCount":{"type":"integer","description":"Total number of deduplicated issues found in the scan","format":"int32"},"executionSource":{"type":"string","description":"CI/CD platform that ran the scan (harness, jenkins, github_actions, gitlab_ci, ...)"},"executionUrl":{"type":"string","description":"URL of the CI execution from scan metadata (Jenkins/GHA BUILD_URL). For Harness, FE constructs the URL from pipelineId, executionId, and org/project when this is empty."},"honorGracePeriod":{"type":"boolean","description":"Honor vendor-issued grace period when bucketing issue counts (Prisma/Twistlock only)"},"imageBuildMetadata":{"$ref":"#/components/schemas/ImageBuildMetadata"},"imageDomain":{"type":"string","description":"Domain of the container image registry"},"imageName":{"type":"string","description":"Name of the container image"},"imageTag":{"type":"string","description":"Tag of the container image"},"ingestToolSeverityFlag":{"type":"boolean","description":"Scan ran with ingest_tool_severity enabled in the pipeline"},"normalizedCount":{"type":"integer","description":"Total number of normalized issues found in the scan","format":"int32"},"polyglotScanId":{"type":"string","description":"ShiftLeft/Qwiet polyglot scan ID for SCA package lookups"},"projectId":{"type":"string","description":"Project identifier assigned by the scanner"},"projectKey":{"type":"string","description":"Project key used by the scanner"},"projectName":{"type":"string","description":"Project name used by the scanner"},"publicId":{"type":"string","description":"Public application identifier assigned by the scanner"},"registryUrl":{"type":"string","description":"OCI pull base of the container image without a tag or digest"},"scanConfig":{"type":"string","description":"Scan configuration selected for this scan (e.g. default, oss, code, iac)"},"scannerConsoleUrl":{"type":"string","description":"URL to view scan results in the scanner's console"},"triggeredBy":{"type":"string","description":"Actor that triggered this scan. For PAT ingest, sto-core fills this from the token owner (NG username/email) when the plugin omits it. Harness pipeline runs are filled from pipeline-service instead.","maxLength":256}},"description":"Metadata specific to the entity being scanned"},"ImageBuildMetadata":{"type":"object","properties":{"dockerfilePath":{"type":"string","description":"Repository-relative Dockerfile path (io.harness.image.dockerfile)"},"repoUrl":{"type":"string","description":"Source repository HTTPS URL (org.opencontainers.image.source)"},"sourceBranch":{"type":"string","description":"Exact non-tag ref the image build ran on (io.harness.image.source.branch) — the image's build branch, not the branch the scan ran on"}},"description":"Self-asserted build metadata read off the scanned image's config labels; lookup hints, not proof of the build revision"},"NotFound":{"type":"object","properties":{"message":{"type":"string"},"status":{"type":"integer","default":404,"format":"int64"}},"required":["message"]}}},"paths":{"/api/v2/scans/{id}":{"get":{"tags":["Scans"],"description":"Find Security Test Scan by ID","operationId":"Scans#FindScanById","parameters":[{"name":"accountId","in":"query","description":"Harness Account ID","allowEmptyValue":true,"required":true,"schema":{"type":"string","description":"Harness Account ID","pattern":"^[a-zA-Z0-9_-]{22}$"}},{"name":"id","in":"path","description":"The ID of the Security Test Scan to retrieve","required":true,"schema":{"type":"string","description":"The ID of the Security Test Scan to retrieve","pattern":"^[a-zA-Z0-9_-]{22}$"}},{"name":"X-Api-Key","in":"header","description":"Harness personal or service access token","allowEmptyValue":true,"schema":{"type":"string","description":"Harness personal or service access token"}}],"responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Scan"}}}},"400":{"description":"BadRequest: Bad Request response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"401":{"description":"Unauthorized: Unauthorized response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"403":{"description":"Forbidden: Forbidden response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"404":{"description":"NotFound: Not Found response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"429":{"description":"TooManyRequests: Too Many Requests response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"500":{"description":"InternalServerError: Internal Server Error response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}}}}}}}
```

## PUT /api/v2/scans/{id}

> Update an existing Security Test Scan

```json
{"openapi":"3.0.3","info":{"title":"Harness Security Test Orchestration API","version":"1.0.0"},"tags":[{"name":"Scans","description":"Access and modify Security Test Scans"}],"servers":[{"url":"https://app.harness.io/gateway/sto"},{"url":"http://127.0.0.1:4000"}],"security":[{"X-Api-Key_header_X-Api-Key":[],"jwt_header_Authorization":["sto_scan_edit"]}],"components":{"securitySchemes":{"X-Api-Key_header_X-Api-Key":{"type":"apiKey","name":"X-Api-Key","in":"header"},"jwt_header_Authorization":{"type":"http","scheme":"bearer"}},"schemas":{"UpdateScanRequestBody":{"type":"object","properties":{"artifactFingerprint":{"type":"string","description":"The Artifact Fingerprint used use to identify the target","pattern":"^[A-Za-z0-9_]*$","maxLength":64},"codeCoverage":{"type":"number","description":"The Code Coverage value for the Scan","format":"float"},"executionId":{"type":"string","description":"Pipeline Execution ID associated with the Scan","pattern":"^[a-zA-Z0-9_-]{22}$"},"gitMetadata":{"$ref":"#/components/schemas/GitMetadata"},"metadata":{"$ref":"#/components/schemas/ScanMetadata"},"orgId":{"type":"string","description":"Harness Organization ID","pattern":"^[A-Za-z_][A-Za-z0-9_]*$","maxLength":128},"pipelineId":{"type":"string","description":"Harness Organization ID","pattern":"^[A-Za-z_][A-Za-z0-9_]*$","maxLength":128},"productId":{"type":"string","description":"The Scan Product used for the Scan","pattern":"^[a-zA-Z0-9_-]{22}$"},"productName":{"type":"string","description":"The machine name of the Scan Product (scanner), e.g. snyk. Optional; populated by endpoints that join the product table."},"productPrettyName":{"type":"string","description":"The human-readable display name of the Scan Product (scanner), e.g. Snyk. Optional; populated by endpoints that join the product table."},"projectId":{"type":"string","description":"Harness Project ID","pattern":"^[A-Za-z_][A-Za-z0-9_]*$","maxLength":128},"refinementVersion":{"type":"string","description":"The Issue refinement version used for this Scan"},"scannerDiffKey":{"type":"string","description":"Key used to differentiate scanner configurations for scan comparison (e.g. sast, sca, sast_sca)"},"stageId":{"type":"string","description":"Pipeline Stage ID associated with the Scan","pattern":"^[A-Za-z_][A-Za-z0-9_]*$","maxLength":128},"status":{"type":"string","description":"Current status of the Scan","enum":["Pending","Running","Succeeded","Failed"]},"stepId":{"type":"string","description":"Pipeline Step ID associated with the Scan","pattern":"^[A-Za-z_][A-Za-z0-9_]*$","maxLength":128},"subproduct":{"type":"string","description":"The Scan Subproduct used for the Scan","format":"binary"},"targetVariantId":{"type":"string","description":"The Target Variant associated with the Scan","pattern":"^[a-zA-Z0-9_-]{22}$"}},"required":["targetVariantId","orgId","projectId","pipelineId","executionId","stageId","stepId","productId","status","refinementVersion","created","lastModified"]},"GitMetadata":{"type":"object","properties":{"commit":{"type":"string","description":"Git Commit SHA scanned"},"detectedName":{"type":"string","description":"Detected Name"},"detectedVariant":{"type":"string","description":"Detected Variant"},"droneCorrelated":{"type":"boolean","description":"Drone Correlated"},"provider":{"type":"string","description":"Git Provider"},"pullRequestNumber":{"type":"integer","description":"Git Pull Request Number","format":"int64"},"repositoryHttp":{"type":"string","description":"Git HTTP Repository"},"repositoryPath":{"type":"array","items":{"type":"string"},"description":"Git Repository Path"},"repositorySsh":{"type":"string","description":"Git SSH Repository"},"sourceBranch":{"type":"string","description":"Git Source Branch"},"targetBranch":{"type":"string","description":"Git Target Branch"},"workspace":{"type":"string","description":"Git Workspace Root"}},"description":"Git Metadata associated with the Scan"},"ScanMetadata":{"type":"object","properties":{"appId":{"type":"string","description":"Application identifier assigned by the scanner"},"appName":{"type":"string","description":"Application name used by the scanner"},"applicationName":{"type":"string","description":"Application name used by the scanner"},"artifactSource":{"type":"string","description":"Artifact source for container scans. Pipeline container_type is authoritative unless it equals docker_v2; docker_v2 may be refined from registryUrl to harness, aws_ecr, google, azure, github, docker_hub, or jfrog_artifactory. Unknown docker_v2 registry remains docker_v2."},"artifactUrl":{"type":"string","description":"Exact container image scanned, including its tag or digest"},"baseImageDigest":{"type":"string","description":"Digest of the base image"},"baseImageName":{"type":"string","description":"Name of the base image"},"baseImageTag":{"type":"string","description":"Tag of the base image"},"buildId":{"type":"string","description":"CI build/sequence id for the run that produced this scan (Harness HARNESS_BUILD_ID / <+pipeline.sequenceId>; non-Harness BUILD_ID). Not a product/scanner build id.","maxLength":128},"deduplicatedCount":{"type":"integer","description":"Total number of deduplicated issues found in the scan","format":"int32"},"executionSource":{"type":"string","description":"CI/CD platform that ran the scan (harness, jenkins, github_actions, gitlab_ci, ...)"},"executionUrl":{"type":"string","description":"URL of the CI execution from scan metadata (Jenkins/GHA BUILD_URL). For Harness, FE constructs the URL from pipelineId, executionId, and org/project when this is empty."},"honorGracePeriod":{"type":"boolean","description":"Honor vendor-issued grace period when bucketing issue counts (Prisma/Twistlock only)"},"imageBuildMetadata":{"$ref":"#/components/schemas/ImageBuildMetadata"},"imageDomain":{"type":"string","description":"Domain of the container image registry"},"imageName":{"type":"string","description":"Name of the container image"},"imageTag":{"type":"string","description":"Tag of the container image"},"ingestToolSeverityFlag":{"type":"boolean","description":"Scan ran with ingest_tool_severity enabled in the pipeline"},"normalizedCount":{"type":"integer","description":"Total number of normalized issues found in the scan","format":"int32"},"polyglotScanId":{"type":"string","description":"ShiftLeft/Qwiet polyglot scan ID for SCA package lookups"},"projectId":{"type":"string","description":"Project identifier assigned by the scanner"},"projectKey":{"type":"string","description":"Project key used by the scanner"},"projectName":{"type":"string","description":"Project name used by the scanner"},"publicId":{"type":"string","description":"Public application identifier assigned by the scanner"},"registryUrl":{"type":"string","description":"OCI pull base of the container image without a tag or digest"},"scanConfig":{"type":"string","description":"Scan configuration selected for this scan (e.g. default, oss, code, iac)"},"scannerConsoleUrl":{"type":"string","description":"URL to view scan results in the scanner's console"},"triggeredBy":{"type":"string","description":"Actor that triggered this scan. For PAT ingest, sto-core fills this from the token owner (NG username/email) when the plugin omits it. Harness pipeline runs are filled from pipeline-service instead.","maxLength":256}},"description":"Metadata specific to the entity being scanned"},"ImageBuildMetadata":{"type":"object","properties":{"dockerfilePath":{"type":"string","description":"Repository-relative Dockerfile path (io.harness.image.dockerfile)"},"repoUrl":{"type":"string","description":"Source repository HTTPS URL (org.opencontainers.image.source)"},"sourceBranch":{"type":"string","description":"Exact non-tag ref the image build ran on (io.harness.image.source.branch) — the image's build branch, not the branch the scan ran on"}},"description":"Self-asserted build metadata read off the scanned image's config labels; lookup hints, not proof of the build revision"},"Scan":{"type":"object","properties":{"codeCoverage":{"type":"number","description":"The Code Coverage value for the Scan","format":"float"},"created":{"type":"integer","description":"Unix timestamp at which the resource was created","format":"int64"},"executionId":{"type":"string","description":"Pipeline Execution ID associated with the Scan","pattern":"^[a-zA-Z0-9_-]{22}$"},"gitMetadata":{"$ref":"#/components/schemas/GitMetadata"},"id":{"type":"string","description":"Resource identifier","pattern":"^[a-zA-Z0-9_-]{22}$"},"lastModified":{"type":"integer","description":"Unix timestamp at which the resource was most recently modified","format":"int64"},"metadata":{"$ref":"#/components/schemas/ScanMetadata"},"orgId":{"type":"string","description":"Harness Organization ID","pattern":"^[A-Za-z_][A-Za-z0-9_]*$","maxLength":128},"pipelineId":{"type":"string","description":"Harness Organization ID","pattern":"^[A-Za-z_][A-Za-z0-9_]*$","maxLength":128},"productId":{"type":"string","description":"The Scan Product used for the Scan","pattern":"^[a-zA-Z0-9_-]{22}$"},"productName":{"type":"string","description":"The machine name of the Scan Product (scanner), e.g. snyk. Optional; populated by endpoints that join the product table."},"productPrettyName":{"type":"string","description":"The human-readable display name of the Scan Product (scanner), e.g. Snyk. Optional; populated by endpoints that join the product table."},"projectId":{"type":"string","description":"Harness Project ID","pattern":"^[A-Za-z_][A-Za-z0-9_]*$","maxLength":128},"refinementVersion":{"type":"string","description":"The Issue refinement version used for this Scan"},"scannerDiffKey":{"type":"string","description":"Key used to differentiate scanner configurations for scan comparison (e.g. sast, sca, sast_sca)"},"stageId":{"type":"string","description":"Pipeline Stage ID associated with the Scan","pattern":"^[A-Za-z_][A-Za-z0-9_]*$","maxLength":128},"status":{"type":"string","description":"Current status of the Scan","enum":["Pending","Running","Succeeded","Failed"]},"stepId":{"type":"string","description":"Pipeline Step ID associated with the Scan","pattern":"^[A-Za-z_][A-Za-z0-9_]*$","maxLength":128},"subproduct":{"type":"string","description":"The Scan Subproduct used for the Scan","format":"binary"},"targetVariantId":{"type":"string","description":"The Target Variant associated with the Scan","pattern":"^[a-zA-Z0-9_-]{22}$"}},"description":"Information about a Security Test Scan","required":["targetVariantId","orgId","projectId","pipelineId","executionId","stageId","stepId","productId","status","refinementVersion","id","created","lastModified"]},"NotFound":{"type":"object","properties":{"message":{"type":"string"},"status":{"type":"integer","default":404,"format":"int64"}},"required":["message"]}}},"paths":{"/api/v2/scans/{id}":{"put":{"tags":["Scans"],"description":"Update an existing Security Test Scan","operationId":"Scans#UpdateScan","parameters":[{"name":"accountId","in":"query","description":"Harness Account ID","allowEmptyValue":true,"required":true,"schema":{"type":"string","description":"Harness Account ID","pattern":"^[a-zA-Z0-9_-]{22}$"}},{"name":"id","in":"path","description":"The ID of the Security Test Scan to update","required":true,"schema":{"type":"string","description":"The ID of the Security Test Scan to update","pattern":"^[a-zA-Z0-9_-]{22}$"}},{"name":"X-Api-Key","in":"header","description":"Harness personal or service access token","allowEmptyValue":true,"schema":{"type":"string","description":"Harness personal or service access token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateScanRequestBody"}}}},"responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Scan"}}}},"400":{"description":"BadRequest: Bad Request response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"401":{"description":"Unauthorized: Unauthorized response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"403":{"description":"Forbidden: Forbidden response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"404":{"description":"NotFound: Not Found response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"429":{"description":"TooManyRequests: Too Many Requests response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"500":{"description":"InternalServerError: Internal Server Error response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}}}}}}}
```

## GET /api/v2/scans/{id}/issue/{issueId}

> Returns a scan specific issue

```json
{"openapi":"3.0.3","info":{"title":"Harness Security Test Orchestration API","version":"1.0.0"},"tags":[{"name":"Scans","description":"Access and modify Security Test Scans"}],"servers":[{"url":"https://app.harness.io/gateway/sto"},{"url":"http://127.0.0.1:4000"}],"security":[{"X-Api-Key_header_X-Api-Key":[],"jwt_header_Authorization":["sto_issue_view"]}],"components":{"securitySchemes":{"X-Api-Key_header_X-Api-Key":{"type":"apiKey","name":"X-Api-Key","in":"header"},"jwt_header_Authorization":{"type":"http","scheme":"bearer"}},"schemas":{"ScansScanIssueResponseBody":{"$ref":"#/components/schemas/IssueInScan"},"IssueInScan":{"type":"object","properties":{"aiTriaged":{"type":"string","description":"Aggregate AI triage verdict. 'LikelyFP' if every occurrence is FALSE_POSITIVE; 'LikelyTP' if any is TRUE_POSITIVE; 'NotEvaluatedYet' if only some are triaged. Field is absent when no occurrence has been triaged yet.","enum":["LikelyFP","LikelyTP","NotEvaluatedYet"]},"aiTriagedReasoning":{"type":"string","description":"Representative LLM reasoning quoted from one of the per-occurrence triaged verdicts (FP-verdict reasoning preferred). Field is absent when no occurrence has been triaged yet."},"baseImageName":{"type":"string","description":"base image name of the issue"},"baseImageOrgId":{"type":"string","description":"org id of the issue from where the base image is being referred"},"baseImageProjectId":{"type":"string","description":"project id of the issue from where the base image is being referred"},"baselineVariantId":{"type":"string","description":"The Baseline Target Variant related to this Security Issue","pattern":"^[a-zA-Z0-9_-]{22}$"},"created":{"type":"integer","description":"Unix timestamp at which the resource was created","format":"int64"},"currentStatus":{"type":"string","description":"Current status of the Exemption","enum":["Pending","Approved","Rejected","Expired"]},"details":{"type":"object","description":"Issue details common to all occurrences","additionalProperties":true},"epssLastModified":{"type":"string","description":"Last date the issue EPSS data was last modified"},"epssPercentile":{"type":"number","description":"EPSS percentile of the issue CVE identifier","format":"double"},"epssScore":{"type":"number","description":"EPSS score of the issue CVE identifier","format":"double"},"exemptionCoverage":{"type":"string","description":"Indicates if the Security Issue was found to be Exempted or PartiallyExempted."},"exemptionId":{"type":"string","description":"ID of Security Test Exemption","pattern":"^[a-zA-Z0-9_-]{22}$"},"exemptionStatusAtScan":{"type":"string","description":"Exemption's status at the Security Scan created time","enum":["Pending","Approved","Rejected","Expired"]},"exploitability":{"type":"string","description":"Exploitability status of the issue (yes or no)"},"fallbackSeverityCode":{"type":"string","description":"Issue-table severity code used as occurrence fallback at read time; omitted from API responses","enum":["Critical","High","Medium","Low","Info","Unassigned"]},"gitMetadata":{"$ref":"#/components/schemas/GitMetadata"},"gracePeriodDays":{"type":"integer","description":"Issue-level grace period rollup in days. Only populated when scan honorGracePeriod is enabled.","format":"int64"},"harnessAugmentation":{"type":"object","description":"Harness Augmentation details","additionalProperties":true},"hasRules":{"type":"boolean","description":"Whether the account has at least one exemption rule. When false, clients can skip exemption rule evaluation (no rule-eval loaders)."},"id":{"type":"string","description":"Resource identifier","pattern":"^[a-zA-Z0-9_-]{22}$"},"inGrace":{"type":"boolean","description":"True when the displayed severity is grace-sheltered: at the display-max severity band, all non-exempt occurrences are in grace. Only populated when scan honorGracePeriod is enabled."},"key":{"type":"string","description":"Compression/deduplication key","maxLength":512},"lastBaseImageScanAt":{"type":"integer","description":"last scan timestamp of the base image being referred","format":"int64"},"numNonExemptedOccurrences":{"type":"integer","description":"Indicates the number of Occurrences which dont have an active exemption on the Occurrence","default":0,"format":"int32"},"numOccurrences":{"type":"integer","description":"Indicates the number of Occurrences on the Issue","format":"int32"},"occurrenceId":{"type":"integer","format":"int64","minimum":1},"occurrences":{"type":"array","items":{"type":"object","additionalProperties":true},"description":"Array of details unique to each occurrence"},"occurrencesPagination":{"$ref":"#/components/schemas/Pagination"},"originStatus":{"type":"string","description":"The status of the origin, either 'approved' or 'unapproved'"},"origins":{"type":"array","items":{"type":"string"},"description":"The origins of the issue"},"overrides":{"type":"array","items":{"$ref":"#/components/schemas/OverrideResult"},"description":"List of issue overrides"},"overridesAtScan":{"type":"array","items":{"$ref":"#/components/schemas/OverrideResult"},"description":"List of issue overrides at scan time"},"pipelineId":{"type":"string","description":"Harness Pipeline ID","pattern":"^[A-Za-z_][A-Za-z0-9_]*$","maxLength":128},"primaryOccurrenceId":{"type":"integer","description":"The primary occurrence's ID","format":"int64"},"productId":{"type":"string","description":"The scan tool that identified this Security Issue","pattern":"^[a-zA-Z0-9_-]{22}$"},"reachability":{"type":"string","description":"Reachability status of the issue (reachable or unreachable)"},"recentActivities":{"type":"array","items":{"$ref":"#/components/schemas/ExemptionRecentActivity"},"description":"Up to 3 most recent exemption history events for this issue, newest first"},"remediationAgentPullRequests":{"type":"array","items":{"$ref":"#/components/schemas/RemediationAgentActivity"},"description":"Unique rem-agent PRs for this issue in this scan (from issue_augmentation.pr_metadata where remediation_agent_summary_id is set). Deduped by PR URL across occurrences. Ordered by creation time descending (newest first)."},"severity":{"type":"number","description":"Numeric severity, from 0 (lowest) to 10 (highest)","format":"float"},"severityCode":{"type":"string","description":"Severity code","enum":["Critical","High","Medium","Low","Info","Unassigned"]},"status":{"type":"string","description":"Indicates if the Security Issue was found to be remediated, ignored, etc.","enum":["Remediated","Compensating Controls","Acceptable Use","Acceptable Risk","False Positive","Fix Unavailable","Exempted"]},"subproduct":{"type":"string","description":"The subproduct that identified this Security Issue"},"targetId":{"type":"string","description":"The Target that this Security Issue affects","pattern":"^[a-zA-Z0-9_-]{22}$"},"targetName":{"type":"string","description":"The Name of the Target that this Security Issue affects","pattern":"^[a-zA-Z0-9_-]{22}$"},"targetType":{"type":"string","description":"The type of the Target that this Security Issue affects","enum":["container","repository","instance","configuration"]},"targetVariantId":{"type":"string","description":"The Target Variant that this Security Issue affects","pattern":"^[a-zA-Z0-9_-]{22}$"},"targetVariantName":{"type":"string","description":"Name of the associated Target and Variant","pattern":"^[a-zA-Z0-9_-]{22}$"},"title":{"type":"string","description":"Title of the Security Issue","maxLength":128},"type":{"type":"string","description":"The type of vulnerability or quality issue for this Issue","enum":["SAST","DAST","SCA","IAC","SECRET","MISCONFIG","BUG_SMELLS","CODE_SMELLS","CODE_COVERAGE","EXTERNAL_POLICY"]}},"required":["primaryOccurrenceId","occurrencesPagination","numOccurrences","numNonExemptedOccurrences","hasRules","title","key","severity","severityCode","productId","details","id","created"]},"GitMetadata":{"type":"object","properties":{"commit":{"type":"string","description":"Git Commit SHA scanned"},"detectedName":{"type":"string","description":"Detected Name"},"detectedVariant":{"type":"string","description":"Detected Variant"},"droneCorrelated":{"type":"boolean","description":"Drone Correlated"},"provider":{"type":"string","description":"Git Provider"},"pullRequestNumber":{"type":"integer","description":"Git Pull Request Number","format":"int64"},"repositoryHttp":{"type":"string","description":"Git HTTP Repository"},"repositoryPath":{"type":"array","items":{"type":"string"},"description":"Git Repository Path"},"repositorySsh":{"type":"string","description":"Git SSH Repository"},"sourceBranch":{"type":"string","description":"Git Source Branch"},"targetBranch":{"type":"string","description":"Git Target Branch"},"workspace":{"type":"string","description":"Git Workspace Root"}},"description":"Git Metadata associated with the Scan"},"Pagination":{"type":"object","properties":{"link":{"type":"string","description":"Link-based paging"},"page":{"type":"integer","description":"Page number (starting from 0)","format":"int64"},"pageSize":{"type":"integer","description":"Requested page size","format":"int64"},"totalItems":{"type":"integer","description":"Total results available","format":"int64"},"totalPages":{"type":"integer","description":"Total pages available","format":"int64"}},"required":["page","pageSize","totalPages","totalItems"]},"OverrideResult":{"type":"object","properties":{"created":{"type":"integer","description":"Unix timestamp at which the resource was created","format":"int64"},"fieldName":{"type":"string","description":"Name of the field that is being overridden"},"impactedTargetId":{"type":"string","description":"ID of the impacted target"},"originalFieldValue":{"type":"string","description":"Original value of the field that is being overridden"},"overrideFieldValue":{"type":"string","description":"Value of the field that is being overridden","maxLength":1024},"overrideId":{"type":"string","description":"Override Id of the override"},"reason":{"type":"string","description":"Text describing why this override is necessary","maxLength":1024},"requesterEmail":{"type":"string","description":"Email of the user who requested this Exemption"},"requesterId":{"type":"string","description":"User ID of the user who requested the override"},"requesterName":{"type":"string","description":"Name of the user who requested this Exemption"}},"required":["fieldName","originalFieldValue","overrideFieldValue","reason","created"]},"ExemptionRecentActivity":{"type":"object","properties":{"actorName":{"type":"string","description":"Display name of commenter. Omitted for auto-expiry."},"created":{"type":"integer","description":"Unix timestamp (seconds)","format":"int64"},"id":{"type":"string","description":"exemption_history.id — pass to Exemption Log drawer as selectedEventId","pattern":"^[a-zA-Z0-9_-]{22}$"},"isAutoExpiry":{"type":"boolean","description":"True when status=Expired and commenter_id IS NULL","default":false},"status":{"type":"string","enum":["Pending","Approved","Rejected","Expired","Canceled"]}},"description":"Compact exemption history preview for issue detail panels","required":["id","status","created","isAutoExpiry"]},"RemediationAgentActivity":{"type":"object","properties":{"buildId":{"type":"string","description":"pr_metadata.BuildId from post-plugin"},"commits":{"type":"integer","description":"pr_metadata.CommitsCount from post-plugin","format":"int64"},"createdAt":{"type":"string","description":"RFC3339 remediation_agent_summary.created","format":"date-time"},"executionId":{"type":"string","description":"Pipeline execution id of original_scan_id (for PSI V2)","pattern":"^[a-zA-Z0-9_-]{22}$"},"fixVerified":{"type":"string","description":"Mapped validation_metadata.remediation.status","enum":["success","failure","unverified"]},"fixVerifiedPipeline":{"$ref":"#/components/schemas/RemediationPipelineRef"},"id":{"type":"string","description":"remediation_agent_summary.internal_id as string (remAgentSummaryId)"},"jiraTicketId":{"type":"string"},"jiraTicketUrl":{"type":"string"},"prNumber":{"type":"integer","format":"int64"},"prTitle":{"type":"string"},"prUrl":{"type":"string"},"regression":{"type":"string","description":"Mapped validation_metadata.build.status","enum":["success","failure","unverified"]},"regressionPipeline":{"$ref":"#/components/schemas/RemediationPipelineRef"},"repository":{"type":"string"},"scanId":{"type":"string","pattern":"^[a-zA-Z0-9_-]{22}$"},"sourceBranch":{"type":"string"},"status":{"type":"string","description":"PR status for View Remediations (Open|Merged|Closed; synced by background task into pr_metadata)","enum":["Open","Merged","Closed"]},"targetBranch":{"type":"string"}},"description":"One remediation-agent PR activity for the View Remediations drawer","required":["id","scanId","executionId","repository","prNumber","prTitle","prUrl","status","commits","sourceBranch","targetBranch","buildId","createdAt","fixVerified","regression"]},"RemediationPipelineRef":{"type":"object","properties":{"executionId":{"type":"string","pattern":"^[a-zA-Z0-9_-]{22}$"},"orgId":{"type":"string"},"pipelineId":{"type":"string"},"projectId":{"type":"string"}},"description":"Harness pipeline execution coordinates so the FE can build an execution URL"},"NotFound":{"type":"object","properties":{"message":{"type":"string"},"status":{"type":"integer","default":404,"format":"int64"}},"required":["message"]}}},"paths":{"/api/v2/scans/{id}/issue/{issueId}":{"get":{"tags":["Scans"],"description":"Returns a scan specific issue","operationId":"Scans#ScanIssue","parameters":[{"name":"accountId","in":"query","description":"Harness Account ID","allowEmptyValue":true,"required":true,"schema":{"type":"string","description":"Harness Account ID","pattern":"^[a-zA-Z0-9_-]{22}$"}},{"name":"orgId","in":"query","description":"Harness Organization ID","allowEmptyValue":true,"schema":{"type":"string","description":"Harness Organization ID","pattern":"^[A-Za-z_][A-Za-z0-9_]*$","maxLength":128}},{"name":"projectId","in":"query","description":"Harness Project ID","allowEmptyValue":true,"schema":{"type":"string","description":"Harness Project ID","pattern":"^[A-Za-z_][A-Za-z0-9_]*$","maxLength":128}},{"name":"page","in":"query","description":"Page number to fetch (starting from 0)","allowEmptyValue":true,"schema":{"type":"integer","description":"Page number to fetch (starting from 0)","default":0,"format":"int64","minimum":0}},{"name":"pageSize","in":"query","description":"Number of results per page","allowEmptyValue":true,"schema":{"type":"integer","description":"Number of results per page","default":30,"format":"int64","minimum":1,"maximum":100}},{"name":"sort","in":"query","description":"The field to sort by","allowEmptyValue":true,"schema":{"type":"string","description":"The field to sort by"}},{"name":"order","in":"query","description":"The order to sort by","allowEmptyValue":true,"schema":{"type":"string","description":"The order to sort by","enum":["ASC","DESC"]}},{"name":"id","in":"path","description":"The ID of the Security Test Scan","required":true,"schema":{"type":"string","description":"The ID of the Security Test Scan"}},{"name":"issueId","in":"path","description":"The ID of the Security Test Issue","required":true,"schema":{"type":"string","description":"The ID of the Security Test Issue"}},{"name":"X-Api-Key","in":"header","description":"Harness personal or service access token","allowEmptyValue":true,"schema":{"type":"string","description":"Harness personal or service access token"}}],"responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScansScanIssueResponseBody"}}}},"400":{"description":"BadRequest: Bad Request response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"401":{"description":"Unauthorized: Unauthorized response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"403":{"description":"Forbidden: Forbidden response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"404":{"description":"NotFound: Not Found response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"429":{"description":"TooManyRequests: Too Many Requests response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"500":{"description":"InternalServerError: Internal Server Error response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}}}}}}}
```

## GET /api/v2/scans/{id}/issue/{issueId}/occurrences

> Returns occurrences for a scan specific issue

```json
{"openapi":"3.0.3","info":{"title":"Harness Security Test Orchestration API","version":"1.0.0"},"tags":[{"name":"Scans","description":"Access and modify Security Test Scans"}],"servers":[{"url":"https://app.harness.io/gateway/sto"},{"url":"http://127.0.0.1:4000"}],"security":[{"X-Api-Key_header_X-Api-Key":[],"jwt_header_Authorization":["sto_issue_view"]}],"components":{"securitySchemes":{"X-Api-Key_header_X-Api-Key":{"type":"apiKey","name":"X-Api-Key","in":"header"},"jwt_header_Authorization":{"type":"http","scheme":"bearer"}},"schemas":{"ScansScanIssueResponseBody":{"$ref":"#/components/schemas/IssueInScan"},"IssueInScan":{"type":"object","properties":{"aiTriaged":{"type":"string","description":"Aggregate AI triage verdict. 'LikelyFP' if every occurrence is FALSE_POSITIVE; 'LikelyTP' if any is TRUE_POSITIVE; 'NotEvaluatedYet' if only some are triaged. Field is absent when no occurrence has been triaged yet.","enum":["LikelyFP","LikelyTP","NotEvaluatedYet"]},"aiTriagedReasoning":{"type":"string","description":"Representative LLM reasoning quoted from one of the per-occurrence triaged verdicts (FP-verdict reasoning preferred). Field is absent when no occurrence has been triaged yet."},"baseImageName":{"type":"string","description":"base image name of the issue"},"baseImageOrgId":{"type":"string","description":"org id of the issue from where the base image is being referred"},"baseImageProjectId":{"type":"string","description":"project id of the issue from where the base image is being referred"},"baselineVariantId":{"type":"string","description":"The Baseline Target Variant related to this Security Issue","pattern":"^[a-zA-Z0-9_-]{22}$"},"created":{"type":"integer","description":"Unix timestamp at which the resource was created","format":"int64"},"currentStatus":{"type":"string","description":"Current status of the Exemption","enum":["Pending","Approved","Rejected","Expired"]},"details":{"type":"object","description":"Issue details common to all occurrences","additionalProperties":true},"epssLastModified":{"type":"string","description":"Last date the issue EPSS data was last modified"},"epssPercentile":{"type":"number","description":"EPSS percentile of the issue CVE identifier","format":"double"},"epssScore":{"type":"number","description":"EPSS score of the issue CVE identifier","format":"double"},"exemptionCoverage":{"type":"string","description":"Indicates if the Security Issue was found to be Exempted or PartiallyExempted."},"exemptionId":{"type":"string","description":"ID of Security Test Exemption","pattern":"^[a-zA-Z0-9_-]{22}$"},"exemptionStatusAtScan":{"type":"string","description":"Exemption's status at the Security Scan created time","enum":["Pending","Approved","Rejected","Expired"]},"exploitability":{"type":"string","description":"Exploitability status of the issue (yes or no)"},"fallbackSeverityCode":{"type":"string","description":"Issue-table severity code used as occurrence fallback at read time; omitted from API responses","enum":["Critical","High","Medium","Low","Info","Unassigned"]},"gitMetadata":{"$ref":"#/components/schemas/GitMetadata"},"gracePeriodDays":{"type":"integer","description":"Issue-level grace period rollup in days. Only populated when scan honorGracePeriod is enabled.","format":"int64"},"harnessAugmentation":{"type":"object","description":"Harness Augmentation details","additionalProperties":true},"hasRules":{"type":"boolean","description":"Whether the account has at least one exemption rule. When false, clients can skip exemption rule evaluation (no rule-eval loaders)."},"id":{"type":"string","description":"Resource identifier","pattern":"^[a-zA-Z0-9_-]{22}$"},"inGrace":{"type":"boolean","description":"True when the displayed severity is grace-sheltered: at the display-max severity band, all non-exempt occurrences are in grace. Only populated when scan honorGracePeriod is enabled."},"key":{"type":"string","description":"Compression/deduplication key","maxLength":512},"lastBaseImageScanAt":{"type":"integer","description":"last scan timestamp of the base image being referred","format":"int64"},"numNonExemptedOccurrences":{"type":"integer","description":"Indicates the number of Occurrences which dont have an active exemption on the Occurrence","default":0,"format":"int32"},"numOccurrences":{"type":"integer","description":"Indicates the number of Occurrences on the Issue","format":"int32"},"occurrenceId":{"type":"integer","format":"int64","minimum":1},"occurrences":{"type":"array","items":{"type":"object","additionalProperties":true},"description":"Array of details unique to each occurrence"},"occurrencesPagination":{"$ref":"#/components/schemas/Pagination"},"originStatus":{"type":"string","description":"The status of the origin, either 'approved' or 'unapproved'"},"origins":{"type":"array","items":{"type":"string"},"description":"The origins of the issue"},"overrides":{"type":"array","items":{"$ref":"#/components/schemas/OverrideResult"},"description":"List of issue overrides"},"overridesAtScan":{"type":"array","items":{"$ref":"#/components/schemas/OverrideResult"},"description":"List of issue overrides at scan time"},"pipelineId":{"type":"string","description":"Harness Pipeline ID","pattern":"^[A-Za-z_][A-Za-z0-9_]*$","maxLength":128},"primaryOccurrenceId":{"type":"integer","description":"The primary occurrence's ID","format":"int64"},"productId":{"type":"string","description":"The scan tool that identified this Security Issue","pattern":"^[a-zA-Z0-9_-]{22}$"},"reachability":{"type":"string","description":"Reachability status of the issue (reachable or unreachable)"},"recentActivities":{"type":"array","items":{"$ref":"#/components/schemas/ExemptionRecentActivity"},"description":"Up to 3 most recent exemption history events for this issue, newest first"},"remediationAgentPullRequests":{"type":"array","items":{"$ref":"#/components/schemas/RemediationAgentActivity"},"description":"Unique rem-agent PRs for this issue in this scan (from issue_augmentation.pr_metadata where remediation_agent_summary_id is set). Deduped by PR URL across occurrences. Ordered by creation time descending (newest first)."},"severity":{"type":"number","description":"Numeric severity, from 0 (lowest) to 10 (highest)","format":"float"},"severityCode":{"type":"string","description":"Severity code","enum":["Critical","High","Medium","Low","Info","Unassigned"]},"status":{"type":"string","description":"Indicates if the Security Issue was found to be remediated, ignored, etc.","enum":["Remediated","Compensating Controls","Acceptable Use","Acceptable Risk","False Positive","Fix Unavailable","Exempted"]},"subproduct":{"type":"string","description":"The subproduct that identified this Security Issue"},"targetId":{"type":"string","description":"The Target that this Security Issue affects","pattern":"^[a-zA-Z0-9_-]{22}$"},"targetName":{"type":"string","description":"The Name of the Target that this Security Issue affects","pattern":"^[a-zA-Z0-9_-]{22}$"},"targetType":{"type":"string","description":"The type of the Target that this Security Issue affects","enum":["container","repository","instance","configuration"]},"targetVariantId":{"type":"string","description":"The Target Variant that this Security Issue affects","pattern":"^[a-zA-Z0-9_-]{22}$"},"targetVariantName":{"type":"string","description":"Name of the associated Target and Variant","pattern":"^[a-zA-Z0-9_-]{22}$"},"title":{"type":"string","description":"Title of the Security Issue","maxLength":128},"type":{"type":"string","description":"The type of vulnerability or quality issue for this Issue","enum":["SAST","DAST","SCA","IAC","SECRET","MISCONFIG","BUG_SMELLS","CODE_SMELLS","CODE_COVERAGE","EXTERNAL_POLICY"]}},"required":["primaryOccurrenceId","occurrencesPagination","numOccurrences","numNonExemptedOccurrences","hasRules","title","key","severity","severityCode","productId","details","id","created"]},"GitMetadata":{"type":"object","properties":{"commit":{"type":"string","description":"Git Commit SHA scanned"},"detectedName":{"type":"string","description":"Detected Name"},"detectedVariant":{"type":"string","description":"Detected Variant"},"droneCorrelated":{"type":"boolean","description":"Drone Correlated"},"provider":{"type":"string","description":"Git Provider"},"pullRequestNumber":{"type":"integer","description":"Git Pull Request Number","format":"int64"},"repositoryHttp":{"type":"string","description":"Git HTTP Repository"},"repositoryPath":{"type":"array","items":{"type":"string"},"description":"Git Repository Path"},"repositorySsh":{"type":"string","description":"Git SSH Repository"},"sourceBranch":{"type":"string","description":"Git Source Branch"},"targetBranch":{"type":"string","description":"Git Target Branch"},"workspace":{"type":"string","description":"Git Workspace Root"}},"description":"Git Metadata associated with the Scan"},"Pagination":{"type":"object","properties":{"link":{"type":"string","description":"Link-based paging"},"page":{"type":"integer","description":"Page number (starting from 0)","format":"int64"},"pageSize":{"type":"integer","description":"Requested page size","format":"int64"},"totalItems":{"type":"integer","description":"Total results available","format":"int64"},"totalPages":{"type":"integer","description":"Total pages available","format":"int64"}},"required":["page","pageSize","totalPages","totalItems"]},"OverrideResult":{"type":"object","properties":{"created":{"type":"integer","description":"Unix timestamp at which the resource was created","format":"int64"},"fieldName":{"type":"string","description":"Name of the field that is being overridden"},"impactedTargetId":{"type":"string","description":"ID of the impacted target"},"originalFieldValue":{"type":"string","description":"Original value of the field that is being overridden"},"overrideFieldValue":{"type":"string","description":"Value of the field that is being overridden","maxLength":1024},"overrideId":{"type":"string","description":"Override Id of the override"},"reason":{"type":"string","description":"Text describing why this override is necessary","maxLength":1024},"requesterEmail":{"type":"string","description":"Email of the user who requested this Exemption"},"requesterId":{"type":"string","description":"User ID of the user who requested the override"},"requesterName":{"type":"string","description":"Name of the user who requested this Exemption"}},"required":["fieldName","originalFieldValue","overrideFieldValue","reason","created"]},"ExemptionRecentActivity":{"type":"object","properties":{"actorName":{"type":"string","description":"Display name of commenter. Omitted for auto-expiry."},"created":{"type":"integer","description":"Unix timestamp (seconds)","format":"int64"},"id":{"type":"string","description":"exemption_history.id — pass to Exemption Log drawer as selectedEventId","pattern":"^[a-zA-Z0-9_-]{22}$"},"isAutoExpiry":{"type":"boolean","description":"True when status=Expired and commenter_id IS NULL","default":false},"status":{"type":"string","enum":["Pending","Approved","Rejected","Expired","Canceled"]}},"description":"Compact exemption history preview for issue detail panels","required":["id","status","created","isAutoExpiry"]},"RemediationAgentActivity":{"type":"object","properties":{"buildId":{"type":"string","description":"pr_metadata.BuildId from post-plugin"},"commits":{"type":"integer","description":"pr_metadata.CommitsCount from post-plugin","format":"int64"},"createdAt":{"type":"string","description":"RFC3339 remediation_agent_summary.created","format":"date-time"},"executionId":{"type":"string","description":"Pipeline execution id of original_scan_id (for PSI V2)","pattern":"^[a-zA-Z0-9_-]{22}$"},"fixVerified":{"type":"string","description":"Mapped validation_metadata.remediation.status","enum":["success","failure","unverified"]},"fixVerifiedPipeline":{"$ref":"#/components/schemas/RemediationPipelineRef"},"id":{"type":"string","description":"remediation_agent_summary.internal_id as string (remAgentSummaryId)"},"jiraTicketId":{"type":"string"},"jiraTicketUrl":{"type":"string"},"prNumber":{"type":"integer","format":"int64"},"prTitle":{"type":"string"},"prUrl":{"type":"string"},"regression":{"type":"string","description":"Mapped validation_metadata.build.status","enum":["success","failure","unverified"]},"regressionPipeline":{"$ref":"#/components/schemas/RemediationPipelineRef"},"repository":{"type":"string"},"scanId":{"type":"string","pattern":"^[a-zA-Z0-9_-]{22}$"},"sourceBranch":{"type":"string"},"status":{"type":"string","description":"PR status for View Remediations (Open|Merged|Closed; synced by background task into pr_metadata)","enum":["Open","Merged","Closed"]},"targetBranch":{"type":"string"}},"description":"One remediation-agent PR activity for the View Remediations drawer","required":["id","scanId","executionId","repository","prNumber","prTitle","prUrl","status","commits","sourceBranch","targetBranch","buildId","createdAt","fixVerified","regression"]},"RemediationPipelineRef":{"type":"object","properties":{"executionId":{"type":"string","pattern":"^[a-zA-Z0-9_-]{22}$"},"orgId":{"type":"string"},"pipelineId":{"type":"string"},"projectId":{"type":"string"}},"description":"Harness pipeline execution coordinates so the FE can build an execution URL"},"NotFound":{"type":"object","properties":{"message":{"type":"string"},"status":{"type":"integer","default":404,"format":"int64"}},"required":["message"]}}},"paths":{"/api/v2/scans/{id}/issue/{issueId}/occurrences":{"get":{"tags":["Scans"],"description":"Returns occurrences for a scan specific issue","operationId":"Scans#ScanIssueOccurrences","parameters":[{"name":"accountId","in":"query","description":"Harness Account ID","allowEmptyValue":true,"required":true,"schema":{"type":"string","description":"Harness Account ID","pattern":"^[a-zA-Z0-9_-]{22}$"}},{"name":"orgId","in":"query","description":"Harness Organization ID","allowEmptyValue":true,"schema":{"type":"string","description":"Harness Organization ID","pattern":"^[A-Za-z_][A-Za-z0-9_]*$","maxLength":128}},{"name":"projectId","in":"query","description":"Harness Project ID","allowEmptyValue":true,"schema":{"type":"string","description":"Harness Project ID","pattern":"^[A-Za-z_][A-Za-z0-9_]*$","maxLength":128}},{"name":"page","in":"query","description":"Page number to fetch (starting from 0)","allowEmptyValue":true,"schema":{"type":"integer","description":"Page number to fetch (starting from 0)","default":0,"format":"int64","minimum":0}},{"name":"pageSize","in":"query","description":"Number of results per page","allowEmptyValue":true,"schema":{"type":"integer","description":"Number of results per page","default":30,"format":"int64","minimum":1,"maximum":100}},{"name":"search","in":"query","allowEmptyValue":true,"schema":{"type":"string","maxLength":256}},{"name":"exemptionStatus","in":"query","allowEmptyValue":true,"schema":{"type":"string","pattern":"^(EXEMPTED|NOT_EXEMPTED|REJECTED|PENDING)(,EXEMPTED|,NOT_EXEMPTED|,REJECTED|,PENDING)*$"}},{"name":"occurrenceId","in":"query","allowEmptyValue":true,"schema":{"type":"integer","format":"int64","minimum":1}},{"name":"sort","in":"query","description":"The field to sort by","allowEmptyValue":true,"schema":{"type":"string","description":"The field to sort by"}},{"name":"order","in":"query","description":"The order to sort by","allowEmptyValue":true,"schema":{"type":"string","description":"The order to sort by","enum":["ASC","DESC"]}},{"name":"exemptionId","in":"query","description":"ID of Security Test Exemption","allowEmptyValue":true,"schema":{"type":"string","description":"ID of Security Test Exemption","pattern":"^[a-zA-Z0-9_-]{22}$"}},{"name":"id","in":"path","description":"The ID of the Security Test Scan","required":true,"schema":{"type":"string","description":"The ID of the Security Test Scan"}},{"name":"issueId","in":"path","description":"The ID of the Security Test Issue","required":true,"schema":{"type":"string","description":"The ID of the Security Test Issue"}},{"name":"X-Api-Key","in":"header","description":"Harness personal or service access token","allowEmptyValue":true,"schema":{"type":"string","description":"Harness personal or service access token"}}],"responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScansScanIssueResponseBody"}}}},"400":{"description":"BadRequest: Bad Request response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"401":{"description":"Unauthorized: Unauthorized response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"403":{"description":"Forbidden: Forbidden response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"404":{"description":"NotFound: Not Found response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"429":{"description":"TooManyRequests: Too Many Requests response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"500":{"description":"InternalServerError: Internal Server Error response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}}}}}}}
```

## GET /api/v2/scans/{id}/issues

> List Issues by Scan ID

```json
{"openapi":"3.0.3","info":{"title":"Harness Security Test Orchestration API","version":"1.0.0"},"tags":[{"name":"Scans","description":"Access and modify Security Test Scans"}],"servers":[{"url":"https://app.harness.io/gateway/sto"},{"url":"http://127.0.0.1:4000"}],"security":[{"X-Api-Key_header_X-Api-Key":[],"jwt_header_Authorization":["sto_issue_view"]}],"components":{"securitySchemes":{"X-Api-Key_header_X-Api-Key":{"type":"apiKey","name":"X-Api-Key","in":"header"},"jwt_header_Authorization":{"type":"http","scheme":"bearer"}},"schemas":{"ScansScanIssuesResponseBody":{"$ref":"#/components/schemas/ScanIssuesResult"},"ScanIssuesResult":{"type":"object","properties":{"issues":{"type":"array","items":{"$ref":"#/components/schemas/Issue"},"description":"List of Issues"}},"description":"List of Issues","required":["issues"]},"Issue":{"type":"object","properties":{"baseImageName":{"type":"string","description":"base image name of the issue"},"baselineVariantId":{"type":"string","description":"The Baseline Target Variant related to this Security Issue","pattern":"^[a-zA-Z0-9_-]{22}$"},"created":{"type":"integer","description":"Unix timestamp at which the resource was created","format":"int64"},"currentStatus":{"type":"string","description":"Current status of the Exemption","enum":["Pending","Approved","Rejected","Expired"]},"details":{"type":"object","description":"Issue details common to all occurrences","additionalProperties":true},"epssLastModified":{"type":"string","description":"Last date the issue EPSS data was last modified"},"epssPercentile":{"type":"number","description":"EPSS percentile of the issue CVE identifier","format":"double"},"epssScore":{"type":"number","description":"EPSS score of the issue CVE identifier","format":"double"},"exemptionCoverage":{"type":"string","description":"Indicates if the Security Issue was found to be Exempted or PartiallyExempted."},"exemptionId":{"type":"string","description":"ID of Security Test Exemption","pattern":"^[a-zA-Z0-9_-]{22}$"},"exemptionStatusAtScan":{"type":"string","description":"Exemption's status at the Security Scan created time","enum":["Pending","Approved","Rejected","Expired"]},"exploitability":{"type":"string","description":"Exploitability status of the issue (yes or no)"},"fallbackSeverityCode":{"type":"string","description":"Issue-table severity code used as occurrence fallback at read time; omitted from API responses","enum":["Critical","High","Medium","Low","Info","Unassigned"]},"gracePeriodDays":{"type":"integer","description":"Issue-level grace period rollup in days. Only populated when scan honorGracePeriod is enabled.","format":"int64"},"harnessAugmentation":{"type":"object","description":"Harness Augmentation details","additionalProperties":true},"id":{"type":"string","description":"Resource identifier","pattern":"^[a-zA-Z0-9_-]{22}$"},"inGrace":{"type":"boolean","description":"True when the displayed severity is grace-sheltered: at the display-max severity band, all non-exempt occurrences are in grace. Only populated when scan honorGracePeriod is enabled."},"key":{"type":"string","description":"Compression/deduplication key","maxLength":512},"numOccurrences":{"type":"integer","description":"Indicates the number of Occurrences on the Issue","format":"int32"},"occurrenceId":{"type":"integer","format":"int64","minimum":1},"occurrences":{"type":"array","items":{"type":"object","additionalProperties":true},"description":"Array of details unique to each occurrence"},"originStatus":{"type":"string","description":"The status of the origin, either 'approved' or 'unapproved'"},"origins":{"type":"array","items":{"type":"string"},"description":"The origins of the issue"},"overrides":{"type":"array","items":{"$ref":"#/components/schemas/OverrideResult"},"description":"List of issue overrides"},"overridesAtScan":{"type":"array","items":{"$ref":"#/components/schemas/OverrideResult"},"description":"List of issue overrides at scan time"},"productId":{"type":"string","description":"The scan tool that identified this Security Issue","pattern":"^[a-zA-Z0-9_-]{22}$"},"reachability":{"type":"string","description":"Reachability status of the issue (reachable or unreachable)"},"severity":{"type":"number","description":"Numeric severity, from 0 (lowest) to 10 (highest)","format":"float"},"severityCode":{"type":"string","description":"Severity code","enum":["Critical","High","Medium","Low","Info","Unassigned"]},"status":{"type":"string","description":"Indicates if the Security Issue was found to be remediated, ignored, etc.","enum":["Remediated","Compensating Controls","Acceptable Use","Acceptable Risk","False Positive","Fix Unavailable","Exempted"]},"subproduct":{"type":"string","description":"The subproduct that identified this Security Issue"},"targetId":{"type":"string","description":"The Target that this Security Issue affects","pattern":"^[a-zA-Z0-9_-]{22}$"},"targetName":{"type":"string","description":"The Name of the Target that this Security Issue affects","pattern":"^[a-zA-Z0-9_-]{22}$"},"targetType":{"type":"string","description":"The type of the Target that this Security Issue affects","enum":["container","repository","instance","configuration"]},"targetVariantId":{"type":"string","description":"The Target Variant that this Security Issue affects","pattern":"^[a-zA-Z0-9_-]{22}$"},"targetVariantName":{"type":"string","description":"Name of the associated Target and Variant","pattern":"^[a-zA-Z0-9_-]{22}$"},"title":{"type":"string","description":"Title of the Security Issue","maxLength":128},"type":{"type":"string","description":"The type of vulnerability or quality issue for this Issue","enum":["SAST","DAST","SCA","IAC","SECRET","MISCONFIG","BUG_SMELLS","CODE_SMELLS","CODE_COVERAGE","EXTERNAL_POLICY"]}},"description":"Information about a Security Issue","required":["title","key","severity","severityCode","productId","details","id","created"]},"OverrideResult":{"type":"object","properties":{"created":{"type":"integer","description":"Unix timestamp at which the resource was created","format":"int64"},"fieldName":{"type":"string","description":"Name of the field that is being overridden"},"impactedTargetId":{"type":"string","description":"ID of the impacted target"},"originalFieldValue":{"type":"string","description":"Original value of the field that is being overridden"},"overrideFieldValue":{"type":"string","description":"Value of the field that is being overridden","maxLength":1024},"overrideId":{"type":"string","description":"Override Id of the override"},"reason":{"type":"string","description":"Text describing why this override is necessary","maxLength":1024},"requesterEmail":{"type":"string","description":"Email of the user who requested this Exemption"},"requesterId":{"type":"string","description":"User ID of the user who requested the override"},"requesterName":{"type":"string","description":"Name of the user who requested this Exemption"}},"required":["fieldName","originalFieldValue","overrideFieldValue","reason","created"]},"NotFound":{"type":"object","properties":{"message":{"type":"string"},"status":{"type":"integer","default":404,"format":"int64"}},"required":["message"]}}},"paths":{"/api/v2/scans/{id}/issues":{"get":{"tags":["Scans"],"description":"List Issues by Scan ID","operationId":"Scans#ScanIssues","parameters":[{"name":"accountId","in":"query","description":"Harness Account ID","allowEmptyValue":true,"required":true,"schema":{"type":"string","description":"Harness Account ID","pattern":"^[a-zA-Z0-9_-]{22}$"}},{"name":"exempted","in":"query","description":"Chooses whether to show exempted issues (\"only\"), or non-exempted issues (\"0\" or \"false\")","allowEmptyValue":true,"schema":{"type":"string","description":"Chooses whether to show exempted issues (\"only\"), or non-exempted issues (\"0\" or \"false\")","default":"false","enum":["false","only","0"]}},{"name":"id","in":"path","description":"The Scan ID","required":true,"schema":{"type":"string","description":"The Scan ID","pattern":"^[a-zA-Z0-9_-]{22}$"}},{"name":"X-Api-Key","in":"header","description":"Harness personal or service access token","allowEmptyValue":true,"schema":{"type":"string","description":"Harness personal or service access token"}}],"responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScansScanIssuesResponseBody"}}}},"400":{"description":"BadRequest: Bad Request response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"401":{"description":"Unauthorized: Unauthorized response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"403":{"description":"Forbidden: Forbidden response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"429":{"description":"TooManyRequests: Too Many Requests response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"500":{"description":"InternalServerError: Internal Server Error response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}}}}}}}
```

## GET /api/v2/scans/{id}/issues/counts

> Returns counts of active Security Issues for a Security Test Scan

```json
{"openapi":"3.0.3","info":{"title":"Harness Security Test Orchestration API","version":"1.0.0"},"tags":[{"name":"Scans","description":"Access and modify Security Test Scans"}],"servers":[{"url":"https://app.harness.io/gateway/sto"},{"url":"http://127.0.0.1:4000"}],"security":[{"X-Api-Key_header_X-Api-Key":[],"jwt_header_Authorization":["sto_issue_view"]}],"components":{"securitySchemes":{"X-Api-Key_header_X-Api-Key":{"type":"apiKey","name":"X-Api-Key","in":"header"},"jwt_header_Authorization":{"type":"http","scheme":"bearer"}},"schemas":{"ScansScanIssueCountsResponseBody":{"$ref":"#/components/schemas/FullIssueCounts"},"FullIssueCounts":{"type":"object","properties":{"appCritical":{"type":"integer","description":"The number of Critical-severity Issues in the App Image","format":"int32"},"appHigh":{"type":"integer","description":"The number of High-severity Issues in the App Image","format":"int32"},"appInfo":{"type":"integer","description":"The number of Informational Issues in the App Image","format":"int32"},"appLow":{"type":"integer","description":"The number of Low-severity Issues in the App Image","format":"int32"},"appMedium":{"type":"integer","description":"The number of Medium-severity Issues in the App Image","format":"int32"},"baseCritical":{"type":"integer","description":"The number of Critical-severity Issues in the Base Image","format":"int32"},"baseHigh":{"type":"integer","description":"The number of High-severity Issues in the Base Image","format":"int32"},"baseImageApproved":{"type":"boolean","description":"The approval status of the Base Image for the Scan"},"baseImageDetected":{"type":"boolean","description":"The status of the Base Image for the Scan"},"baseInfo":{"type":"integer","description":"The number of Informational Issues in the Base Image","format":"int32"},"baseLow":{"type":"integer","description":"The number of Low-severity Issues in the Base Image","format":"int32"},"baseMedium":{"type":"integer","description":"The number of Medium-severity Issues in the Base Image","format":"int32"},"codeCoverage":{"type":"number","description":"The Code Coverage value for the Scan","format":"float"},"critical":{"type":"integer","description":"The number of Critical-severity Issues","format":"int32"},"externalPolicyFailures":{"type":"integer","description":"The number of EXTERNAL_POLICY Issues","format":"int32"},"high":{"type":"integer","description":"The number of High-severity Issues","format":"int32"},"ignored":{"type":"integer","description":"The number of Issues ignored due to Exemptions, and therefore not included in other counts","format":"int32"},"ignoredCritical":{"type":"integer","description":"The number of ignored Critical-severity Issues","format":"int32"},"ignoredHigh":{"type":"integer","description":"The number of ignored High-severity Issues","format":"int32"},"ignoredInfo":{"type":"integer","description":"The number of ignored Informational Issues","format":"int32"},"ignoredLow":{"type":"integer","description":"The number of ignored Low-severity Issues","format":"int32"},"ignoredMedium":{"type":"integer","description":"The number of ignored Medium-severity Issues","format":"int32"},"ignoredUnassigned":{"type":"integer","description":"The number of Issues with no associated severity code","format":"int32"},"info":{"type":"integer","description":"The number of Informational Issues","format":"int32"},"low":{"type":"integer","description":"The number of Low-severity Issues","format":"int32"},"medium":{"type":"integer","description":"The number of Medium-severity Issues","format":"int32"},"newAppCritical":{"type":"integer","description":"The number of new Critical-severity Issues in the App Image","format":"int32"},"newAppHigh":{"type":"integer","description":"The number of new High-severity Issues in the App Image","format":"int32"},"newAppInfo":{"type":"integer","description":"The number of new Informational Issues in the App Image","format":"int32"},"newAppLow":{"type":"integer","description":"The number of new Low-severity Issues in the App Image","format":"int32"},"newAppMedium":{"type":"integer","description":"The number of new Medium-severity Issues in the App Image","format":"int32"},"newBaseCritical":{"type":"integer","description":"The number of new Critical-severity Issues in the Base Image","format":"int32"},"newBaseHigh":{"type":"integer","description":"The number of new High-severity Issues in the Base Image","format":"int32"},"newBaseInfo":{"type":"integer","description":"The number of new Informational Issues in the Base Image","format":"int32"},"newBaseLow":{"type":"integer","description":"The number of new Low-severity Issues in the Base Image","format":"int32"},"newBaseMedium":{"type":"integer","description":"The number of new Medium-severity Issues in the Base Image","format":"int32"},"newCritical":{"type":"integer","description":"The number of new Critical-severity Issues","format":"int32"},"newHigh":{"type":"integer","description":"The number of new High-severity Issues","format":"int32"},"newIgnoredCritical":{"type":"integer","description":"The number of ignored Critical-severity Issues","format":"int32"},"newIgnoredHigh":{"type":"integer","description":"The number of ignored High-severity Issues","format":"int32"},"newIgnoredInfo":{"type":"integer","description":"The number of ignored Informational Issues","format":"int32"},"newIgnoredLow":{"type":"integer","description":"The number of ignored Low-severity Issues","format":"int32"},"newIgnoredMedium":{"type":"integer","description":"The number of ignored Medium-severity Issues","format":"int32"},"newIgnoredOccurrencesCritical":{"type":"integer","description":"The number of ignored Critical-severity Occurrences","format":"int32"},"newIgnoredOccurrencesHigh":{"type":"integer","description":"The number of ignored High-severity Occurrences","format":"int32"},"newIgnoredOccurrencesInfo":{"type":"integer","description":"The number of ignored Informational Occurrences","format":"int32"},"newIgnoredOccurrencesLow":{"type":"integer","description":"The number of ignored Low-severity Occurrences","format":"int32"},"newIgnoredOccurrencesMedium":{"type":"integer","description":"The number of ignored Medium-severity Occurrences","format":"int32"},"newIgnoredOccurrencesUnassigned":{"type":"integer","description":"The number of ignored Occurrences with no associated severity code","format":"int32"},"newIgnoredUnassigned":{"type":"integer","description":"The number of Issues with no associated severity code","format":"int32"},"newInfo":{"type":"integer","description":"The number of new Informational Issues","format":"int32"},"newLow":{"type":"integer","description":"The number of new Low-severity Issues","format":"int32"},"newMedium":{"type":"integer","description":"The number of new Medium-severity Issues","format":"int32"},"newOccurrencesCritical":{"type":"integer","description":"The number of new Critical-severity Occurrences","format":"int32"},"newOccurrencesHigh":{"type":"integer","description":"The number of new High-severity Occurrences","format":"int32"},"newOccurrencesInfo":{"type":"integer","description":"The number of new Informational Occurrences","format":"int32"},"newOccurrencesLow":{"type":"integer","description":"The number of new Low-severity Occurrences","format":"int32"},"newOccurrencesMedium":{"type":"integer","description":"The number of new Medium-severity Occurrences","format":"int32"},"newOccurrencesUnassigned":{"type":"integer","description":"The number of new Occurrences with no associated severity code","format":"int32"},"newTotal":{"type":"integer","description":"The total number new Issues","format":"int32"},"newTotalBase":{"type":"integer","description":"The total number new Issues in the Base Image","format":"int32"},"newUnassigned":{"type":"integer","description":"The number of new Issues with no associated severity code","format":"int32"},"scannerConsoleUrl":{"type":"string","description":"The scanner console URL for viewing scan results"},"total":{"type":"integer","description":"The total number of Issues","format":"int32"},"totalBase":{"type":"integer","description":"The total number of Issues in the Base Image","format":"int32"},"unassigned":{"type":"integer","description":"The number of Issues with no associated severity code","format":"int32"}},"required":["newCritical","newHigh","newMedium","newLow","newInfo","unassigned","newUnassigned","externalPolicyFailures","ignored","ignoredCritical","ignoredHigh","ignoredMedium","ignoredLow","ignoredInfo","ignoredUnassigned","newIgnoredCritical","newIgnoredHigh","newIgnoredMedium","newIgnoredLow","newIgnoredInfo","newIgnoredUnassigned","newOccurrencesCritical","newOccurrencesHigh","newOccurrencesMedium","newOccurrencesLow","newOccurrencesInfo","newOccurrencesUnassigned","newIgnoredOccurrencesCritical","newIgnoredOccurrencesHigh","newIgnoredOccurrencesMedium","newIgnoredOccurrencesLow","newIgnoredOccurrencesInfo","newIgnoredOccurrencesUnassigned","total","newTotal","critical","high","medium","low","info"]},"NotFound":{"type":"object","properties":{"message":{"type":"string"},"status":{"type":"integer","default":404,"format":"int64"}},"required":["message"]}}},"paths":{"/api/v2/scans/{id}/issues/counts":{"get":{"tags":["Scans"],"description":"Returns counts of active Security Issues for a Security Test Scan","operationId":"Scans#ScanIssueCounts","parameters":[{"name":"accountId","in":"query","description":"Harness Account ID","allowEmptyValue":true,"required":true,"schema":{"type":"string","description":"Harness Account ID","pattern":"^[a-zA-Z0-9_-]{22}$"}},{"name":"orgId","in":"query","description":"Harness Organization ID","allowEmptyValue":true,"required":true,"schema":{"type":"string","description":"Harness Organization ID","pattern":"^[A-Za-z_][A-Za-z0-9_]*$","maxLength":128}},{"name":"projectId","in":"query","description":"Harness Project ID","allowEmptyValue":true,"required":true,"schema":{"type":"string","description":"Harness Project ID","pattern":"^[A-Za-z_][A-Za-z0-9_]*$","maxLength":128}},{"name":"id","in":"path","description":"The ID of the Security Test Scan for which to count issues","required":true,"schema":{"type":"string","description":"The ID of the Security Test Scan for which to count issues"}},{"name":"X-Api-Key","in":"header","description":"Harness personal or service access token","allowEmptyValue":true,"schema":{"type":"string","description":"Harness personal or service access token"}}],"responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScansScanIssueCountsResponseBody"}}}},"400":{"description":"BadRequest: Bad Request response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"401":{"description":"Unauthorized: Unauthorized response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"403":{"description":"Forbidden: Forbidden response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"404":{"description":"NotFound: Not Found response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"429":{"description":"TooManyRequests: Too Many Requests response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"500":{"description":"InternalServerError: Internal Server Error response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}}}}}}}
```

## Get Latest Scans

> Get the most recent successful scan for each product/subproduct of a target variant. A single product can emit multiple subproducts (e.g. SnykCode vs snykContainer), each of which is a distinct scan stream, so the result is an array with the latest succeeded scan per (product, subproduct). The optional productId and subproduct query params narrow the result to a single product and/or subproduct. Used by scanners needing previous scan context and by UIs to show latest scan status.

```json
{"openapi":"3.0.3","info":{"title":"Harness Security Test Orchestration API","version":"1.0.0"},"tags":[{"name":"Scans","description":"Access and modify Security Test Scans"}],"servers":[{"url":"https://app.harness.io/gateway/sto"},{"url":"http://127.0.0.1:4000"}],"security":[{"X-Api-Key_header_X-Api-Key":[],"jwt_header_Authorization":["sto_scan_view"]}],"components":{"securitySchemes":{"X-Api-Key_header_X-Api-Key":{"type":"apiKey","name":"X-Api-Key","in":"header"},"jwt_header_Authorization":{"type":"http","scheme":"bearer"}},"schemas":{"ScansLatestScanResponseBody":{"$ref":"#/components/schemas/LatestScansResult"},"LatestScansResult":{"type":"object","properties":{"scans":{"type":"array","items":{"$ref":"#/components/schemas/Scan"},"description":"Latest succeeded scan per (product, subproduct), optionally narrowed by the productId and subproduct filters"}},"description":"The latest succeeded scan for each product/subproduct of a target variant","required":["scans"]},"Scan":{"type":"object","properties":{"codeCoverage":{"type":"number","description":"The Code Coverage value for the Scan","format":"float"},"created":{"type":"integer","description":"Unix timestamp at which the resource was created","format":"int64"},"executionId":{"type":"string","description":"Pipeline Execution ID associated with the Scan","pattern":"^[a-zA-Z0-9_-]{22}$"},"gitMetadata":{"$ref":"#/components/schemas/GitMetadata"},"id":{"type":"string","description":"Resource identifier","pattern":"^[a-zA-Z0-9_-]{22}$"},"lastModified":{"type":"integer","description":"Unix timestamp at which the resource was most recently modified","format":"int64"},"metadata":{"$ref":"#/components/schemas/ScanMetadata"},"orgId":{"type":"string","description":"Harness Organization ID","pattern":"^[A-Za-z_][A-Za-z0-9_]*$","maxLength":128},"pipelineId":{"type":"string","description":"Harness Organization ID","pattern":"^[A-Za-z_][A-Za-z0-9_]*$","maxLength":128},"productId":{"type":"string","description":"The Scan Product used for the Scan","pattern":"^[a-zA-Z0-9_-]{22}$"},"productName":{"type":"string","description":"The machine name of the Scan Product (scanner), e.g. snyk. Optional; populated by endpoints that join the product table."},"productPrettyName":{"type":"string","description":"The human-readable display name of the Scan Product (scanner), e.g. Snyk. Optional; populated by endpoints that join the product table."},"projectId":{"type":"string","description":"Harness Project ID","pattern":"^[A-Za-z_][A-Za-z0-9_]*$","maxLength":128},"refinementVersion":{"type":"string","description":"The Issue refinement version used for this Scan"},"scannerDiffKey":{"type":"string","description":"Key used to differentiate scanner configurations for scan comparison (e.g. sast, sca, sast_sca)"},"stageId":{"type":"string","description":"Pipeline Stage ID associated with the Scan","pattern":"^[A-Za-z_][A-Za-z0-9_]*$","maxLength":128},"status":{"type":"string","description":"Current status of the Scan","enum":["Pending","Running","Succeeded","Failed"]},"stepId":{"type":"string","description":"Pipeline Step ID associated with the Scan","pattern":"^[A-Za-z_][A-Za-z0-9_]*$","maxLength":128},"subproduct":{"type":"string","description":"The Scan Subproduct used for the Scan","format":"binary"},"targetVariantId":{"type":"string","description":"The Target Variant associated with the Scan","pattern":"^[a-zA-Z0-9_-]{22}$"}},"description":"Information about a Security Test Scan","required":["targetVariantId","orgId","projectId","pipelineId","executionId","stageId","stepId","productId","status","refinementVersion","id","created","lastModified"]},"GitMetadata":{"type":"object","properties":{"commit":{"type":"string","description":"Git Commit SHA scanned"},"detectedName":{"type":"string","description":"Detected Name"},"detectedVariant":{"type":"string","description":"Detected Variant"},"droneCorrelated":{"type":"boolean","description":"Drone Correlated"},"provider":{"type":"string","description":"Git Provider"},"pullRequestNumber":{"type":"integer","description":"Git Pull Request Number","format":"int64"},"repositoryHttp":{"type":"string","description":"Git HTTP Repository"},"repositoryPath":{"type":"array","items":{"type":"string"},"description":"Git Repository Path"},"repositorySsh":{"type":"string","description":"Git SSH Repository"},"sourceBranch":{"type":"string","description":"Git Source Branch"},"targetBranch":{"type":"string","description":"Git Target Branch"},"workspace":{"type":"string","description":"Git Workspace Root"}},"description":"Git Metadata associated with the Scan"},"ScanMetadata":{"type":"object","properties":{"appId":{"type":"string","description":"Application identifier assigned by the scanner"},"appName":{"type":"string","description":"Application name used by the scanner"},"applicationName":{"type":"string","description":"Application name used by the scanner"},"artifactSource":{"type":"string","description":"Artifact source for container scans. Pipeline container_type is authoritative unless it equals docker_v2; docker_v2 may be refined from registryUrl to harness, aws_ecr, google, azure, github, docker_hub, or jfrog_artifactory. Unknown docker_v2 registry remains docker_v2."},"artifactUrl":{"type":"string","description":"Exact container image scanned, including its tag or digest"},"baseImageDigest":{"type":"string","description":"Digest of the base image"},"baseImageName":{"type":"string","description":"Name of the base image"},"baseImageTag":{"type":"string","description":"Tag of the base image"},"buildId":{"type":"string","description":"CI build/sequence id for the run that produced this scan (Harness HARNESS_BUILD_ID / <+pipeline.sequenceId>; non-Harness BUILD_ID). Not a product/scanner build id.","maxLength":128},"deduplicatedCount":{"type":"integer","description":"Total number of deduplicated issues found in the scan","format":"int32"},"executionSource":{"type":"string","description":"CI/CD platform that ran the scan (harness, jenkins, github_actions, gitlab_ci, ...)"},"executionUrl":{"type":"string","description":"URL of the CI execution from scan metadata (Jenkins/GHA BUILD_URL). For Harness, FE constructs the URL from pipelineId, executionId, and org/project when this is empty."},"honorGracePeriod":{"type":"boolean","description":"Honor vendor-issued grace period when bucketing issue counts (Prisma/Twistlock only)"},"imageBuildMetadata":{"$ref":"#/components/schemas/ImageBuildMetadata"},"imageDomain":{"type":"string","description":"Domain of the container image registry"},"imageName":{"type":"string","description":"Name of the container image"},"imageTag":{"type":"string","description":"Tag of the container image"},"ingestToolSeverityFlag":{"type":"boolean","description":"Scan ran with ingest_tool_severity enabled in the pipeline"},"normalizedCount":{"type":"integer","description":"Total number of normalized issues found in the scan","format":"int32"},"polyglotScanId":{"type":"string","description":"ShiftLeft/Qwiet polyglot scan ID for SCA package lookups"},"projectId":{"type":"string","description":"Project identifier assigned by the scanner"},"projectKey":{"type":"string","description":"Project key used by the scanner"},"projectName":{"type":"string","description":"Project name used by the scanner"},"publicId":{"type":"string","description":"Public application identifier assigned by the scanner"},"registryUrl":{"type":"string","description":"OCI pull base of the container image without a tag or digest"},"scanConfig":{"type":"string","description":"Scan configuration selected for this scan (e.g. default, oss, code, iac)"},"scannerConsoleUrl":{"type":"string","description":"URL to view scan results in the scanner's console"},"triggeredBy":{"type":"string","description":"Actor that triggered this scan. For PAT ingest, sto-core fills this from the token owner (NG username/email) when the plugin omits it. Harness pipeline runs are filled from pipeline-service instead.","maxLength":256}},"description":"Metadata specific to the entity being scanned"},"ImageBuildMetadata":{"type":"object","properties":{"dockerfilePath":{"type":"string","description":"Repository-relative Dockerfile path (io.harness.image.dockerfile)"},"repoUrl":{"type":"string","description":"Source repository HTTPS URL (org.opencontainers.image.source)"},"sourceBranch":{"type":"string","description":"Exact non-tag ref the image build ran on (io.harness.image.source.branch) — the image's build branch, not the branch the scan ran on"}},"description":"Self-asserted build metadata read off the scanned image's config labels; lookup hints, not proof of the build revision"},"NotFound":{"type":"object","properties":{"message":{"type":"string"},"status":{"type":"integer","default":404,"format":"int64"}},"required":["message"]}}},"paths":{"/api/v2/scans/latest":{"get":{"tags":["Scans"],"summary":"Get Latest Scans","description":"Get the most recent successful scan for each product/subproduct of a target variant. A single product can emit multiple subproducts (e.g. SnykCode vs snykContainer), each of which is a distinct scan stream, so the result is an array with the latest succeeded scan per (product, subproduct). The optional productId and subproduct query params narrow the result to a single product and/or subproduct. Used by scanners needing previous scan context and by UIs to show latest scan status.","operationId":"Scans#LatestScan","parameters":[{"name":"accountId","in":"query","description":"Harness Account ID","allowEmptyValue":true,"required":true,"schema":{"type":"string","description":"Harness Account ID","pattern":"^[a-zA-Z0-9_-]{22}$"}},{"name":"targetVariantId","in":"query","description":"The Target Variant ID","allowEmptyValue":true,"required":true,"schema":{"type":"string","description":"The Target Variant ID","pattern":"^[a-zA-Z0-9_-]{22}$"}},{"name":"productId","in":"query","description":"Optional Product ID (scanner) filter. When omitted, the latest scan for every product of the target variant is returned.","allowEmptyValue":true,"schema":{"type":"string","description":"Optional Product ID (scanner) filter. When omitted, the latest scan for every product of the target variant is returned.","pattern":"^[a-zA-Z0-9_-]{22}$"}},{"name":"subproduct","in":"query","description":"Optional subproduct filter to disambiguate scans within a product (e.g. SnykCode vs snykContainer). When omitted, the latest scan for every subproduct is returned.","allowEmptyValue":true,"schema":{"type":"string","description":"Optional subproduct filter to disambiguate scans within a product (e.g. SnykCode vs snykContainer). When omitted, the latest scan for every subproduct is returned."}},{"name":"scannerDiffKey","in":"query","description":"Optional scanner diff key filter to disambiguate scan comparison streams within a product/subproduct (e.g. pr_scan vs deep). When omitted, all scanner diff keys are considered.","allowEmptyValue":true,"schema":{"type":"string","description":"Optional scanner diff key filter to disambiguate scan comparison streams within a product/subproduct (e.g. pr_scan vs deep). When omitted, all scanner diff keys are considered."}},{"name":"X-Api-Key","in":"header","description":"Harness personal or service access token","allowEmptyValue":true,"schema":{"type":"string","description":"Harness personal or service access token"}}],"responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScansLatestScanResponseBody"}}}},"400":{"description":"BadRequest: Bad Request response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"401":{"description":"Unauthorized: Unauthorized response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"403":{"description":"Forbidden: Forbidden response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"429":{"description":"TooManyRequests: Too Many Requests response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"500":{"description":"InternalServerError: Internal Server Error response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}}}}}}}
```
