> For the complete documentation index, see [llms.txt](https://docs.opsmx.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.opsmx.com/getting-started/installing-delivery-shield/ssd-apis/get-branch-scans.md).

# Get Branch Scans

This API allows users to get the results of a security or code analysis scan on a specific branch within a repository.

### Authentication

Response data is subject to user roles and permissions

**Method**: Bearer Token or API Key

**Details**: For bearer token header name should be `X-OpsMx-Auth`. API keys can be generated from the SSD UI.&#x20;

### Request Details

### Endpoint URL

| **Method** | **URL Path**                                |
| ---------- | ------------------------------------------- |
| GET        | {host}/ssdservice/v1/{scanType}/summarydata |

### Request Headers

| **Header**   | **Description**                 |
| ------------ | ------------------------------- |
| Content-Type | application/json                |
| X-OpsMx-Auth | Bearer Token for authentication |

### CURL Example

{% code overflow="wrap" %}

```
curl --location '{host}/gate/ssdservice/v1/sourceScan/summarydata?repository=docker-swarm&teamId=3c5c9dcb-8466-4e06-8ea0-07f9820df897&projectId=0x29ab7&type=sourceScan&branch=main' \
--header 'X-OpsMx-Auth: Bearer <token>'
```

{% endcode %}

### Response Details

#### Success Response (Status Code: 200/201)

{% code overflow="wrap" %}

```
{
  "scanId": "0x29ab8",
  "branch": "main",
  "headCommit": "98394245298c492b5488c9df39fdee209a955610",
  "lastScanDuration": 9.636670818,
  "lastScannedAt": "2025-12-09T06:21:27.441341088Z",
  "triggeredBy": "system",
  "triggerType": "auto",
  "projectId": "0x29ab7",
  "projectName": "test-source-1",
  "scanTool": "grype",
  "scanType": "sbom",
  "repository": "docker-swarm",
  "scannedFiledData": {
    "OpenSSF": {
      "openssf": {
        "scanName": "openssfscan",
        "scanTool": "Openssf",
        "resultFile": "tool-chain/api/v1/scanResult?fileName=OpsMx_docker-swarm_5610_scorecard.json&scanOperation=openssfscan",
        "status": "Completed",
        "error": ""
      }
    },
    "SAST": {
      "opengrep": {
        "scanName": "opengrepscan",
        "scanTool": "Opengrep",
        "resultFile": "tool-chain/api/v1/scanResult?fileName=findings_OpsMx_docker-swarm_high_5610_opengrep.json&scanOperation=opengrepscan,tool-chain/api/v1/scanResult?fileName=findings_OpsMx_docker-swarm_medium_5610_opengrep.json&scanOperation=opengrepscan,tool-chain/api/v1/scanResult?fileName=findings_OpsMx_docker-swarm_low_5610_opengrep.json&scanOperation=opengrepscan",
        "status": "Completed",
        "error": ""
      }
    },
    "SBOM": {
      "sbom": {
        "scanName": "sbom",
        "scanTool": "Grype",
        "resultFile": "tool-chain/api/v1/scanResult?fileName=sha256-98394245298c492b5488c9df39fdee209a955610-grype.json&scanOperation=sbom",
        "status": "Completed",
        "error": ""
      }
    },
    "SCA": {
      "codelicense": {
        "scanName": "codelicensescan",
        "scanTool": "Trivy",
        "resultFile": "tool-chain/api/v1/scanResult?fileName=OpsMx_docker-swarm_5610_codeLicenseScanResult.json&scanOperation=codelicensescan",
        "status": "Completed",
        "error": ""
      },
      "codesecret": {
        "scanName": "codesecretscan",
        "scanTool": "Trivy",
        "resultFile": "tool-chain/api/v1/scanResult?fileName=OpsMx_docker-swarm_5610_codeScanResult.json&scanOperation=codesecretscan",
        "status": "Completed",
        "error": ""
      }
    }
  },
  "platform": "github",
  "status": "Completed",
  "artifactName": "docker-swarm-main",
  "artifactTag": "98394245298c492b5488c9df39fdee209a955610",
  "artifactSha": "sha256:98394245298c492b5488c9df39fdee209a955610",
  "sbomTool": "grype"
}
```

{% endcode %}

### Error Responses

| **Status Code** | **Description**                                             | **Example Error Response**            |
| --------------- | ----------------------------------------------------------- | ------------------------------------- |
| 400             | Bad Request (Invalid parameters or missing required fields) | {"error": "Invalid input data."}      |
| 401             | Unauthorized (Missing or invalid authentication token)      | {"error": "Authentication required."} |
| 500             | Some issues in Server                                       | {"error": "Resource not found."}      |

\
\
\
\ <br>
