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

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

# Get the version history of a dataset{% #get-the-version-history-of-a-dataset %}
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 | GET https://api.ap1.datadoghq.com/api/v2/security_monitoring/datasets/{dataset_id}/version_history |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v2/security_monitoring/datasets/{dataset_id}/version_history |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v2/security_monitoring/datasets/{dataset_id}/version_history      |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v2/security_monitoring/datasets/{dataset_id}/version_history      |
| us2.ddog-gov.com  | GET https://api.us2.ddog-gov.com/api/v2/security_monitoring/datasets/{dataset_id}/version_history  |
| uk1.datadoghq.com | GET https://api.uk1.datadoghq.com/api/v2/security_monitoring/datasets/{dataset_id}/version_history |
| app.datadoghq.com | GET https://api.datadoghq.com/api/v2/security_monitoring/datasets/{dataset_id}/version_history     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v2/security_monitoring/datasets/{dataset_id}/version_history |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v2/security_monitoring/datasets/{dataset_id}/version_history |

### Overview

Retrieve the version history of a Cloud SIEM dataset, including the changes made at each version. 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.



### Arguments

#### Path Parameters

| Name                         | Type   | Description              |
| ---------------------------- | ------ | ------------------------ |
| dataset_id [*required*] | string | The UUID of the dataset. |

#### Query Strings

| Name         | Type    | Description                                              |
| ------------ | ------- | -------------------------------------------------------- |
| page[size]   | integer | Size for a given page. The maximum allowed value is 100. |
| page[number] | integer | Specific page number to return.                          |

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response containing the version history of a Cloud SIEM dataset.

| Parent field         | Field                             | Type     | Description                                                                                                                                                                                                                                                                        |
| -------------------- | --------------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|                      | data [*required*]            | object   | The data wrapper of a dataset version history response.                                                                                                                                                                                                                            |
| data                 | attributes [*required*]      | object   | The attributes of a dataset version history response.                                                                                                                                                                                                                              |
| attributes           | count [*required*]           | int64    | The total number of versions available for this dataset.                                                                                                                                                                                                                           |
| attributes           | data [*required*]            | object   | A map from version number (as a string) to the dataset state at that version.                                                                                                                                                                                                      |
| additionalProperties | <any-key>                         | object   | A single entry in the version history of a dataset.                                                                                                                                                                                                                                |
| <any-key>            | changes [*required*]         | [object] | The list of field changes between this version of the dataset and the previous one.                                                                                                                                                                                                |
| changes              | current [*required*]         |          | The current value of the field, serialized as a JSON value.                                                                                                                                                                                                                        |
| changes              | field [*required*]           | string   | The name of the field that changed.                                                                                                                                                                                                                                                |
| changes              | previous [*required*]        |          | The previous value of the field, serialized as a JSON value.                                                                                                                                                                                                                       |
| <any-key>            | dataset [*required*]         | object   | The attributes of a Cloud SIEM dataset.                                                                                                                                                                                                                                            |
| dataset              | createdAt [*required*]       | string   | The creation timestamp of the dataset, in ISO 8601 format.                                                                                                                                                                                                                         |
| dataset              | createdByHandle [*required*] | string   | The Datadog handle of the user who created the dataset.                                                                                                                                                                                                                            |
| dataset              | createdByName [*required*]   | string   | The display name of the user who created the dataset.                                                                                                                                                                                                                              |
| dataset              | definition [*required*]      | object   | The definition of the dataset. The shape depends on the value of `data_source`. Use `reference_table` or `managed_resource` for a referential dataset, or one of the event platform sources (for example `logs`, `audit`, `events`, `spans`, `rum`) for an event platform dataset. |
| definition           | columns                           | [object] | For event platform datasets, the list of columns exposed by the dataset.                                                                                                                                                                                                           |
| columns              | column [*required*]          | string   | The name of the column.                                                                                                                                                                                                                                                            |
| columns              | type [*required*]            | string   | The type of the column value.                                                                                                                                                                                                                                                      |
| definition           | data_source [*required*]     | string   | The data source backing this dataset definition.                                                                                                                                                                                                                                   |
| definition           | indexes                           | [string] | For event platform datasets, the list of indexes to query.                                                                                                                                                                                                                         |
| definition           | name [*required*]            | string   | The unique name of the dataset. Must start with a lowercase letter and contain only lowercase letters, digits, and underscores (max 255 characters).                                                                                                                               |
| definition           | query_filter                      | string   | For referential datasets, an optional filter expression applied to the table.                                                                                                                                                                                                      |
| definition           | search                            | object   | The search clause applied to an event platform dataset.                                                                                                                                                                                                                            |
| search               | query [*required*]           | string   | The search query expression.                                                                                                                                                                                                                                                       |
| definition           | storage                           | string   | Storage tier the dataset reads from. Applies to event platform datasets.                                                                                                                                                                                                           |
| definition           | table_name                        | string   | For referential datasets, the name of the underlying table.                                                                                                                                                                                                                        |
| definition           | time_window                       | object   | An optional time window that overrides the default query time range.                                                                                                                                                                                                               |
| time_window          | from                              | int64    | Inclusive start of the time window, in milliseconds since the Unix epoch.                                                                                                                                                                                                          |
| time_window          | to                                | int64    | Exclusive end of the time window, in milliseconds since the Unix epoch.                                                                                                                                                                                                            |
| dataset              | description [*required*]     | string   | The description of the dataset.                                                                                                                                                                                                                                                    |
| dataset              | id [*required*]              | string   | The UUID of the dataset.                                                                                                                                                                                                                                                           |
| dataset              | isDefault [*required*]       | boolean  | Whether the dataset is an out-of-the-box dataset provided by Datadog.                                                                                                                                                                                                              |
| dataset              | isDeprecated [*required*]    | boolean  | Whether the dataset is marked as deprecated.                                                                                                                                                                                                                                       |
| dataset              | modifiedAt [*required*]      | string   | The timestamp of the last modification of the dataset, in ISO 8601 format.                                                                                                                                                                                                         |
| dataset              | name [*required*]            | string   | The unique name of the dataset.                                                                                                                                                                                                                                                    |
| dataset              | updatedByHandle [*required*] | string   | The Datadog handle of the user who last updated the dataset.                                                                                                                                                                                                                       |
| dataset              | updatedByName [*required*]   | string   | The display name of the user who last updated the dataset.                                                                                                                                                                                                                         |
| dataset              | version [*required*]         | int64    | The current version of the dataset.                                                                                                                                                                                                                                                |
| data                 | id [*required*]              | string   | The UUID of the dataset.                                                                                                                                                                                                                                                           |
| data                 | type [*required*]            | enum     | The type of resource for a dataset version history response. Allowed enum values: `dataset_version_history`                                                                                                                                                                        |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "count": 1,
      "data": {
        "<any-key>": {
          "changes": [
            {
              "current": "New description.",
              "field": "description",
              "previous": "Old description."
            }
          ],
          "dataset": {
            "createdAt": "2025-03-20T10:00:00Z",
            "createdByHandle": "bruce.lee",
            "createdByName": "Bruce Lee",
            "definition": {
              "columns": [
                {
                  "column": "message",
                  "type": "string"
                }
              ],
              "data_source": "logs",
              "indexes": [],
              "name": "sample_dataset",
              "query_filter": "status = 'active'",
              "search": {
                "query": "*"
              },
              "storage": "hot",
              "table_name": "my_reference_table",
              "time_window": {
                "from": 1700000000000,
                "to": 1700003600000
              }
            },
            "description": "A sample dataset used for detection rules.",
            "id": "123e4567-e89b-12d3-a456-426614174000",
            "isDefault": false,
            "isDeprecated": false,
            "modifiedAt": "2025-03-20T10:00:00Z",
            "name": "sample_dataset",
            "updatedByHandle": "bruce.lee",
            "updatedByName": "Bruce Lee",
            "version": 1
          }
        }
      }
    },
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "type": "dataset_version_history"
  }
}
```

{% /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="404" %}
Not Found
{% 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

##### 
                  \# Path parameters export dataset_id="123e4567-e89b-12d3-a456-426614174000" \# Curl command curl -X GET "https://api.datadoghq.com/api/v2/security_monitoring/datasets/${dataset_id}/version_history" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" 
                
##### 

```python
"""
Get the version history of a dataset returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.security_monitoring_api import SecurityMonitoringApi

configuration = Configuration()
configuration.unstable_operations["get_security_monitoring_dataset_version_history"] = True
with ApiClient(configuration) as api_client:
    api_instance = SecurityMonitoringApi(api_client)
    response = api_instance.get_security_monitoring_dataset_version_history(
        dataset_id="123e4567-e89b-12d3-a456-426614174000",
    )

    print(response)
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=python) and then save the example to `example.py` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
##### 

```ruby
# Get the version history of a dataset returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
  config.unstable_operations["v2.get_security_monitoring_dataset_version_history".to_sym] = true
end
api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new
p api_instance.get_security_monitoring_dataset_version_history("123e4567-e89b-12d3-a456-426614174000")
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=ruby) and then save the example to `example.rb` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
##### 

```go
// Get the version history of a dataset returns "OK" response

package main

import (
	"context"
	"encoding/json"
	"fmt"
	"os"

	"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
	"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)

func main() {
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.GetSecurityMonitoringDatasetVersionHistory", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewSecurityMonitoringApi(apiClient)
	resp, r, err := api.GetSecurityMonitoringDatasetVersionHistory(ctx, "123e4567-e89b-12d3-a456-426614174000", *datadogV2.NewGetSecurityMonitoringDatasetVersionHistoryOptionalParameters())

	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `SecurityMonitoringApi.GetSecurityMonitoringDatasetVersionHistory`: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `SecurityMonitoringApi.GetSecurityMonitoringDatasetVersionHistory`:\n%s\n", responseContent)
}
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=go) and then save the example to `main.go` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
##### 

```java
// Get the version history of a dataset returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.SecurityMonitoringApi;
import com.datadog.api.client.v2.model.SecurityMonitoringDatasetVersionHistoryResponse;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    defaultClient.setUnstableOperationEnabled(
        "v2.getSecurityMonitoringDatasetVersionHistory", true);
    SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient);

    try {
      SecurityMonitoringDatasetVersionHistoryResponse result =
          apiInstance.getSecurityMonitoringDatasetVersionHistory(
              "123e4567-e89b-12d3-a456-426614174000");
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println(
          "Exception when calling"
              + " SecurityMonitoringApi#getSecurityMonitoringDatasetVersionHistory");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=java) and then save the example to `Example.java` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
##### 

```rust
// Get the version history of a dataset returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_security_monitoring::GetSecurityMonitoringDatasetVersionHistoryOptionalParams;
use datadog_api_client::datadogV2::api_security_monitoring::SecurityMonitoringAPI;

#[tokio::main]
async fn main() {
    let mut configuration = datadog::Configuration::new();
    configuration
        .set_unstable_operation_enabled("v2.GetSecurityMonitoringDatasetVersionHistory", true);
    let api = SecurityMonitoringAPI::with_config(configuration);
    let resp = api
        .get_security_monitoring_dataset_version_history(
            "123e4567-e89b-12d3-a456-426614174000".to_string(),
            GetSecurityMonitoringDatasetVersionHistoryOptionalParams::default(),
        )
        .await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=rust) and then save the example to `src/main.rs` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
##### 

```typescript
/**
 * Get the version history of a dataset returns "OK" response
 */

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
configuration.unstableOperations[
  "v2.getSecurityMonitoringDatasetVersionHistory"
] = true;
const apiInstance = new v2.SecurityMonitoringApi(configuration);

const params: v2.SecurityMonitoringApiGetSecurityMonitoringDatasetVersionHistoryRequest =
  {
    datasetId: "123e4567-e89b-12d3-a456-426614174000",
  };

apiInstance
  .getSecurityMonitoringDatasetVersionHistory(params)
  .then((data: v2.SecurityMonitoringDatasetVersionHistoryResponse) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=typescript) and then save the example to `example.ts` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"
{% /tab %}
