---
title: Submit libraries for vulnerability scanning
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: Docs > API Reference > Static Analysis
---

# Submit libraries for vulnerability scanning{% #submit-libraries-for-vulnerability-scanning %}
Copy pageCopied
{% tab title="v2" %}
**Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                                                    |
| ----------------- | ------------------------------------------------------------------------------- |
| ap1.datadoghq.com | POST https://api.ap1.datadoghq.com/api/v2/static-analysis-sca/dependencies/scan |
| ap2.datadoghq.com | POST https://api.ap2.datadoghq.com/api/v2/static-analysis-sca/dependencies/scan |
| app.datadoghq.eu  | POST https://api.datadoghq.eu/api/v2/static-analysis-sca/dependencies/scan      |
| app.ddog-gov.com  | POST https://api.ddog-gov.com/api/v2/static-analysis-sca/dependencies/scan      |
| us2.ddog-gov.com  | POST https://api.us2.ddog-gov.com/api/v2/static-analysis-sca/dependencies/scan  |
| app.datadoghq.com | POST https://api.datadoghq.com/api/v2/static-analysis-sca/dependencies/scan     |
| us3.datadoghq.com | POST https://api.us3.datadoghq.com/api/v2/static-analysis-sca/dependencies/scan |
| us5.datadoghq.com | POST https://api.us5.datadoghq.com/api/v2/static-analysis-sca/dependencies/scan |

### Overview



OAuth apps require the `code_analysis_read` authorization [scope](https://docs.datadoghq.com/api/latest/scopes.md#static-analysis) to access this endpoint.



### Request

#### Body Data (required)



{% tab title="Model" %}

| Parent field | Field                             | Type     | Description                                                                                      |
| ------------ | --------------------------------- | -------- | ------------------------------------------------------------------------------------------------ |
|              | data [*required*]            | object   | The data object in an MCP SCA scan request, containing the scan attributes and request type.     |
| data         | attributes [*required*]      | object   | The attributes of an MCP SCA scan request, describing the libraries to scan and their context.   |
| attributes   | commit_hash [*required*]     | string   | The commit hash of the source code being scanned.                                                |
| attributes   | libraries [*required*]       | [object] | The list of libraries to scan for vulnerabilities.                                               |
| libraries    | exclusions                        | [string] | The list of dependency PURLs to exclude when resolving transitive dependencies for this library. |
| libraries    | is_dev [*required*]          | boolean  | Whether this library is a development-only dependency.                                           |
| libraries    | is_direct [*required*]       | boolean  | Whether this library is a direct (rather than transitive) dependency.                            |
| libraries    | package_manager [*required*] | string   | The package manager that produced this library entry (for example, `npm`, `pip`, `nuget`).       |
| libraries    | purl [*required*]            | string   | The Package URL (PURL) uniquely identifying the library and its version.                         |
| libraries    | target_frameworks                 | [string] | The list of target framework identifiers associated with the library.                            |
| attributes   | resource_name [*required*]   | string   | The name of the resource (typically the repository or project name) being scanned.               |
| data         | id                                | string   | An optional identifier for this scan request.                                                    |
| data         | type [*required*]            | enum     | The type identifier for MCP SCA scan requests. Allowed enum values: `mcpscanrequest`             |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "commit_hash": "0e9fc8de83eaabecd722e1cd0ed44fb489fe15fc",
      "libraries": [
        {
          "exclusions": [],
          "is_dev": false,
          "is_direct": true,
          "package_manager": "nuget",
          "purl": "pkg:nuget/Newtonsoft.Json@13.0.1",
          "target_frameworks": []
        }
      ],
      "resource_name": "my-org/my-repo"
    },
    "id": "string",
    "type": "mcpscanrequest"
  }
}
```

{% /tab %}

### Response

{% tab title="202" %}
Accepted
{% tab title="Model" %}
The top-level response object returned when an MCP SCA dependency scan request has been accepted.

| Parent field | Field                        | Type   | Description                                                                                                            |
| ------------ | ---------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------- |
|              | data [*required*]       | object | The data object returned when a scan request has been accepted.                                                        |
| data         | attributes [*required*] | object | The attributes returned when a scan request has been accepted, containing the job identifier used to poll for results. |
| attributes   | job_id [*required*]     | string | The job identifier assigned to the scan, used to retrieve the scan result.                                             |
| data         | id [*required*]         | string | The job identifier assigned to the scan.                                                                               |
| data         | type [*required*]       | enum   | The type identifier for MCP SCA scan request responses. Allowed enum values: `mcpscanrequestresponse`                  |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "job_id": "0190a3d4-1234-7000-8000-000000000000"
    },
    "id": "0190a3d4-1234-7000-8000-000000000000",
    "type": "mcpscanrequestresponse"
  }
}
```

{% /tab %}

{% /tab %}

{% tab title="400" %}
Bad Request
{% tab title="Model" %}
API error response.

| Parent field | Field                    | Type     | Description                                                                     |
| ------------ | ------------------------ | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | detail                   | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                     | object   | Non-standard meta-information about the error                                   |
| errors       | source                   | object   | References to the source of the error.                                          |
| source       | header                   | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter                | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer                  | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status                   | string   | Status code of the response.                                                    |
| errors       | title                    | string   | Short human-readable summary of the error.                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="429" %}
Too many requests
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

### Code Example

##### 
                  \## default
# 
 \# Curl command curl -X POST "https://api.datadoghq.com/api/v2/static-analysis-sca/dependencies/scan" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "commit_hash": "0e9fc8de83eaabecd722e1cd0ed44fb489fe15fc",
      "libraries": [
        {
          "exclusions": [],
          "is_dev": false,
          "is_direct": true,
          "package_manager": "nuget",
          "purl": "pkg:nuget/Newtonsoft.Json@13.0.1",
          "target_frameworks": [
            "net8.0"
          ]
        }
      ],
      "resource_name": "my-org/my-repo"
    },
    "type": "mcpscanrequest"
  }
}
EOF 
                
{% /tab %}
