# Scans#CreateScan

Create a new Security Test Scan

Endpoint: POST /sto/api/v2/scans
Version: 1.0
Security: 

## Query parameters:

  - `accountId` (string, required)
    Harness Account ID
    Example: "abcdef1234567890ghijkl"

## Header parameters:

  - `X-Api-Key` (string)
    Harness personal or service access token
    Example: "Repellendus placeat sint."

  - `X-Harness-User-Id` (string)
    Harness User ID
    Example: "abcdef1234567890ghijkl"

## Request fields (application/json):

  - `codeCoverage` (number)
    The Code Coverage value for the Scan
    Example: 65.5

  - `executionId` (string, required)
    Pipeline Execution ID associated with the Scan
    Example: "abcdef1234567890ghijkl"

  - `gitMetadata` (object)
    Git Metadata associated with the Scan
    Example: {"commit":"0000000000000000000000000000000000000001","detectedName":"Fugit repellat officia ratione omnis.","detectedVariant":"Molestiae molestiae.","droneCorrelated":false,"provider":"Voluptatem qui recusandae illum molestiae.","pullRequestNumber":11,"repositoryHttp":"https://github.com/harness/drone-cli.git","repositoryPath":["Nisi et.","Autem eaque eius quia.","In sapiente placeat aliquam alias maiores.","Ex quaerat."],"repositorySsh":"git@github.com:harness/drone-cli.git","sourceBranch":"feat/shiny-object","targetBranch":"develop","workspace":"/harness"}

  - `gitMetadata.commit` (string)
    Git Commit SHA scanned
    Example: "0000000000000000000000000000000000000001"

  - `gitMetadata.detectedName` (string)
    Detected Name
    Example: "Fugit repellat officia ratione omnis."

  - `gitMetadata.detectedVariant` (string)
    Detected Variant
    Example: "Molestiae molestiae."

  - `gitMetadata.droneCorrelated` (boolean)
    Drone Correlated

  - `gitMetadata.provider` (string)
    Git Provider
    Example: "Voluptatem qui recusandae illum molestiae."

  - `gitMetadata.pullRequestNumber` (integer)
    Git Pull Request Number
    Example: 11

  - `gitMetadata.repositoryHttp` (string)
    Git HTTP Repository
    Example: "https://github.com/harness/drone-cli.git"

  - `gitMetadata.repositoryPath` (array)
    Git Repository Path
    Example: ["Nisi et.","Autem eaque eius quia.","In sapiente placeat aliquam alias maiores.","Ex quaerat."]

  - `gitMetadata.repositorySsh` (string)
    Git SSH Repository
    Example: "git@github.com:harness/drone-cli.git"

  - `gitMetadata.sourceBranch` (string)
    Git Source Branch
    Example: "feat/shiny-object"

  - `gitMetadata.targetBranch` (string)
    Git Target Branch
    Example: "develop"

  - `gitMetadata.workspace` (string)
    Git Workspace Root
    Example: "/harness"

  - `orgId` (string, required)
    Harness Organization ID
    Example: "your_harness_org"

  - `pipelineId` (string, required)
    Harness Organization ID
    Example: "your_harness_pipeline"

  - `productId` (string, required)
    The Scan Product used for the Scan
    Example: "product111111111111111"

  - `productName` (string)
    The machine name of the Scan Product (scanner), e.g. snyk. Optional; populated by endpoints that join the product table.
    Example: "snyk"

  - `productPrettyName` (string)
    The human-readable display name of the Scan Product (scanner), e.g. Snyk. Optional; populated by endpoints that join the product table.
    Example: "Snyk"

  - `projectId` (string, required)
    Harness Project ID
    Example: "your_harness_project"

  - `refinementVersion` (string, required)
    The Issue refinement version used for this Scan
    Example: "1.0.5"

  - `scannerDiffKey` (string)
    Key used to differentiate scanner configurations for scan comparison (e.g. sast, sca, sast_sca)
    Example: "sast"

  - `stageId` (string, required)
    Pipeline Stage ID associated with the Scan
    Example: "stage_id"

  - `status` (string, required)
    Current status of the Scan
    Enum: "Pending", "Running", "Succeeded", "Failed"

  - `stepId` (string, required)
    Pipeline Step ID associated with the Scan
    Example: "step_id"

  - `subproduct` (string)
    The Scan Subproduct used for the Scan
    Example: "owasp"

  - `targetVariantId` (string, required)
    The Target Variant associated with the Scan
    Example: "variant111111111111111"

## Response 200 fields (application/json):

  - `id` (string, required)
    Resource identifier
    Example: "abcdef1234567890ghijkl"

## Response 400 fields (application/json):

  - `message` (string, required)
    Example: "Not Found"

  - `status` (integer)
    Example: 404


