---
title: Get dataset dependencies
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: Docs > API Reference > Security Monitoring
---

# Get dataset dependencies{% #get-dataset-dependencies %}
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/security_monitoring/datasets/dependencies |
| ap2.datadoghq.com | POST https://api.ap2.datadoghq.com/api/v2/security_monitoring/datasets/dependencies |
| app.datadoghq.eu  | POST https://api.datadoghq.eu/api/v2/security_monitoring/datasets/dependencies      |
| app.ddog-gov.com  | POST https://api.ddog-gov.com/api/v2/security_monitoring/datasets/dependencies      |
| us2.ddog-gov.com  | POST https://api.us2.ddog-gov.com/api/v2/security_monitoring/datasets/dependencies  |
| app.datadoghq.com | POST https://api.datadoghq.com/api/v2/security_monitoring/datasets/dependencies     |
| us3.datadoghq.com | POST https://api.us3.datadoghq.com/api/v2/security_monitoring/datasets/dependencies |
| us5.datadoghq.com | POST https://api.us5.datadoghq.com/api/v2/security_monitoring/datasets/dependencies |

### Overview

Return, for each of the requested datasets, the list of detection rules that depend on it. Useful for understanding the impact of updating or deleting a dataset. This endpoint requires any of the following permissions:
`security_monitoring_rules_read``security_monitoring_dataset_read` 


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



### Request

#### Body Data (required)



{% tab title="Model" %}

| Parent field | Field                        | Type     | Description                                                                                |
| ------------ | ---------------------------- | -------- | ------------------------------------------------------------------------------------------ |
|              | data [*required*]       | object   | The data wrapper of a dataset dependencies request.                                        |
| data         | attributes [*required*] | object   | The attributes of a dataset dependencies request.                                          |
| attributes   | datasetIds [*required*] | [string] | The list of dataset UUIDs to query dependencies for. Must contain between 1 and 100 items. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "datasetIds": [
        "123e4567-e89b-12d3-a456-426614174000"
      ]
    }
  }
}
```

{% /tab %}

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response listing the dependents of each requested dataset.

| Parent field | Field                           | Type     | Description                                                                                   |
| ------------ | ------------------------------- | -------- | --------------------------------------------------------------------------------------------- |
|              | data [*required*]          | [object] | The list of dataset dependents entries.                                                       |
| data         | attributes [*required*]    | object   | The attributes of a dataset dependents entry.                                                 |
| attributes   | count [*required*]         | int64    | The number of resources that depend on the dataset.                                           |
| attributes   | datasetId [*required*]     | string   | The UUID of the dataset whose dependencies are being reported.                                |
| attributes   | ids [*required*]           | [string] | The list of resource IDs that depend on the dataset.                                          |
| attributes   | resource_type [*required*] | string   | The type of resource that depends on the dataset.                                             |
| data         | id [*required*]            | string   | The UUID of the dataset.                                                                      |
| data         | type [*required*]          | enum     | The type of resource for a dataset dependents entry. Allowed enum values: `datasetDependents` |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": [
    {
      "attributes": {
        "count": 0,
        "datasetId": "123e4567-e89b-12d3-a456-426614174000",
        "ids": [
          []
        ],
        "resource_type": "security_detection_rule"
      },
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "type": "datasetDependents"
    }
  ]
}
```

{% /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="403" %}
Forbidden
{% 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/security_monitoring/datasets/dependencies" \
-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": {
      "datasetIds": [
        "123e4567-e89b-12d3-a456-426614174000"
      ]
    }
  }
}
EOF 
                
{% /tab %}
