---
title: Export feature flag change history
description: Exports the organization's feature flag change events as a CSV file, newest first, without pagination.
breadcrumbs: Docs > API > Export feature flag change history
---

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

# Export feature flag change history

## v2 (latest)

| Datadog site      | API endpoint                                                          |
| ----------------- | --------------------------------------------------------------------- |
| app.datadoghq.com | GET https://api.datadoghq.com/api/v2/feature-flags/history/export     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v2/feature-flags/history/export |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v2/feature-flags/history/export |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v2/feature-flags/history/export      |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v2/feature-flags/history/export |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v2/feature-flags/history/export |
| uk1.datadoghq.com | GET https://api.uk1.datadoghq.com/api/v2/feature-flags/history/export |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v2/feature-flags/history/export      |
| us2.ddog-gov.com  | GET https://api.us2.ddog-gov.com/api/v2/feature-flags/history/export  |

### Overview

Exports the organization's feature flag change events as a CSV file, newest first, without pagination.
It accepts the same filters as the List feature flag change history endpoint, and its columns match the CSV export on the flag history page:
Flag Version, Flag Name, Flag Key, Flag UUID, Action, User Name, User Email, User Type, Environment, and Timestamp.

If an export fails before the file starts, the response is a JSON:API error. Large exports stream as they are read.
If an export fails after streaming starts, the connection closes before the file ends, so the download fails instead of
returning a file with missing rows. An export must finish within the 60-second request timeout. If an export times out,
narrow the date range.

This endpoint requires the `feature_flag_config_read` permission.

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

### Arguments

#### Query Strings

| Field                     | Type    | Description                                                                                                                                                                                                                                                                                                                                                                                       |
| ------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| start_date                | string  | Only include changes made after this time, for example `2026-01-01T00:00:00Z`. The bound is exclusive, so a change made exactly at this time is not included. Omit for no lower bound.                                                                                                                                                                                                            |
| end_date                  | string  | Only include changes made before this time, for example `2026-02-01T00:00:00Z`. The bound is exclusive, so a change made exactly at this time is not included. Omit for no upper bound. Must be after `start_date` when both are set.                                                                                                                                                             |
| teams                     | array   | Only include changes to flags that belong to at least one of these teams. Use team handles without the `team:` prefix, as repeated parameters, such as `teams=checkout&teams=payments`. Handles from `teams` and `team:<handle>` values from `tags` are treated as one set. Handles that are empty, have surrounding white space, or include the `team:` prefix return a `400 Bad Request` error. |
| tags                      | array   | Only include changes to flags that have all of these exact tags, as repeated parameters, such as `tags=env:prod&tags=tier:1`. Values of the form `team:<handle>` match any selected team and are combined with `teams`. Empty values are ignored.                                                                                                                                                 |
| feature_flag_id           | string  | Only include changes to this feature flag.                                                                                                                                                                                                                                                                                                                                                        |
| environment_id            | string  | Only include changes to this environment. Changes to the flag itself, which have no environment, are always included.                                                                                                                                                                                                                                                                             |
| include_suggestion_events | boolean | Also include review events for change requests that needed approval: rejected requests and requests still pending review. Applies only to organizations with flag approvals enabled. Default: `false`.                                                                                                                                                                                            |

### Response

{% tabs %}
{% tab label="200" %}
OK

{% tabs %}
{% tab label="Model" %}
Content type: `text/csv`
{% /tab %}

{% tab label="Example" %}
```csv
Flag Version,Flag Name,Flag Key,Flag UUID,Action,User Name,User Email,User Type,Environment,Timestamp
3,Mobile Feature Toggle,mobile-feature-toggle,550e8400-e29b-41d4-a716-446655440000,"Changed flag name from ""Mobile Feature Rollout"" to ""Mobile Feature Toggle"".",Jane Doe,jane.doe@example.com,User,All,"Mon, Oct 2, 2023, 2:30:00 pm UTC"
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="400" %}
Bad Request

{% tabs %}
{% tab label="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 label="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 %}
{% /tabs %}
{% /tab %}

{% tab label="403" %}
Forbidden

{% tabs %}
{% tab label="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 label="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 %}
{% /tabs %}
{% /tab %}

{% tab label="429" %}
Too many requests

{% tabs %}
{% tab label="Model" %}
API error response.

| Field               | Type     | Description       |
| ------------------- | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Bad Request"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}
{% /tabs %}

### Code Example

{% tabs %}
{% tab label="Curl" %}
```bash
# Set your Datadog site and credentials
export DD_SITE="datadoghq.com" # Or us3.datadoghq.com, us5.datadoghq.com, datadoghq.eu, ap1.datadoghq.com, ap2.datadoghq.com, uk1.datadoghq.com, ddog-gov.com, us2.ddog-gov.com
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X GET "https://api.${DD_SITE}/api/v2/feature-flags/history/export" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
```
{% /tab %}
{% /tabs %}
