---
title: Feature Flags
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: Docs > API Reference > Feature Flags
---

# Feature Flags

Manage feature flags and environments.

## Delete an environment{% #delete-an-environment %}

{% tab title="v2" %}

| Datadog site      | API endpoint                                                                            |
| ----------------- | --------------------------------------------------------------------------------------- |
| ap1.datadoghq.com | DELETE https://api.ap1.datadoghq.com/api/v2/feature-flags/environments/{environment_id} |
| ap2.datadoghq.com | DELETE https://api.ap2.datadoghq.com/api/v2/feature-flags/environments/{environment_id} |
| app.datadoghq.eu  | DELETE https://api.datadoghq.eu/api/v2/feature-flags/environments/{environment_id}      |
| app.ddog-gov.com  | DELETE https://api.ddog-gov.com/api/v2/feature-flags/environments/{environment_id}      |
| app.datadoghq.com | DELETE https://api.datadoghq.com/api/v2/feature-flags/environments/{environment_id}     |
| us3.datadoghq.com | DELETE https://api.us3.datadoghq.com/api/v2/feature-flags/environments/{environment_id} |
| us5.datadoghq.com | DELETE https://api.us5.datadoghq.com/api/v2/feature-flags/environments/{environment_id} |

### Overview

Deletes an environment. This operation cannot be undone. This endpoint requires the `feature_flag_environment_config_write` permission.

### Arguments

#### Path Parameters

| Name                             | Type   | Description                |
| -------------------------------- | ------ | -------------------------- |
| environment_id [*required*] | string | The ID of the environment. |

### Response

{% tab title="204" %}
No Content
{% /tab %}

{% tab title="403" %}
Forbidden
{% 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 %}

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

{% 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 parametersexport environment_id="550e8400-e29b-41d4-a716-446655440001"\# Curl commandcurl -X DELETE "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/feature-flags/environments/${environment_id}" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
                
{% /tab %}

## Update an environment{% #update-an-environment %}

{% tab title="v2" %}

| Datadog site      | API endpoint                                                                         |
| ----------------- | ------------------------------------------------------------------------------------ |
| ap1.datadoghq.com | PUT https://api.ap1.datadoghq.com/api/v2/feature-flags/environments/{environment_id} |
| ap2.datadoghq.com | PUT https://api.ap2.datadoghq.com/api/v2/feature-flags/environments/{environment_id} |
| app.datadoghq.eu  | PUT https://api.datadoghq.eu/api/v2/feature-flags/environments/{environment_id}      |
| app.ddog-gov.com  | PUT https://api.ddog-gov.com/api/v2/feature-flags/environments/{environment_id}      |
| app.datadoghq.com | PUT https://api.datadoghq.com/api/v2/feature-flags/environments/{environment_id}     |
| us3.datadoghq.com | PUT https://api.us3.datadoghq.com/api/v2/feature-flags/environments/{environment_id} |
| us5.datadoghq.com | PUT https://api.us5.datadoghq.com/api/v2/feature-flags/environments/{environment_id} |

### Overview

Updates an existing environment's metadata such as name and description. This endpoint requires the `feature_flag_environment_config_write` permission.

### Arguments

#### Path Parameters

| Name                             | Type   | Description                |
| -------------------------------- | ------ | -------------------------- |
| environment_id [*required*] | string | The ID of the environment. |

### Request

#### Body Data (required)



{% tab title="Model" %}

| Parent field | Field                         | Type     | Description                                                                  |
| ------------ | ----------------------------- | -------- | ---------------------------------------------------------------------------- |
|              | data [*required*]        | object   | Data for updating an environment.                                            |
| data         | attributes [*required*]  | object   | Attributes for updating an environment.                                      |
| attributes   | is_production                 | boolean  | Indicates whether this is a production environment.                          |
| attributes   | name                          | string   | The name of the environment.                                                 |
| attributes   | queries                       | [string] | List of queries to define the environment scope.                             |
| attributes   | require_feature_flag_approval | boolean  | Indicates whether feature flag changes require approval in this environment. |
| data         | type [*required*]        | enum     | The resource type. Allowed enum values: `environments`                       |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "is_production": false,
      "name": "Environment XYZ789",
      "queries": [
        "staging",
        "test"
      ],
      "require_feature_flag_approval": true
    },
    "type": "environments"
  }
}
```

{% /tab %}

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response containing an environment.

| Parent field | Field                         | Type      | Description                                                                  |
| ------------ | ----------------------------- | --------- | ---------------------------------------------------------------------------- |
|              | data [*required*]        | object    | A feature flag environment resource.                                         |
| data         | attributes [*required*]  | object    | Attributes of an environment.                                                |
| attributes   | created_at                    | date-time | The timestamp when the environment was created.                              |
| attributes   | description                   | string    | The description of the environment.                                          |
| attributes   | is_production                 | boolean   | Indicates whether this is a production environment.                          |
| attributes   | key                           | string    | The unique key of the environment.                                           |
| attributes   | name [*required*]        | string    | The name of the environment.                                                 |
| attributes   | queries                       | [string]  | List of queries to define the environment scope.                             |
| attributes   | require_feature_flag_approval | boolean   | Indicates whether feature flag changes require approval in this environment. |
| attributes   | updated_at                    | date-time | The timestamp when the environment was last updated.                         |
| data         | id [*required*]          | uuid      | The unique identifier of the environment.                                    |
| data         | type [*required*]        | enum      | The resource type. Allowed enum values: `environments`                       |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "created_at": "2023-01-01T00:00:00Z",
      "description": "Test environment XYZ789",
      "is_production": false,
      "key": "env-search-term",
      "name": "env-search-term",
      "queries": [
        "staging",
        "test"
      ],
      "require_feature_flag_approval": false,
      "updated_at": "2023-01-01T00:00:00Z"
    },
    "id": "550e8400-e29b-41d4-a716-446655440001",
    "type": "environments"
  }
}
```

{% /tab %}

{% /tab %}

{% tab title="400" %}
Bad Request
{% 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 %}

{% tab title="403" %}
Forbidden
{% 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 %}

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

{% 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 parametersexport environment_id="550e8400-e29b-41d4-a716-446655440001"\# Curl commandcurl -X PUT "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/feature-flags/environments/${environment_id}" \
-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": {},
    "type": "environments"
  }
}
EOF
                
{% /tab %}

## Get an environment{% #get-an-environment %}

{% tab title="v2" %}

| Datadog site      | API endpoint                                                                         |
| ----------------- | ------------------------------------------------------------------------------------ |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v2/feature-flags/environments/{environment_id} |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v2/feature-flags/environments/{environment_id} |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v2/feature-flags/environments/{environment_id}      |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v2/feature-flags/environments/{environment_id}      |
| app.datadoghq.com | GET https://api.datadoghq.com/api/v2/feature-flags/environments/{environment_id}     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v2/feature-flags/environments/{environment_id} |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v2/feature-flags/environments/{environment_id} |

### Overview

Returns the details of a specific environment. This endpoint requires the `feature_flag_environment_config_read` permission.

### Arguments

#### Path Parameters

| Name                             | Type   | Description                |
| -------------------------------- | ------ | -------------------------- |
| environment_id [*required*] | string | The ID of the environment. |

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response containing an environment.

| Parent field | Field                         | Type      | Description                                                                  |
| ------------ | ----------------------------- | --------- | ---------------------------------------------------------------------------- |
|              | data [*required*]        | object    | A feature flag environment resource.                                         |
| data         | attributes [*required*]  | object    | Attributes of an environment.                                                |
| attributes   | created_at                    | date-time | The timestamp when the environment was created.                              |
| attributes   | description                   | string    | The description of the environment.                                          |
| attributes   | is_production                 | boolean   | Indicates whether this is a production environment.                          |
| attributes   | key                           | string    | The unique key of the environment.                                           |
| attributes   | name [*required*]        | string    | The name of the environment.                                                 |
| attributes   | queries                       | [string]  | List of queries to define the environment scope.                             |
| attributes   | require_feature_flag_approval | boolean   | Indicates whether feature flag changes require approval in this environment. |
| attributes   | updated_at                    | date-time | The timestamp when the environment was last updated.                         |
| data         | id [*required*]          | uuid      | The unique identifier of the environment.                                    |
| data         | type [*required*]        | enum      | The resource type. Allowed enum values: `environments`                       |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "created_at": "2023-01-01T00:00:00Z",
      "description": "Test environment XYZ789",
      "is_production": false,
      "key": "env-search-term",
      "name": "env-search-term",
      "queries": [
        "staging",
        "test"
      ],
      "require_feature_flag_approval": false,
      "updated_at": "2023-01-01T00:00:00Z"
    },
    "id": "550e8400-e29b-41d4-a716-446655440001",
    "type": "environments"
  }
}
```

{% /tab %}

{% /tab %}

{% tab title="403" %}
Forbidden
{% 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 %}

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

{% 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 parametersexport environment_id="550e8400-e29b-41d4-a716-446655440001"\# Curl commandcurl -X GET "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/feature-flags/environments/${environment_id}" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
                
{% /tab %}

## Create an environment{% #create-an-environment %}

{% tab title="v2" %}

| Datadog site      | API endpoint                                                         |
| ----------------- | -------------------------------------------------------------------- |
| ap1.datadoghq.com | POST https://api.ap1.datadoghq.com/api/v2/feature-flags/environments |
| ap2.datadoghq.com | POST https://api.ap2.datadoghq.com/api/v2/feature-flags/environments |
| app.datadoghq.eu  | POST https://api.datadoghq.eu/api/v2/feature-flags/environments      |
| app.ddog-gov.com  | POST https://api.ddog-gov.com/api/v2/feature-flags/environments      |
| app.datadoghq.com | POST https://api.datadoghq.com/api/v2/feature-flags/environments     |
| us3.datadoghq.com | POST https://api.us3.datadoghq.com/api/v2/feature-flags/environments |
| us5.datadoghq.com | POST https://api.us5.datadoghq.com/api/v2/feature-flags/environments |

### Overview

Creates a new environment for organizing feature flags. This endpoint requires the `feature_flag_environment_config_write` permission.

### Request

#### Body Data (required)



{% tab title="Model" %}

| Parent field | Field                         | Type     | Description                                                                  |
| ------------ | ----------------------------- | -------- | ---------------------------------------------------------------------------- |
|              | data [*required*]        | object   | Data for creating a new environment.                                         |
| data         | attributes [*required*]  | object   | Attributes for creating a new environment.                                   |
| attributes   | is_production                 | boolean  | Indicates whether this is a production environment.                          |
| attributes   | name [*required*]        | string   | The name of the environment.                                                 |
| attributes   | queries [*required*]     | [string] | List of queries to define the environment scope.                             |
| attributes   | require_feature_flag_approval | boolean  | Indicates whether feature flag changes require approval in this environment. |
| data         | type [*required*]        | enum     | The resource type. Allowed enum values: `environments`                       |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "type": "environments",
    "attributes": {
      "name": "Test Environment Example-Feature-Flag",
      "queries": [
        "test-Example-Feature-Flag",
        "env-Example-Feature-Flag"
      ]
    }
  }
}
```

{% /tab %}

### Response

{% tab title="201" %}
Created
{% tab title="Model" %}
Response containing an environment.

| Parent field | Field                         | Type      | Description                                                                  |
| ------------ | ----------------------------- | --------- | ---------------------------------------------------------------------------- |
|              | data [*required*]        | object    | A feature flag environment resource.                                         |
| data         | attributes [*required*]  | object    | Attributes of an environment.                                                |
| attributes   | created_at                    | date-time | The timestamp when the environment was created.                              |
| attributes   | description                   | string    | The description of the environment.                                          |
| attributes   | is_production                 | boolean   | Indicates whether this is a production environment.                          |
| attributes   | key                           | string    | The unique key of the environment.                                           |
| attributes   | name [*required*]        | string    | The name of the environment.                                                 |
| attributes   | queries                       | [string]  | List of queries to define the environment scope.                             |
| attributes   | require_feature_flag_approval | boolean   | Indicates whether feature flag changes require approval in this environment. |
| attributes   | updated_at                    | date-time | The timestamp when the environment was last updated.                         |
| data         | id [*required*]          | uuid      | The unique identifier of the environment.                                    |
| data         | type [*required*]        | enum      | The resource type. Allowed enum values: `environments`                       |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "created_at": "2023-01-01T00:00:00Z",
      "description": "Test environment XYZ789",
      "is_production": false,
      "key": "env-search-term",
      "name": "env-search-term",
      "queries": [
        "staging",
        "test"
      ],
      "require_feature_flag_approval": false,
      "updated_at": "2023-01-01T00:00:00Z"
    },
    "id": "550e8400-e29b-41d4-a716-446655440001",
    "type": "environments"
  }
}
```

{% /tab %}

{% /tab %}

{% tab title="400" %}
Bad Request
{% 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 %}

{% tab title="403" %}
Forbidden
{% 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 %}

{% tab title="409" %}
Conflict
{% 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 %}

{% 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

##### 
                          \# Curl commandcurl -X POST "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/feature-flags/environments" \
-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": {
    "type": "environments",
    "attributes": {
      "name": "Test Environment Example-Feature-Flag",
      "queries": [
        "test-Example-Feature-Flag",
        "env-Example-Feature-Flag"
      ]
    }
  }
}
EOF
                        
{% /tab %}

## List environments{% #list-environments %}

{% tab title="v2" %}

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

### Overview

Returns a list of environments for the organization. Supports filtering by name and key. This endpoint requires the `feature_flag_environment_config_read` permission.

### Arguments

#### Query Strings

| Name   | Type    | Description                                     |
| ------ | ------- | ----------------------------------------------- |
| name   | string  | Filter environments by name (partial matching). |
| key    | string  | Filter environments by key (partial matching).  |
| limit  | integer | Maximum number of results to return.            |
| offset | integer | Number of results to skip.                      |

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response containing a list of environments.

| Parent field | Field                         | Type      | Description                                                                  |
| ------------ | ----------------------------- | --------- | ---------------------------------------------------------------------------- |
|              | data [*required*]        | [object]  | List of environments.                                                        |
| data         | attributes [*required*]  | object    | Attributes of an environment.                                                |
| attributes   | created_at                    | date-time | The timestamp when the environment was created.                              |
| attributes   | description                   | string    | The description of the environment.                                          |
| attributes   | is_production                 | boolean   | Indicates whether this is a production environment.                          |
| attributes   | key                           | string    | The unique key of the environment.                                           |
| attributes   | name [*required*]        | string    | The name of the environment.                                                 |
| attributes   | queries                       | [string]  | List of queries to define the environment scope.                             |
| attributes   | require_feature_flag_approval | boolean   | Indicates whether feature flag changes require approval in this environment. |
| attributes   | updated_at                    | date-time | The timestamp when the environment was last updated.                         |
| data         | id [*required*]          | uuid      | The unique identifier of the environment.                                    |
| data         | type [*required*]        | enum      | The resource type. Allowed enum values: `environments`                       |
|              | meta                          | object    | Pagination metadata for environments.                                        |
| meta         | page                          | object    | Pagination metadata for environments list responses.                         |
| page         | total_count                   | int64     | Total number of items.                                                       |
| page         | total_filtered_count          | int64     | Total number of items matching the filter.                                   |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": [
    {
      "attributes": {
        "created_at": "2023-01-01T00:00:00Z",
        "description": "Test environment XYZ789",
        "is_production": false,
        "key": "env-search-term",
        "name": "env-search-term",
        "queries": [
          "staging",
          "test"
        ],
        "require_feature_flag_approval": false,
        "updated_at": "2023-01-01T00:00:00Z"
      },
      "id": "550e8400-e29b-41d4-a716-446655440001",
      "type": "environments"
    }
  ],
  "meta": {
    "page": {
      "total_count": 10,
      "total_filtered_count": 5
    }
  }
}
```

{% /tab %}

{% /tab %}

{% tab title="403" %}
Forbidden
{% 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 %}

{% 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

##### 
                  \# Curl commandcurl -X GET "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/feature-flags/environments" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
                
{% /tab %}

## Stop a progressive rollout{% #stop-a-progressive-rollout %}

{% tab title="v2" %}

| Datadog site      | API endpoint                                                                                           |
| ----------------- | ------------------------------------------------------------------------------------------------------ |
| ap1.datadoghq.com | POST https://api.ap1.datadoghq.com/api/v2/feature-flags/exposure-schedules/{exposure_schedule_id}/stop |
| ap2.datadoghq.com | POST https://api.ap2.datadoghq.com/api/v2/feature-flags/exposure-schedules/{exposure_schedule_id}/stop |
| app.datadoghq.eu  | POST https://api.datadoghq.eu/api/v2/feature-flags/exposure-schedules/{exposure_schedule_id}/stop      |
| app.ddog-gov.com  | POST https://api.ddog-gov.com/api/v2/feature-flags/exposure-schedules/{exposure_schedule_id}/stop      |
| app.datadoghq.com | POST https://api.datadoghq.com/api/v2/feature-flags/exposure-schedules/{exposure_schedule_id}/stop     |
| us3.datadoghq.com | POST https://api.us3.datadoghq.com/api/v2/feature-flags/exposure-schedules/{exposure_schedule_id}/stop |
| us5.datadoghq.com | POST https://api.us5.datadoghq.com/api/v2/feature-flags/exposure-schedules/{exposure_schedule_id}/stop |

### Overview

Stops a progressive rollout and marks it as aborted. This endpoint requires the `feature_flag_config_write` permission.

### Arguments

#### Path Parameters

| Name                                   | Type   | Description                      |
| -------------------------------------- | ------ | -------------------------------- |
| exposure_schedule_id [*required*] | string | The ID of the exposure schedule. |

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response containing a progressive rollout schedule.

| Parent field       | Field                                             | Type      | Description                                                                                                 |
| ------------------ | ------------------------------------------------- | --------- | ----------------------------------------------------------------------------------------------------------- |
|                    | data [*required*]                            | object    | Data wrapper for progressive rollout schedule responses.                                                    |
| data               | attributes [*required*]                      | object    | Progressive release details for a targeting rule allocation.                                                |
| attributes         | absolute_start_time                               | date-time | The absolute UTC start time for this schedule.                                                              |
| attributes         | allocation_id [*required*]                   | uuid      | The targeting rule allocation ID this progressive rollout belongs to.                                       |
| attributes         | control_variant_id                                | string    | The control variant ID used for experiment comparisons.                                                     |
| attributes         | created_at [*required*]                      | date-time | The timestamp when the schedule was created.                                                                |
| attributes         | guardrail_triggered_action                        | string    | Last guardrail action triggered for this schedule.                                                          |
| attributes         | guardrail_triggers [*required*]              | [object]  | Guardrail trigger records for this schedule.                                                                |
| guardrail_triggers | allocation_exposure_schedule_id [*required*] | uuid      | The progressive rollout ID this trigger belongs to.                                                         |
| guardrail_triggers | created_at [*required*]                      | date-time | The timestamp when this trigger was created.                                                                |
| guardrail_triggers | flagging_variant_id [*required*]             | uuid      | The variant ID that triggered this event.                                                                   |
| guardrail_triggers | id [*required*]                              | uuid      | The unique identifier of the guardrail trigger.                                                             |
| guardrail_triggers | metric_id [*required*]                       | string    | The metric ID associated with the trigger.                                                                  |
| guardrail_triggers | triggered_action [*required*]                | string    | The action that was triggered.                                                                              |
| guardrail_triggers | updated_at [*required*]                      | date-time | The timestamp when this trigger was last updated.                                                           |
| attributes         | id                                                | uuid      | The unique identifier of the progressive rollout.                                                           |
| attributes         | rollout_options [*required*]                 | object    | Applied progression options for a progressive rollout.                                                      |
| rollout_options    | autostart [*required*]                       | boolean   | Whether the schedule starts automatically.                                                                  |
| rollout_options    | selection_interval_ms [*required*]           | int64     | Interval in milliseconds for uniform interval strategies.                                                   |
| rollout_options    | strategy [*required*]                        | enum      | The progression strategy used by a progressive rollout. Allowed enum values: `UNIFORM_INTERVALS,NO_ROLLOUT` |
| attributes         | rollout_steps [*required*]                   | [object]  | Ordered progression steps for exposure.                                                                     |
| rollout_steps      | allocation_exposure_schedule_id [*required*] | uuid      | The progressive rollout ID this step belongs to.                                                            |
| rollout_steps      | created_at [*required*]                      | date-time | The timestamp when the progression step was created.                                                        |
| rollout_steps      | exposure_ratio [*required*]                  | double    | The exposure ratio for this step.                                                                           |
| rollout_steps      | grouped_step_index [*required*]              | int64     | Logical index grouping related steps.                                                                       |
| rollout_steps      | id [*required*]                              | uuid      | The unique identifier of the progression step.                                                              |
| rollout_steps      | interval_ms                                       | int64     | Step duration in milliseconds.                                                                              |
| rollout_steps      | is_pause_record [*required*]                 | boolean   | Whether this step represents a pause record.                                                                |
| rollout_steps      | order_position [*required*]                  | int64     | Sort order for the progression step.                                                                        |
| rollout_steps      | updated_at [*required*]                      | date-time | The timestamp when the progression step was last updated.                                                   |
| attributes         | updated_at [*required*]                      | date-time | The timestamp when the schedule was last updated.                                                           |
| data               | id [*required*]                              | uuid      | The unique identifier of the progressive rollout.                                                           |
| data               | type [*required*]                            | enum      | The resource type for progressive rollout schedules. Allowed enum values: `allocation_exposure_schedules`   |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "absolute_start_time": "2025-06-13T12:00:00Z",
      "allocation_id": "550e8400-e29b-41d4-a716-446655440020",
      "control_variant_id": "550e8400-e29b-41d4-a716-446655440012",
      "created_at": "2024-01-01T12:00:00Z",
      "guardrail_triggered_action": "PAUSE",
      "guardrail_triggers": [
        {
          "allocation_exposure_schedule_id": "550e8400-e29b-41d4-a716-446655440010",
          "created_at": "2024-01-01T12:00:00Z",
          "flagging_variant_id": "550e8400-e29b-41d4-a716-446655440001",
          "id": "550e8400-e29b-41d4-a716-446655440080",
          "metric_id": "metric-error-rate",
          "triggered_action": "PAUSE",
          "updated_at": "2024-01-01T12:00:00Z"
        }
      ],
      "id": "550e8400-e29b-41d4-a716-446655440010",
      "rollout_options": {
        "autostart": false,
        "selection_interval_ms": 3600000,
        "strategy": "UNIFORM_INTERVALS"
      },
      "rollout_steps": [
        {
          "allocation_exposure_schedule_id": "550e8400-e29b-41d4-a716-446655440010",
          "created_at": "2024-01-01T12:00:00Z",
          "exposure_ratio": 0.1,
          "grouped_step_index": 0,
          "id": "550e8400-e29b-41d4-a716-446655440040",
          "interval_ms": 3600000,
          "is_pause_record": false,
          "order_position": 0,
          "updated_at": "2024-01-01T12:00:00Z"
        }
      ],
      "updated_at": "2024-01-01T12:00:00Z"
    },
    "id": "550e8400-e29b-41d4-a716-446655440010",
    "type": "allocation_exposure_schedules"
  }
}
```

{% /tab %}

{% /tab %}

{% tab title="400" %}
Bad Request
{% 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 %}

{% tab title="403" %}
Forbidden
{% 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 %}

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

{% tab title="409" %}
Conflict
{% 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 %}

{% 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 parametersexport exposure_schedule_id="550e8400-e29b-41d4-a716-446655440010"\# Curl commandcurl -X POST "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/feature-flags/exposure-schedules/${exposure_schedule_id}/stop" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
                
{% /tab %}

## Resume a progressive rollout{% #resume-a-progressive-rollout %}

{% tab title="v2" %}

| Datadog site      | API endpoint                                                                                             |
| ----------------- | -------------------------------------------------------------------------------------------------------- |
| ap1.datadoghq.com | POST https://api.ap1.datadoghq.com/api/v2/feature-flags/exposure-schedules/{exposure_schedule_id}/resume |
| ap2.datadoghq.com | POST https://api.ap2.datadoghq.com/api/v2/feature-flags/exposure-schedules/{exposure_schedule_id}/resume |
| app.datadoghq.eu  | POST https://api.datadoghq.eu/api/v2/feature-flags/exposure-schedules/{exposure_schedule_id}/resume      |
| app.ddog-gov.com  | POST https://api.ddog-gov.com/api/v2/feature-flags/exposure-schedules/{exposure_schedule_id}/resume      |
| app.datadoghq.com | POST https://api.datadoghq.com/api/v2/feature-flags/exposure-schedules/{exposure_schedule_id}/resume     |
| us3.datadoghq.com | POST https://api.us3.datadoghq.com/api/v2/feature-flags/exposure-schedules/{exposure_schedule_id}/resume |
| us5.datadoghq.com | POST https://api.us5.datadoghq.com/api/v2/feature-flags/exposure-schedules/{exposure_schedule_id}/resume |

### Overview

Resumes progression for a previously paused progressive rollout. This endpoint requires the `feature_flag_config_write` permission.

### Arguments

#### Path Parameters

| Name                                   | Type   | Description                      |
| -------------------------------------- | ------ | -------------------------------- |
| exposure_schedule_id [*required*] | string | The ID of the exposure schedule. |

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response containing a progressive rollout schedule.

| Parent field       | Field                                             | Type      | Description                                                                                                 |
| ------------------ | ------------------------------------------------- | --------- | ----------------------------------------------------------------------------------------------------------- |
|                    | data [*required*]                            | object    | Data wrapper for progressive rollout schedule responses.                                                    |
| data               | attributes [*required*]                      | object    | Progressive release details for a targeting rule allocation.                                                |
| attributes         | absolute_start_time                               | date-time | The absolute UTC start time for this schedule.                                                              |
| attributes         | allocation_id [*required*]                   | uuid      | The targeting rule allocation ID this progressive rollout belongs to.                                       |
| attributes         | control_variant_id                                | string    | The control variant ID used for experiment comparisons.                                                     |
| attributes         | created_at [*required*]                      | date-time | The timestamp when the schedule was created.                                                                |
| attributes         | guardrail_triggered_action                        | string    | Last guardrail action triggered for this schedule.                                                          |
| attributes         | guardrail_triggers [*required*]              | [object]  | Guardrail trigger records for this schedule.                                                                |
| guardrail_triggers | allocation_exposure_schedule_id [*required*] | uuid      | The progressive rollout ID this trigger belongs to.                                                         |
| guardrail_triggers | created_at [*required*]                      | date-time | The timestamp when this trigger was created.                                                                |
| guardrail_triggers | flagging_variant_id [*required*]             | uuid      | The variant ID that triggered this event.                                                                   |
| guardrail_triggers | id [*required*]                              | uuid      | The unique identifier of the guardrail trigger.                                                             |
| guardrail_triggers | metric_id [*required*]                       | string    | The metric ID associated with the trigger.                                                                  |
| guardrail_triggers | triggered_action [*required*]                | string    | The action that was triggered.                                                                              |
| guardrail_triggers | updated_at [*required*]                      | date-time | The timestamp when this trigger was last updated.                                                           |
| attributes         | id                                                | uuid      | The unique identifier of the progressive rollout.                                                           |
| attributes         | rollout_options [*required*]                 | object    | Applied progression options for a progressive rollout.                                                      |
| rollout_options    | autostart [*required*]                       | boolean   | Whether the schedule starts automatically.                                                                  |
| rollout_options    | selection_interval_ms [*required*]           | int64     | Interval in milliseconds for uniform interval strategies.                                                   |
| rollout_options    | strategy [*required*]                        | enum      | The progression strategy used by a progressive rollout. Allowed enum values: `UNIFORM_INTERVALS,NO_ROLLOUT` |
| attributes         | rollout_steps [*required*]                   | [object]  | Ordered progression steps for exposure.                                                                     |
| rollout_steps      | allocation_exposure_schedule_id [*required*] | uuid      | The progressive rollout ID this step belongs to.                                                            |
| rollout_steps      | created_at [*required*]                      | date-time | The timestamp when the progression step was created.                                                        |
| rollout_steps      | exposure_ratio [*required*]                  | double    | The exposure ratio for this step.                                                                           |
| rollout_steps      | grouped_step_index [*required*]              | int64     | Logical index grouping related steps.                                                                       |
| rollout_steps      | id [*required*]                              | uuid      | The unique identifier of the progression step.                                                              |
| rollout_steps      | interval_ms                                       | int64     | Step duration in milliseconds.                                                                              |
| rollout_steps      | is_pause_record [*required*]                 | boolean   | Whether this step represents a pause record.                                                                |
| rollout_steps      | order_position [*required*]                  | int64     | Sort order for the progression step.                                                                        |
| rollout_steps      | updated_at [*required*]                      | date-time | The timestamp when the progression step was last updated.                                                   |
| attributes         | updated_at [*required*]                      | date-time | The timestamp when the schedule was last updated.                                                           |
| data               | id [*required*]                              | uuid      | The unique identifier of the progressive rollout.                                                           |
| data               | type [*required*]                            | enum      | The resource type for progressive rollout schedules. Allowed enum values: `allocation_exposure_schedules`   |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "absolute_start_time": "2025-06-13T12:00:00Z",
      "allocation_id": "550e8400-e29b-41d4-a716-446655440020",
      "control_variant_id": "550e8400-e29b-41d4-a716-446655440012",
      "created_at": "2024-01-01T12:00:00Z",
      "guardrail_triggered_action": "PAUSE",
      "guardrail_triggers": [
        {
          "allocation_exposure_schedule_id": "550e8400-e29b-41d4-a716-446655440010",
          "created_at": "2024-01-01T12:00:00Z",
          "flagging_variant_id": "550e8400-e29b-41d4-a716-446655440001",
          "id": "550e8400-e29b-41d4-a716-446655440080",
          "metric_id": "metric-error-rate",
          "triggered_action": "PAUSE",
          "updated_at": "2024-01-01T12:00:00Z"
        }
      ],
      "id": "550e8400-e29b-41d4-a716-446655440010",
      "rollout_options": {
        "autostart": false,
        "selection_interval_ms": 3600000,
        "strategy": "UNIFORM_INTERVALS"
      },
      "rollout_steps": [
        {
          "allocation_exposure_schedule_id": "550e8400-e29b-41d4-a716-446655440010",
          "created_at": "2024-01-01T12:00:00Z",
          "exposure_ratio": 0.1,
          "grouped_step_index": 0,
          "id": "550e8400-e29b-41d4-a716-446655440040",
          "interval_ms": 3600000,
          "is_pause_record": false,
          "order_position": 0,
          "updated_at": "2024-01-01T12:00:00Z"
        }
      ],
      "updated_at": "2024-01-01T12:00:00Z"
    },
    "id": "550e8400-e29b-41d4-a716-446655440010",
    "type": "allocation_exposure_schedules"
  }
}
```

{% /tab %}

{% /tab %}

{% tab title="400" %}
Bad Request
{% 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 %}

{% tab title="403" %}
Forbidden
{% 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 %}

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

{% tab title="409" %}
Conflict
{% 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 %}

{% 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 parametersexport exposure_schedule_id="550e8400-e29b-41d4-a716-446655440010"\# Curl commandcurl -X POST "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/feature-flags/exposure-schedules/${exposure_schedule_id}/resume" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
                
{% /tab %}

## Pause a progressive rollout{% #pause-a-progressive-rollout %}

{% tab title="v2" %}

| Datadog site      | API endpoint                                                                                            |
| ----------------- | ------------------------------------------------------------------------------------------------------- |
| ap1.datadoghq.com | POST https://api.ap1.datadoghq.com/api/v2/feature-flags/exposure-schedules/{exposure_schedule_id}/pause |
| ap2.datadoghq.com | POST https://api.ap2.datadoghq.com/api/v2/feature-flags/exposure-schedules/{exposure_schedule_id}/pause |
| app.datadoghq.eu  | POST https://api.datadoghq.eu/api/v2/feature-flags/exposure-schedules/{exposure_schedule_id}/pause      |
| app.ddog-gov.com  | POST https://api.ddog-gov.com/api/v2/feature-flags/exposure-schedules/{exposure_schedule_id}/pause      |
| app.datadoghq.com | POST https://api.datadoghq.com/api/v2/feature-flags/exposure-schedules/{exposure_schedule_id}/pause     |
| us3.datadoghq.com | POST https://api.us3.datadoghq.com/api/v2/feature-flags/exposure-schedules/{exposure_schedule_id}/pause |
| us5.datadoghq.com | POST https://api.us5.datadoghq.com/api/v2/feature-flags/exposure-schedules/{exposure_schedule_id}/pause |

### Overview

Pauses a progressive rollout while preserving rollout state. This endpoint requires the `feature_flag_config_write` permission.

### Arguments

#### Path Parameters

| Name                                   | Type   | Description                      |
| -------------------------------------- | ------ | -------------------------------- |
| exposure_schedule_id [*required*] | string | The ID of the exposure schedule. |

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response containing a progressive rollout schedule.

| Parent field       | Field                                             | Type      | Description                                                                                                 |
| ------------------ | ------------------------------------------------- | --------- | ----------------------------------------------------------------------------------------------------------- |
|                    | data [*required*]                            | object    | Data wrapper for progressive rollout schedule responses.                                                    |
| data               | attributes [*required*]                      | object    | Progressive release details for a targeting rule allocation.                                                |
| attributes         | absolute_start_time                               | date-time | The absolute UTC start time for this schedule.                                                              |
| attributes         | allocation_id [*required*]                   | uuid      | The targeting rule allocation ID this progressive rollout belongs to.                                       |
| attributes         | control_variant_id                                | string    | The control variant ID used for experiment comparisons.                                                     |
| attributes         | created_at [*required*]                      | date-time | The timestamp when the schedule was created.                                                                |
| attributes         | guardrail_triggered_action                        | string    | Last guardrail action triggered for this schedule.                                                          |
| attributes         | guardrail_triggers [*required*]              | [object]  | Guardrail trigger records for this schedule.                                                                |
| guardrail_triggers | allocation_exposure_schedule_id [*required*] | uuid      | The progressive rollout ID this trigger belongs to.                                                         |
| guardrail_triggers | created_at [*required*]                      | date-time | The timestamp when this trigger was created.                                                                |
| guardrail_triggers | flagging_variant_id [*required*]             | uuid      | The variant ID that triggered this event.                                                                   |
| guardrail_triggers | id [*required*]                              | uuid      | The unique identifier of the guardrail trigger.                                                             |
| guardrail_triggers | metric_id [*required*]                       | string    | The metric ID associated with the trigger.                                                                  |
| guardrail_triggers | triggered_action [*required*]                | string    | The action that was triggered.                                                                              |
| guardrail_triggers | updated_at [*required*]                      | date-time | The timestamp when this trigger was last updated.                                                           |
| attributes         | id                                                | uuid      | The unique identifier of the progressive rollout.                                                           |
| attributes         | rollout_options [*required*]                 | object    | Applied progression options for a progressive rollout.                                                      |
| rollout_options    | autostart [*required*]                       | boolean   | Whether the schedule starts automatically.                                                                  |
| rollout_options    | selection_interval_ms [*required*]           | int64     | Interval in milliseconds for uniform interval strategies.                                                   |
| rollout_options    | strategy [*required*]                        | enum      | The progression strategy used by a progressive rollout. Allowed enum values: `UNIFORM_INTERVALS,NO_ROLLOUT` |
| attributes         | rollout_steps [*required*]                   | [object]  | Ordered progression steps for exposure.                                                                     |
| rollout_steps      | allocation_exposure_schedule_id [*required*] | uuid      | The progressive rollout ID this step belongs to.                                                            |
| rollout_steps      | created_at [*required*]                      | date-time | The timestamp when the progression step was created.                                                        |
| rollout_steps      | exposure_ratio [*required*]                  | double    | The exposure ratio for this step.                                                                           |
| rollout_steps      | grouped_step_index [*required*]              | int64     | Logical index grouping related steps.                                                                       |
| rollout_steps      | id [*required*]                              | uuid      | The unique identifier of the progression step.                                                              |
| rollout_steps      | interval_ms                                       | int64     | Step duration in milliseconds.                                                                              |
| rollout_steps      | is_pause_record [*required*]                 | boolean   | Whether this step represents a pause record.                                                                |
| rollout_steps      | order_position [*required*]                  | int64     | Sort order for the progression step.                                                                        |
| rollout_steps      | updated_at [*required*]                      | date-time | The timestamp when the progression step was last updated.                                                   |
| attributes         | updated_at [*required*]                      | date-time | The timestamp when the schedule was last updated.                                                           |
| data               | id [*required*]                              | uuid      | The unique identifier of the progressive rollout.                                                           |
| data               | type [*required*]                            | enum      | The resource type for progressive rollout schedules. Allowed enum values: `allocation_exposure_schedules`   |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "absolute_start_time": "2025-06-13T12:00:00Z",
      "allocation_id": "550e8400-e29b-41d4-a716-446655440020",
      "control_variant_id": "550e8400-e29b-41d4-a716-446655440012",
      "created_at": "2024-01-01T12:00:00Z",
      "guardrail_triggered_action": "PAUSE",
      "guardrail_triggers": [
        {
          "allocation_exposure_schedule_id": "550e8400-e29b-41d4-a716-446655440010",
          "created_at": "2024-01-01T12:00:00Z",
          "flagging_variant_id": "550e8400-e29b-41d4-a716-446655440001",
          "id": "550e8400-e29b-41d4-a716-446655440080",
          "metric_id": "metric-error-rate",
          "triggered_action": "PAUSE",
          "updated_at": "2024-01-01T12:00:00Z"
        }
      ],
      "id": "550e8400-e29b-41d4-a716-446655440010",
      "rollout_options": {
        "autostart": false,
        "selection_interval_ms": 3600000,
        "strategy": "UNIFORM_INTERVALS"
      },
      "rollout_steps": [
        {
          "allocation_exposure_schedule_id": "550e8400-e29b-41d4-a716-446655440010",
          "created_at": "2024-01-01T12:00:00Z",
          "exposure_ratio": 0.1,
          "grouped_step_index": 0,
          "id": "550e8400-e29b-41d4-a716-446655440040",
          "interval_ms": 3600000,
          "is_pause_record": false,
          "order_position": 0,
          "updated_at": "2024-01-01T12:00:00Z"
        }
      ],
      "updated_at": "2024-01-01T12:00:00Z"
    },
    "id": "550e8400-e29b-41d4-a716-446655440010",
    "type": "allocation_exposure_schedules"
  }
}
```

{% /tab %}

{% /tab %}

{% tab title="400" %}
Bad Request
{% 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 %}

{% tab title="403" %}
Forbidden
{% 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 %}

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

{% tab title="409" %}
Conflict
{% 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 %}

{% 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 parametersexport exposure_schedule_id="550e8400-e29b-41d4-a716-446655440010"\# Curl commandcurl -X POST "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/feature-flags/exposure-schedules/${exposure_schedule_id}/pause" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
                
{% /tab %}

## Start a progressive rollout{% #start-a-progressive-rollout %}

{% tab title="v2" %}

| Datadog site      | API endpoint                                                                                            |
| ----------------- | ------------------------------------------------------------------------------------------------------- |
| ap1.datadoghq.com | POST https://api.ap1.datadoghq.com/api/v2/feature-flags/exposure-schedules/{exposure_schedule_id}/start |
| ap2.datadoghq.com | POST https://api.ap2.datadoghq.com/api/v2/feature-flags/exposure-schedules/{exposure_schedule_id}/start |
| app.datadoghq.eu  | POST https://api.datadoghq.eu/api/v2/feature-flags/exposure-schedules/{exposure_schedule_id}/start      |
| app.ddog-gov.com  | POST https://api.ddog-gov.com/api/v2/feature-flags/exposure-schedules/{exposure_schedule_id}/start      |
| app.datadoghq.com | POST https://api.datadoghq.com/api/v2/feature-flags/exposure-schedules/{exposure_schedule_id}/start     |
| us3.datadoghq.com | POST https://api.us3.datadoghq.com/api/v2/feature-flags/exposure-schedules/{exposure_schedule_id}/start |
| us5.datadoghq.com | POST https://api.us5.datadoghq.com/api/v2/feature-flags/exposure-schedules/{exposure_schedule_id}/start |

### Overview

Starts a progressive rollout and begins progression. This endpoint requires the `feature_flag_config_write` permission.

### Arguments

#### Path Parameters

| Name                                   | Type   | Description                      |
| -------------------------------------- | ------ | -------------------------------- |
| exposure_schedule_id [*required*] | string | The ID of the exposure schedule. |

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response containing a progressive rollout schedule.

| Parent field       | Field                                             | Type      | Description                                                                                                 |
| ------------------ | ------------------------------------------------- | --------- | ----------------------------------------------------------------------------------------------------------- |
|                    | data [*required*]                            | object    | Data wrapper for progressive rollout schedule responses.                                                    |
| data               | attributes [*required*]                      | object    | Progressive release details for a targeting rule allocation.                                                |
| attributes         | absolute_start_time                               | date-time | The absolute UTC start time for this schedule.                                                              |
| attributes         | allocation_id [*required*]                   | uuid      | The targeting rule allocation ID this progressive rollout belongs to.                                       |
| attributes         | control_variant_id                                | string    | The control variant ID used for experiment comparisons.                                                     |
| attributes         | created_at [*required*]                      | date-time | The timestamp when the schedule was created.                                                                |
| attributes         | guardrail_triggered_action                        | string    | Last guardrail action triggered for this schedule.                                                          |
| attributes         | guardrail_triggers [*required*]              | [object]  | Guardrail trigger records for this schedule.                                                                |
| guardrail_triggers | allocation_exposure_schedule_id [*required*] | uuid      | The progressive rollout ID this trigger belongs to.                                                         |
| guardrail_triggers | created_at [*required*]                      | date-time | The timestamp when this trigger was created.                                                                |
| guardrail_triggers | flagging_variant_id [*required*]             | uuid      | The variant ID that triggered this event.                                                                   |
| guardrail_triggers | id [*required*]                              | uuid      | The unique identifier of the guardrail trigger.                                                             |
| guardrail_triggers | metric_id [*required*]                       | string    | The metric ID associated with the trigger.                                                                  |
| guardrail_triggers | triggered_action [*required*]                | string    | The action that was triggered.                                                                              |
| guardrail_triggers | updated_at [*required*]                      | date-time | The timestamp when this trigger was last updated.                                                           |
| attributes         | id                                                | uuid      | The unique identifier of the progressive rollout.                                                           |
| attributes         | rollout_options [*required*]                 | object    | Applied progression options for a progressive rollout.                                                      |
| rollout_options    | autostart [*required*]                       | boolean   | Whether the schedule starts automatically.                                                                  |
| rollout_options    | selection_interval_ms [*required*]           | int64     | Interval in milliseconds for uniform interval strategies.                                                   |
| rollout_options    | strategy [*required*]                        | enum      | The progression strategy used by a progressive rollout. Allowed enum values: `UNIFORM_INTERVALS,NO_ROLLOUT` |
| attributes         | rollout_steps [*required*]                   | [object]  | Ordered progression steps for exposure.                                                                     |
| rollout_steps      | allocation_exposure_schedule_id [*required*] | uuid      | The progressive rollout ID this step belongs to.                                                            |
| rollout_steps      | created_at [*required*]                      | date-time | The timestamp when the progression step was created.                                                        |
| rollout_steps      | exposure_ratio [*required*]                  | double    | The exposure ratio for this step.                                                                           |
| rollout_steps      | grouped_step_index [*required*]              | int64     | Logical index grouping related steps.                                                                       |
| rollout_steps      | id [*required*]                              | uuid      | The unique identifier of the progression step.                                                              |
| rollout_steps      | interval_ms                                       | int64     | Step duration in milliseconds.                                                                              |
| rollout_steps      | is_pause_record [*required*]                 | boolean   | Whether this step represents a pause record.                                                                |
| rollout_steps      | order_position [*required*]                  | int64     | Sort order for the progression step.                                                                        |
| rollout_steps      | updated_at [*required*]                      | date-time | The timestamp when the progression step was last updated.                                                   |
| attributes         | updated_at [*required*]                      | date-time | The timestamp when the schedule was last updated.                                                           |
| data               | id [*required*]                              | uuid      | The unique identifier of the progressive rollout.                                                           |
| data               | type [*required*]                            | enum      | The resource type for progressive rollout schedules. Allowed enum values: `allocation_exposure_schedules`   |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "absolute_start_time": "2025-06-13T12:00:00Z",
      "allocation_id": "550e8400-e29b-41d4-a716-446655440020",
      "control_variant_id": "550e8400-e29b-41d4-a716-446655440012",
      "created_at": "2024-01-01T12:00:00Z",
      "guardrail_triggered_action": "PAUSE",
      "guardrail_triggers": [
        {
          "allocation_exposure_schedule_id": "550e8400-e29b-41d4-a716-446655440010",
          "created_at": "2024-01-01T12:00:00Z",
          "flagging_variant_id": "550e8400-e29b-41d4-a716-446655440001",
          "id": "550e8400-e29b-41d4-a716-446655440080",
          "metric_id": "metric-error-rate",
          "triggered_action": "PAUSE",
          "updated_at": "2024-01-01T12:00:00Z"
        }
      ],
      "id": "550e8400-e29b-41d4-a716-446655440010",
      "rollout_options": {
        "autostart": false,
        "selection_interval_ms": 3600000,
        "strategy": "UNIFORM_INTERVALS"
      },
      "rollout_steps": [
        {
          "allocation_exposure_schedule_id": "550e8400-e29b-41d4-a716-446655440010",
          "created_at": "2024-01-01T12:00:00Z",
          "exposure_ratio": 0.1,
          "grouped_step_index": 0,
          "id": "550e8400-e29b-41d4-a716-446655440040",
          "interval_ms": 3600000,
          "is_pause_record": false,
          "order_position": 0,
          "updated_at": "2024-01-01T12:00:00Z"
        }
      ],
      "updated_at": "2024-01-01T12:00:00Z"
    },
    "id": "550e8400-e29b-41d4-a716-446655440010",
    "type": "allocation_exposure_schedules"
  }
}
```

{% /tab %}

{% /tab %}

{% tab title="400" %}
Bad Request
{% 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 %}

{% tab title="403" %}
Forbidden
{% 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 %}

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

{% tab title="409" %}
Conflict
{% 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 %}

{% 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 parametersexport exposure_schedule_id="550e8400-e29b-41d4-a716-446655440010"\# Curl commandcurl -X POST "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/feature-flags/exposure-schedules/${exposure_schedule_id}/start" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
                
{% /tab %}

## Update targeting rules for a flag{% #update-targeting-rules-for-a-flag %}

{% tab title="v2" %}

| Datadog site      | API endpoint                                                                                                       |
| ----------------- | ------------------------------------------------------------------------------------------------------------------ |
| ap1.datadoghq.com | PUT https://api.ap1.datadoghq.com/api/v2/feature-flags/{feature_flag_id}/environments/{environment_id}/allocations |
| ap2.datadoghq.com | PUT https://api.ap2.datadoghq.com/api/v2/feature-flags/{feature_flag_id}/environments/{environment_id}/allocations |
| app.datadoghq.eu  | PUT https://api.datadoghq.eu/api/v2/feature-flags/{feature_flag_id}/environments/{environment_id}/allocations      |
| app.ddog-gov.com  | PUT https://api.ddog-gov.com/api/v2/feature-flags/{feature_flag_id}/environments/{environment_id}/allocations      |
| app.datadoghq.com | PUT https://api.datadoghq.com/api/v2/feature-flags/{feature_flag_id}/environments/{environment_id}/allocations     |
| us3.datadoghq.com | PUT https://api.us3.datadoghq.com/api/v2/feature-flags/{feature_flag_id}/environments/{environment_id}/allocations |
| us5.datadoghq.com | PUT https://api.us5.datadoghq.com/api/v2/feature-flags/{feature_flag_id}/environments/{environment_id}/allocations |

### Overview

Updates targeting rules (allocations) for a specific feature flag in a specific environment. This operation replaces the existing allocation set with the request payload. This endpoint requires the `feature_flag_config_write` permission.

### Arguments

#### Path Parameters

| Name                              | Type   | Description                 |
| --------------------------------- | ------ | --------------------------- |
| feature_flag_id [*required*] | string | The ID of the feature flag. |
| environment_id [*required*]  | string | The ID of the environment.  |

### Request

#### Body Data (required)



{% tab title="Model" %}

| Parent field      | Field                                | Type      | Description                                                                                                                           |
| ----------------- | ------------------------------------ | --------- | ------------------------------------------------------------------------------------------------------------------------------------- |
|                   | data [*required*]               | [object]  | Targeting rules (allocations) to replace existing ones with.                                                                          |
| data              | attributes [*required*]         | object    | Request to create or update a targeting rule (allocation) for a feature flag environment.                                             |
| attributes        | experiment_id                        | string    | The experiment ID for experiment-linked allocations.                                                                                  |
| attributes        | exposure_schedule                    | object    | Progressive release request payload.                                                                                                  |
| exposure_schedule | absolute_start_time                  | date-time | The absolute UTC start time for this schedule.                                                                                        |
| exposure_schedule | control_variant_id                   | string    | The control variant ID used for experiment comparisons.                                                                               |
| exposure_schedule | control_variant_key                  | string    | The control variant key used during creation workflows.                                                                               |
| exposure_schedule | id                                   | uuid      | The unique identifier of the progressive rollout.                                                                                     |
| exposure_schedule | rollout_options [*required*]    | object    | Rollout options request payload.                                                                                                      |
| rollout_options   | autostart                            | boolean   | Whether the schedule should begin automatically.                                                                                      |
| rollout_options   | selection_interval_ms                | int64     | Interval in milliseconds for uniform interval strategies.                                                                             |
| rollout_options   | strategy [*required*]           | enum      | The progression strategy used by a progressive rollout. Allowed enum values: `UNIFORM_INTERVALS,NO_ROLLOUT`                           |
| exposure_schedule | rollout_steps [*required*]      | [object]  | Ordered progression steps for exposure.                                                                                               |
| rollout_steps     | exposure_ratio [*required*]     | double    | The exposure ratio for this step.                                                                                                     |
| rollout_steps     | grouped_step_index [*required*] | int64     | Logical index grouping related steps.                                                                                                 |
| rollout_steps     | id                                   | uuid      | The unique identifier of the progression step.                                                                                        |
| rollout_steps     | interval_ms                          | int64     | Step duration in milliseconds.                                                                                                        |
| rollout_steps     | is_pause_record [*required*]    | boolean   | Whether this step represents a pause record.                                                                                          |
| attributes        | guardrail_metrics                    | [object]  | Guardrail metrics used to monitor and auto-pause or abort.                                                                            |
| guardrail_metrics | metric_id [*required*]          | string    | The metric ID to monitor.                                                                                                             |
| guardrail_metrics | trigger_action [*required*]     | enum      | Action to perform when a guardrail threshold is triggered. Allowed enum values: `PAUSE,ABORT`                                         |
| attributes        | id                                   | uuid      | The unique identifier of the targeting rule allocation.                                                                               |
| attributes        | key [*required*]                | string    | The unique key of the targeting rule allocation.                                                                                      |
| attributes        | name [*required*]               | string    | The display name of the targeting rule.                                                                                               |
| attributes        | targeting_rules                      | [object]  | Targeting rules that determine audience eligibility.                                                                                  |
| targeting_rules   | conditions [*required*]         | [object]  | Conditions that must match for this rule.                                                                                             |
| conditions        | attribute [*required*]          | string    | The user or request attribute to evaluate.                                                                                            |
| conditions        | operator [*required*]           | enum      | The operator used in a targeting condition. Allowed enum values: `LT,LTE,GT,GTE,MATCHES,NOT_MATCHES,ONE_OF,NOT_ONE_OF,IS_NULL,EQUALS` |
| conditions        | value [*required*]              | [string]  | Values used by the selected operator.                                                                                                 |
| attributes        | type [*required*]               | enum      | The type of targeting rule (called allocation in the API model). Allowed enum values: `FEATURE_GATE,CANARY`                           |
| attributes        | variant_weights                      | [object]  | Variant distribution weights.                                                                                                         |
| variant_weights   | value [*required*]              | double    | The percentage weight for this variant.                                                                                               |
| variant_weights   | variant_id                           | uuid      | The variant ID to assign weight to.                                                                                                   |
| variant_weights   | variant_key                          | string    | The variant key to assign weight to.                                                                                                  |
| data              | type [*required*]               | enum      | The resource type. Allowed enum values: `allocations`                                                                                 |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": [
    {
      "type": "allocations",
      "attributes": {
        "key": "overwrite-allocation-example-feature-flag",
        "name": "New targeting rule Example-Feature-Flag",
        "targeting_rules": [],
        "variant_weights": [
          {
            "variant_id": "550e8400-e29b-41d4-a716-446655440002",
            "value": 100
          }
        ],
        "exposure_schedule": {
          "rollout_options": {
            "strategy": "UNIFORM_INTERVALS",
            "autostart": false,
            "selection_interval_ms": 86400000
          },
          "rollout_steps": [
            {
              "exposure_ratio": 0.05,
              "interval_ms": null,
              "is_pause_record": false,
              "grouped_step_index": 0
            },
            {
              "exposure_ratio": 0.25,
              "interval_ms": null,
              "is_pause_record": false,
              "grouped_step_index": 1
            },
            {
              "exposure_ratio": 1,
              "interval_ms": null,
              "is_pause_record": false,
              "grouped_step_index": 2
            }
          ]
        },
        "guardrail_metrics": [],
        "type": "CANARY"
      }
    }
  ]
}
```

{% /tab %}

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response containing a list of targeting rules (allocations).

| Parent field       | Field                                             | Type      | Description                                                                                                                           |
| ------------------ | ------------------------------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------- |
|                    | data [*required*]                            | [object]  | List of targeting rules (allocations).                                                                                                |
| data               | attributes [*required*]                      | object    | Targeting rule (allocation) details for a feature flag environment.                                                                   |
| attributes         | created_at [*required*]                      | date-time | The timestamp when the targeting rule allocation was created.                                                                         |
| attributes         | environment_ids [*required*]                 | [string]  | Environment IDs associated with this targeting rule allocation.                                                                       |
| attributes         | experiment_id                                     | string    | The experiment ID linked to this targeting rule allocation.                                                                           |
| attributes         | exposure_schedule                                 | object    | Progressive release details for a targeting rule allocation.                                                                          |
| exposure_schedule  | absolute_start_time                               | date-time | The absolute UTC start time for this schedule.                                                                                        |
| exposure_schedule  | allocation_id [*required*]                   | uuid      | The targeting rule allocation ID this progressive rollout belongs to.                                                                 |
| exposure_schedule  | control_variant_id                                | string    | The control variant ID used for experiment comparisons.                                                                               |
| exposure_schedule  | created_at [*required*]                      | date-time | The timestamp when the schedule was created.                                                                                          |
| exposure_schedule  | guardrail_triggered_action                        | string    | Last guardrail action triggered for this schedule.                                                                                    |
| exposure_schedule  | guardrail_triggers [*required*]              | [object]  | Guardrail trigger records for this schedule.                                                                                          |
| guardrail_triggers | allocation_exposure_schedule_id [*required*] | uuid      | The progressive rollout ID this trigger belongs to.                                                                                   |
| guardrail_triggers | created_at [*required*]                      | date-time | The timestamp when this trigger was created.                                                                                          |
| guardrail_triggers | flagging_variant_id [*required*]             | uuid      | The variant ID that triggered this event.                                                                                             |
| guardrail_triggers | id [*required*]                              | uuid      | The unique identifier of the guardrail trigger.                                                                                       |
| guardrail_triggers | metric_id [*required*]                       | string    | The metric ID associated with the trigger.                                                                                            |
| guardrail_triggers | triggered_action [*required*]                | string    | The action that was triggered.                                                                                                        |
| guardrail_triggers | updated_at [*required*]                      | date-time | The timestamp when this trigger was last updated.                                                                                     |
| exposure_schedule  | id                                                | uuid      | The unique identifier of the progressive rollout.                                                                                     |
| exposure_schedule  | rollout_options [*required*]                 | object    | Applied progression options for a progressive rollout.                                                                                |
| rollout_options    | autostart [*required*]                       | boolean   | Whether the schedule starts automatically.                                                                                            |
| rollout_options    | selection_interval_ms [*required*]           | int64     | Interval in milliseconds for uniform interval strategies.                                                                             |
| rollout_options    | strategy [*required*]                        | enum      | The progression strategy used by a progressive rollout. Allowed enum values: `UNIFORM_INTERVALS,NO_ROLLOUT`                           |
| exposure_schedule  | rollout_steps [*required*]                   | [object]  | Ordered progression steps for exposure.                                                                                               |
| rollout_steps      | allocation_exposure_schedule_id [*required*] | uuid      | The progressive rollout ID this step belongs to.                                                                                      |
| rollout_steps      | created_at [*required*]                      | date-time | The timestamp when the progression step was created.                                                                                  |
| rollout_steps      | exposure_ratio [*required*]                  | double    | The exposure ratio for this step.                                                                                                     |
| rollout_steps      | grouped_step_index [*required*]              | int64     | Logical index grouping related steps.                                                                                                 |
| rollout_steps      | id [*required*]                              | uuid      | The unique identifier of the progression step.                                                                                        |
| rollout_steps      | interval_ms                                       | int64     | Step duration in milliseconds.                                                                                                        |
| rollout_steps      | is_pause_record [*required*]                 | boolean   | Whether this step represents a pause record.                                                                                          |
| rollout_steps      | order_position [*required*]                  | int64     | Sort order for the progression step.                                                                                                  |
| rollout_steps      | updated_at [*required*]                      | date-time | The timestamp when the progression step was last updated.                                                                             |
| exposure_schedule  | updated_at [*required*]                      | date-time | The timestamp when the schedule was last updated.                                                                                     |
| attributes         | guardrail_metrics [*required*]               | [object]  | Guardrail metrics associated with this targeting rule allocation.                                                                     |
| guardrail_metrics  | metric_id [*required*]                       | string    | The metric ID to monitor.                                                                                                             |
| guardrail_metrics  | trigger_action [*required*]                  | enum      | Action to perform when a guardrail threshold is triggered. Allowed enum values: `PAUSE,ABORT`                                         |
| guardrail_metrics  | triggered_by                                      | string    | The signal or system that triggered the action.                                                                                       |
| attributes         | id                                                | uuid      | The unique identifier of the targeting rule allocation.                                                                               |
| attributes         | key [*required*]                             | string    | The unique key of the targeting rule allocation.                                                                                      |
| attributes         | name [*required*]                            | string    | The display name of the targeting rule.                                                                                               |
| attributes         | order_position [*required*]                  | int64     | Sort order position within the environment.                                                                                           |
| attributes         | targeting_rules [*required*]                 | [object]  | Conditions associated with this targeting rule allocation.                                                                            |
| targeting_rules    | conditions [*required*]                      | [object]  | Conditions evaluated by this targeting rule.                                                                                          |
| conditions         | attribute [*required*]                       | string    | The user or request attribute to evaluate.                                                                                            |
| conditions         | created_at [*required*]                      | date-time | The timestamp when the condition was created.                                                                                         |
| conditions         | id [*required*]                              | uuid      | The unique identifier of the condition.                                                                                               |
| conditions         | operator [*required*]                        | enum      | The operator used in a targeting condition. Allowed enum values: `LT,LTE,GT,GTE,MATCHES,NOT_MATCHES,ONE_OF,NOT_ONE_OF,IS_NULL,EQUALS` |
| conditions         | updated_at [*required*]                      | date-time | The timestamp when the condition was last updated.                                                                                    |
| conditions         | value [*required*]                           | [string]  | Values used by the selected operator.                                                                                                 |
| targeting_rules    | created_at [*required*]                      | date-time | The timestamp when the targeting rule was created.                                                                                    |
| targeting_rules    | id [*required*]                              | uuid      | The unique identifier of the targeting rule.                                                                                          |
| targeting_rules    | updated_at [*required*]                      | date-time | The timestamp when the targeting rule was last updated.                                                                               |
| attributes         | type [*required*]                            | enum      | The type of targeting rule (called allocation in the API model). Allowed enum values: `FEATURE_GATE,CANARY`                           |
| attributes         | updated_at [*required*]                      | date-time | The timestamp when the targeting rule allocation was last updated.                                                                    |
| attributes         | variant_weights [*required*]                 | [object]  | Weighted variant assignments for this targeting rule allocation.                                                                      |
| variant_weights    | created_at                                        | date-time | The timestamp when the variant weight was created.                                                                                    |
| variant_weights    | id                                                | uuid      | Unique identifier of the variant weight assignment.                                                                                   |
| variant_weights    | updated_at                                        | date-time | The timestamp when the variant weight was last updated.                                                                               |
| variant_weights    | value [*required*]                           | double    | The percentage weight for the variant.                                                                                                |
| variant_weights    | variant                                           | object    | A variant of a feature flag.                                                                                                          |
| variant            | created_at                                        | date-time | The timestamp when the variant was created.                                                                                           |
| variant            | id [*required*]                              | uuid      | The unique identifier of the variant.                                                                                                 |
| variant            | key [*required*]                             | string    | The unique key of the variant.                                                                                                        |
| variant            | name [*required*]                            | string    | The name of the variant.                                                                                                              |
| variant            | updated_at                                        | date-time | The timestamp when the variant was last updated.                                                                                      |
| variant            | value [*required*]                           | string    | The value of the variant as a string.                                                                                                 |
| variant_weights    | variant_id [*required*]                      | uuid      | The variant ID.                                                                                                                       |
| data               | id [*required*]                              | uuid      | The unique identifier of the targeting rule allocation.                                                                               |
| data               | type [*required*]                            | enum      | The resource type. Allowed enum values: `allocations`                                                                                 |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": [
    {
      "attributes": {
        "created_at": "2024-01-01T12:00:00Z",
        "environment_ids": [
          "550e8400-e29b-41d4-a716-446655440001"
        ],
        "experiment_id": "550e8400-e29b-41d4-a716-446655440030",
        "exposure_schedule": {
          "absolute_start_time": "2025-06-13T12:00:00Z",
          "allocation_id": "550e8400-e29b-41d4-a716-446655440020",
          "control_variant_id": "550e8400-e29b-41d4-a716-446655440012",
          "created_at": "2024-01-01T12:00:00Z",
          "guardrail_triggered_action": "PAUSE",
          "guardrail_triggers": [
            {
              "allocation_exposure_schedule_id": "550e8400-e29b-41d4-a716-446655440010",
              "created_at": "2024-01-01T12:00:00Z",
              "flagging_variant_id": "550e8400-e29b-41d4-a716-446655440001",
              "id": "550e8400-e29b-41d4-a716-446655440080",
              "metric_id": "metric-error-rate",
              "triggered_action": "PAUSE",
              "updated_at": "2024-01-01T12:00:00Z"
            }
          ],
          "id": "550e8400-e29b-41d4-a716-446655440010",
          "rollout_options": {
            "autostart": false,
            "selection_interval_ms": 3600000,
            "strategy": "UNIFORM_INTERVALS"
          },
          "rollout_steps": [
            {
              "allocation_exposure_schedule_id": "550e8400-e29b-41d4-a716-446655440010",
              "created_at": "2024-01-01T12:00:00Z",
              "exposure_ratio": 0.1,
              "grouped_step_index": 0,
              "id": "550e8400-e29b-41d4-a716-446655440040",
              "interval_ms": 3600000,
              "is_pause_record": false,
              "order_position": 0,
              "updated_at": "2024-01-01T12:00:00Z"
            }
          ],
          "updated_at": "2024-01-01T12:00:00Z"
        },
        "guardrail_metrics": [
          {
            "metric_id": "metric-error-rate",
            "trigger_action": "PAUSE",
            "triggered_by": "guardrail_monitor"
          }
        ],
        "id": "550e8400-e29b-41d4-a716-446655440020",
        "key": "prod-rollout",
        "name": "Production Rollout",
        "order_position": 0,
        "targeting_rules": [
          {
            "conditions": [
              {
                "attribute": "country",
                "created_at": "2024-01-01T12:00:00Z",
                "id": "550e8400-e29b-41d4-a716-446655440070",
                "operator": "ONE_OF",
                "updated_at": "2024-01-01T12:00:00Z",
                "value": [
                  "US",
                  "CA"
                ]
              }
            ],
            "created_at": "2024-01-01T12:00:00Z",
            "id": "550e8400-e29b-41d4-a716-446655440060",
            "updated_at": "2024-01-01T12:00:00Z"
          }
        ],
        "type": "FEATURE_GATE",
        "updated_at": "2024-01-01T12:00:00Z",
        "variant_weights": [
          {
            "created_at": "2024-01-01T12:00:00Z",
            "id": "59061199-e2ff-46e9-8b40-2193e3b21687",
            "updated_at": "2024-01-01T12:00:00Z",
            "value": 50,
            "variant": {
              "created_at": "2023-01-01T00:00:00Z",
              "id": "550e8400-e29b-41d4-a716-446655440002",
              "key": "variant-abc123",
              "name": "Variant ABC123",
              "updated_at": "2023-01-01T00:00:00Z",
              "value": "true"
            },
            "variant_id": "550e8400-e29b-41d4-a716-446655440001"
          }
        ]
      },
      "id": "550e8400-e29b-41d4-a716-446655440020",
      "type": "allocations"
    }
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="202" %}
Accepted - Approval required for this change
{% tab title="Model" %}
Response containing a list of targeting rules (allocations).

| Parent field       | Field                                             | Type      | Description                                                                                                                           |
| ------------------ | ------------------------------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------- |
|                    | data [*required*]                            | [object]  | List of targeting rules (allocations).                                                                                                |
| data               | attributes [*required*]                      | object    | Targeting rule (allocation) details for a feature flag environment.                                                                   |
| attributes         | created_at [*required*]                      | date-time | The timestamp when the targeting rule allocation was created.                                                                         |
| attributes         | environment_ids [*required*]                 | [string]  | Environment IDs associated with this targeting rule allocation.                                                                       |
| attributes         | experiment_id                                     | string    | The experiment ID linked to this targeting rule allocation.                                                                           |
| attributes         | exposure_schedule                                 | object    | Progressive release details for a targeting rule allocation.                                                                          |
| exposure_schedule  | absolute_start_time                               | date-time | The absolute UTC start time for this schedule.                                                                                        |
| exposure_schedule  | allocation_id [*required*]                   | uuid      | The targeting rule allocation ID this progressive rollout belongs to.                                                                 |
| exposure_schedule  | control_variant_id                                | string    | The control variant ID used for experiment comparisons.                                                                               |
| exposure_schedule  | created_at [*required*]                      | date-time | The timestamp when the schedule was created.                                                                                          |
| exposure_schedule  | guardrail_triggered_action                        | string    | Last guardrail action triggered for this schedule.                                                                                    |
| exposure_schedule  | guardrail_triggers [*required*]              | [object]  | Guardrail trigger records for this schedule.                                                                                          |
| guardrail_triggers | allocation_exposure_schedule_id [*required*] | uuid      | The progressive rollout ID this trigger belongs to.                                                                                   |
| guardrail_triggers | created_at [*required*]                      | date-time | The timestamp when this trigger was created.                                                                                          |
| guardrail_triggers | flagging_variant_id [*required*]             | uuid      | The variant ID that triggered this event.                                                                                             |
| guardrail_triggers | id [*required*]                              | uuid      | The unique identifier of the guardrail trigger.                                                                                       |
| guardrail_triggers | metric_id [*required*]                       | string    | The metric ID associated with the trigger.                                                                                            |
| guardrail_triggers | triggered_action [*required*]                | string    | The action that was triggered.                                                                                                        |
| guardrail_triggers | updated_at [*required*]                      | date-time | The timestamp when this trigger was last updated.                                                                                     |
| exposure_schedule  | id                                                | uuid      | The unique identifier of the progressive rollout.                                                                                     |
| exposure_schedule  | rollout_options [*required*]                 | object    | Applied progression options for a progressive rollout.                                                                                |
| rollout_options    | autostart [*required*]                       | boolean   | Whether the schedule starts automatically.                                                                                            |
| rollout_options    | selection_interval_ms [*required*]           | int64     | Interval in milliseconds for uniform interval strategies.                                                                             |
| rollout_options    | strategy [*required*]                        | enum      | The progression strategy used by a progressive rollout. Allowed enum values: `UNIFORM_INTERVALS,NO_ROLLOUT`                           |
| exposure_schedule  | rollout_steps [*required*]                   | [object]  | Ordered progression steps for exposure.                                                                                               |
| rollout_steps      | allocation_exposure_schedule_id [*required*] | uuid      | The progressive rollout ID this step belongs to.                                                                                      |
| rollout_steps      | created_at [*required*]                      | date-time | The timestamp when the progression step was created.                                                                                  |
| rollout_steps      | exposure_ratio [*required*]                  | double    | The exposure ratio for this step.                                                                                                     |
| rollout_steps      | grouped_step_index [*required*]              | int64     | Logical index grouping related steps.                                                                                                 |
| rollout_steps      | id [*required*]                              | uuid      | The unique identifier of the progression step.                                                                                        |
| rollout_steps      | interval_ms                                       | int64     | Step duration in milliseconds.                                                                                                        |
| rollout_steps      | is_pause_record [*required*]                 | boolean   | Whether this step represents a pause record.                                                                                          |
| rollout_steps      | order_position [*required*]                  | int64     | Sort order for the progression step.                                                                                                  |
| rollout_steps      | updated_at [*required*]                      | date-time | The timestamp when the progression step was last updated.                                                                             |
| exposure_schedule  | updated_at [*required*]                      | date-time | The timestamp when the schedule was last updated.                                                                                     |
| attributes         | guardrail_metrics [*required*]               | [object]  | Guardrail metrics associated with this targeting rule allocation.                                                                     |
| guardrail_metrics  | metric_id [*required*]                       | string    | The metric ID to monitor.                                                                                                             |
| guardrail_metrics  | trigger_action [*required*]                  | enum      | Action to perform when a guardrail threshold is triggered. Allowed enum values: `PAUSE,ABORT`                                         |
| guardrail_metrics  | triggered_by                                      | string    | The signal or system that triggered the action.                                                                                       |
| attributes         | id                                                | uuid      | The unique identifier of the targeting rule allocation.                                                                               |
| attributes         | key [*required*]                             | string    | The unique key of the targeting rule allocation.                                                                                      |
| attributes         | name [*required*]                            | string    | The display name of the targeting rule.                                                                                               |
| attributes         | order_position [*required*]                  | int64     | Sort order position within the environment.                                                                                           |
| attributes         | targeting_rules [*required*]                 | [object]  | Conditions associated with this targeting rule allocation.                                                                            |
| targeting_rules    | conditions [*required*]                      | [object]  | Conditions evaluated by this targeting rule.                                                                                          |
| conditions         | attribute [*required*]                       | string    | The user or request attribute to evaluate.                                                                                            |
| conditions         | created_at [*required*]                      | date-time | The timestamp when the condition was created.                                                                                         |
| conditions         | id [*required*]                              | uuid      | The unique identifier of the condition.                                                                                               |
| conditions         | operator [*required*]                        | enum      | The operator used in a targeting condition. Allowed enum values: `LT,LTE,GT,GTE,MATCHES,NOT_MATCHES,ONE_OF,NOT_ONE_OF,IS_NULL,EQUALS` |
| conditions         | updated_at [*required*]                      | date-time | The timestamp when the condition was last updated.                                                                                    |
| conditions         | value [*required*]                           | [string]  | Values used by the selected operator.                                                                                                 |
| targeting_rules    | created_at [*required*]                      | date-time | The timestamp when the targeting rule was created.                                                                                    |
| targeting_rules    | id [*required*]                              | uuid      | The unique identifier of the targeting rule.                                                                                          |
| targeting_rules    | updated_at [*required*]                      | date-time | The timestamp when the targeting rule was last updated.                                                                               |
| attributes         | type [*required*]                            | enum      | The type of targeting rule (called allocation in the API model). Allowed enum values: `FEATURE_GATE,CANARY`                           |
| attributes         | updated_at [*required*]                      | date-time | The timestamp when the targeting rule allocation was last updated.                                                                    |
| attributes         | variant_weights [*required*]                 | [object]  | Weighted variant assignments for this targeting rule allocation.                                                                      |
| variant_weights    | created_at                                        | date-time | The timestamp when the variant weight was created.                                                                                    |
| variant_weights    | id                                                | uuid      | Unique identifier of the variant weight assignment.                                                                                   |
| variant_weights    | updated_at                                        | date-time | The timestamp when the variant weight was last updated.                                                                               |
| variant_weights    | value [*required*]                           | double    | The percentage weight for the variant.                                                                                                |
| variant_weights    | variant                                           | object    | A variant of a feature flag.                                                                                                          |
| variant            | created_at                                        | date-time | The timestamp when the variant was created.                                                                                           |
| variant            | id [*required*]                              | uuid      | The unique identifier of the variant.                                                                                                 |
| variant            | key [*required*]                             | string    | The unique key of the variant.                                                                                                        |
| variant            | name [*required*]                            | string    | The name of the variant.                                                                                                              |
| variant            | updated_at                                        | date-time | The timestamp when the variant was last updated.                                                                                      |
| variant            | value [*required*]                           | string    | The value of the variant as a string.                                                                                                 |
| variant_weights    | variant_id [*required*]                      | uuid      | The variant ID.                                                                                                                       |
| data               | id [*required*]                              | uuid      | The unique identifier of the targeting rule allocation.                                                                               |
| data               | type [*required*]                            | enum      | The resource type. Allowed enum values: `allocations`                                                                                 |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": [
    {
      "attributes": {
        "created_at": "2024-01-01T12:00:00Z",
        "environment_ids": [
          "550e8400-e29b-41d4-a716-446655440001"
        ],
        "experiment_id": "550e8400-e29b-41d4-a716-446655440030",
        "exposure_schedule": {
          "absolute_start_time": "2025-06-13T12:00:00Z",
          "allocation_id": "550e8400-e29b-41d4-a716-446655440020",
          "control_variant_id": "550e8400-e29b-41d4-a716-446655440012",
          "created_at": "2024-01-01T12:00:00Z",
          "guardrail_triggered_action": "PAUSE",
          "guardrail_triggers": [
            {
              "allocation_exposure_schedule_id": "550e8400-e29b-41d4-a716-446655440010",
              "created_at": "2024-01-01T12:00:00Z",
              "flagging_variant_id": "550e8400-e29b-41d4-a716-446655440001",
              "id": "550e8400-e29b-41d4-a716-446655440080",
              "metric_id": "metric-error-rate",
              "triggered_action": "PAUSE",
              "updated_at": "2024-01-01T12:00:00Z"
            }
          ],
          "id": "550e8400-e29b-41d4-a716-446655440010",
          "rollout_options": {
            "autostart": false,
            "selection_interval_ms": 3600000,
            "strategy": "UNIFORM_INTERVALS"
          },
          "rollout_steps": [
            {
              "allocation_exposure_schedule_id": "550e8400-e29b-41d4-a716-446655440010",
              "created_at": "2024-01-01T12:00:00Z",
              "exposure_ratio": 0.1,
              "grouped_step_index": 0,
              "id": "550e8400-e29b-41d4-a716-446655440040",
              "interval_ms": 3600000,
              "is_pause_record": false,
              "order_position": 0,
              "updated_at": "2024-01-01T12:00:00Z"
            }
          ],
          "updated_at": "2024-01-01T12:00:00Z"
        },
        "guardrail_metrics": [
          {
            "metric_id": "metric-error-rate",
            "trigger_action": "PAUSE",
            "triggered_by": "guardrail_monitor"
          }
        ],
        "id": "550e8400-e29b-41d4-a716-446655440020",
        "key": "prod-rollout",
        "name": "Production Rollout",
        "order_position": 0,
        "targeting_rules": [
          {
            "conditions": [
              {
                "attribute": "country",
                "created_at": "2024-01-01T12:00:00Z",
                "id": "550e8400-e29b-41d4-a716-446655440070",
                "operator": "ONE_OF",
                "updated_at": "2024-01-01T12:00:00Z",
                "value": [
                  "US",
                  "CA"
                ]
              }
            ],
            "created_at": "2024-01-01T12:00:00Z",
            "id": "550e8400-e29b-41d4-a716-446655440060",
            "updated_at": "2024-01-01T12:00:00Z"
          }
        ],
        "type": "FEATURE_GATE",
        "updated_at": "2024-01-01T12:00:00Z",
        "variant_weights": [
          {
            "created_at": "2024-01-01T12:00:00Z",
            "id": "59061199-e2ff-46e9-8b40-2193e3b21687",
            "updated_at": "2024-01-01T12:00:00Z",
            "value": 50,
            "variant": {
              "created_at": "2023-01-01T00:00:00Z",
              "id": "550e8400-e29b-41d4-a716-446655440002",
              "key": "variant-abc123",
              "name": "Variant ABC123",
              "updated_at": "2023-01-01T00:00:00Z",
              "value": "true"
            },
            "variant_id": "550e8400-e29b-41d4-a716-446655440001"
          }
        ]
      },
      "id": "550e8400-e29b-41d4-a716-446655440020",
      "type": "allocations"
    }
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="400" %}
Bad Request
{% 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 %}

{% tab title="403" %}
Forbidden
{% 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 %}

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

{% tab title="409" %}
Conflict
{% 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 %}

{% 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 parametersexport feature_flag_id="550e8400-e29b-41d4-a716-446655440000"export environment_id="550e8400-e29b-41d4-a716-446655440001"\# Curl commandcurl -X PUT "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/feature-flags/${feature_flag_id}/environments/${environment_id}/allocations" \
-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": [
    {
      "type": "allocations",
      "attributes": {
        "key": "overwrite-allocation-example-feature-flag",
        "name": "New targeting rule Example-Feature-Flag",
        "targeting_rules": [],
        "variant_weights": [
          {
            "variant_id": "550e8400-e29b-41d4-a716-446655440002",
            "value": 100
          }
        ],
        "exposure_schedule": {
          "rollout_options": {
            "strategy": "UNIFORM_INTERVALS",
            "autostart": false,
            "selection_interval_ms": 86400000
          },
          "rollout_steps": [
            {
              "exposure_ratio": 0.05,
              "interval_ms": null,
              "is_pause_record": false,
              "grouped_step_index": 0
            },
            {
              "exposure_ratio": 0.25,
              "interval_ms": null,
              "is_pause_record": false,
              "grouped_step_index": 1
            },
            {
              "exposure_ratio": 1,
              "interval_ms": null,
              "is_pause_record": false,
              "grouped_step_index": 2
            }
          ]
        },
        "guardrail_metrics": [],
        "type": "CANARY"
      }
    }
  ]
}
EOF
                        
{% /tab %}

## Create targeting rules for a flag env{% #create-targeting-rules-for-a-flag-env %}

{% tab title="v2" %}

| Datadog site      | API endpoint                                                                                                        |
| ----------------- | ------------------------------------------------------------------------------------------------------------------- |
| ap1.datadoghq.com | POST https://api.ap1.datadoghq.com/api/v2/feature-flags/{feature_flag_id}/environments/{environment_id}/allocations |
| ap2.datadoghq.com | POST https://api.ap2.datadoghq.com/api/v2/feature-flags/{feature_flag_id}/environments/{environment_id}/allocations |
| app.datadoghq.eu  | POST https://api.datadoghq.eu/api/v2/feature-flags/{feature_flag_id}/environments/{environment_id}/allocations      |
| app.ddog-gov.com  | POST https://api.ddog-gov.com/api/v2/feature-flags/{feature_flag_id}/environments/{environment_id}/allocations      |
| app.datadoghq.com | POST https://api.datadoghq.com/api/v2/feature-flags/{feature_flag_id}/environments/{environment_id}/allocations     |
| us3.datadoghq.com | POST https://api.us3.datadoghq.com/api/v2/feature-flags/{feature_flag_id}/environments/{environment_id}/allocations |
| us5.datadoghq.com | POST https://api.us5.datadoghq.com/api/v2/feature-flags/{feature_flag_id}/environments/{environment_id}/allocations |

### Overview

Creates a new targeting rule (allocation) for a specific feature flag in a specific environment. This endpoint requires the `feature_flag_config_write` permission.

### Arguments

#### Path Parameters

| Name                              | Type   | Description                 |
| --------------------------------- | ------ | --------------------------- |
| feature_flag_id [*required*] | string | The ID of the feature flag. |
| environment_id [*required*]  | string | The ID of the environment.  |

### Request

#### Body Data (required)



{% tab title="Model" %}

| Parent field      | Field                                | Type      | Description                                                                                                                           |
| ----------------- | ------------------------------------ | --------- | ------------------------------------------------------------------------------------------------------------------------------------- |
|                   | data [*required*]               | object    | Data wrapper for allocation request payloads.                                                                                         |
| data              | attributes [*required*]         | object    | Request to create or update a targeting rule (allocation) for a feature flag environment.                                             |
| attributes        | experiment_id                        | string    | The experiment ID for experiment-linked allocations.                                                                                  |
| attributes        | exposure_schedule                    | object    | Progressive release request payload.                                                                                                  |
| exposure_schedule | absolute_start_time                  | date-time | The absolute UTC start time for this schedule.                                                                                        |
| exposure_schedule | control_variant_id                   | string    | The control variant ID used for experiment comparisons.                                                                               |
| exposure_schedule | control_variant_key                  | string    | The control variant key used during creation workflows.                                                                               |
| exposure_schedule | id                                   | uuid      | The unique identifier of the progressive rollout.                                                                                     |
| exposure_schedule | rollout_options [*required*]    | object    | Rollout options request payload.                                                                                                      |
| rollout_options   | autostart                            | boolean   | Whether the schedule should begin automatically.                                                                                      |
| rollout_options   | selection_interval_ms                | int64     | Interval in milliseconds for uniform interval strategies.                                                                             |
| rollout_options   | strategy [*required*]           | enum      | The progression strategy used by a progressive rollout. Allowed enum values: `UNIFORM_INTERVALS,NO_ROLLOUT`                           |
| exposure_schedule | rollout_steps [*required*]      | [object]  | Ordered progression steps for exposure.                                                                                               |
| rollout_steps     | exposure_ratio [*required*]     | double    | The exposure ratio for this step.                                                                                                     |
| rollout_steps     | grouped_step_index [*required*] | int64     | Logical index grouping related steps.                                                                                                 |
| rollout_steps     | id                                   | uuid      | The unique identifier of the progression step.                                                                                        |
| rollout_steps     | interval_ms                          | int64     | Step duration in milliseconds.                                                                                                        |
| rollout_steps     | is_pause_record [*required*]    | boolean   | Whether this step represents a pause record.                                                                                          |
| attributes        | guardrail_metrics                    | [object]  | Guardrail metrics used to monitor and auto-pause or abort.                                                                            |
| guardrail_metrics | metric_id [*required*]          | string    | The metric ID to monitor.                                                                                                             |
| guardrail_metrics | trigger_action [*required*]     | enum      | Action to perform when a guardrail threshold is triggered. Allowed enum values: `PAUSE,ABORT`                                         |
| attributes        | id                                   | uuid      | The unique identifier of the targeting rule allocation.                                                                               |
| attributes        | key [*required*]                | string    | The unique key of the targeting rule allocation.                                                                                      |
| attributes        | name [*required*]               | string    | The display name of the targeting rule.                                                                                               |
| attributes        | targeting_rules                      | [object]  | Targeting rules that determine audience eligibility.                                                                                  |
| targeting_rules   | conditions [*required*]         | [object]  | Conditions that must match for this rule.                                                                                             |
| conditions        | attribute [*required*]          | string    | The user or request attribute to evaluate.                                                                                            |
| conditions        | operator [*required*]           | enum      | The operator used in a targeting condition. Allowed enum values: `LT,LTE,GT,GTE,MATCHES,NOT_MATCHES,ONE_OF,NOT_ONE_OF,IS_NULL,EQUALS` |
| conditions        | value [*required*]              | [string]  | Values used by the selected operator.                                                                                                 |
| attributes        | type [*required*]               | enum      | The type of targeting rule (called allocation in the API model). Allowed enum values: `FEATURE_GATE,CANARY`                           |
| attributes        | variant_weights                      | [object]  | Variant distribution weights.                                                                                                         |
| variant_weights   | value [*required*]              | double    | The percentage weight for this variant.                                                                                               |
| variant_weights   | variant_id                           | uuid      | The variant ID to assign weight to.                                                                                                   |
| variant_weights   | variant_key                          | string    | The variant key to assign weight to.                                                                                                  |
| data              | type [*required*]               | enum      | The resource type. Allowed enum values: `allocations`                                                                                 |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "type": "allocations",
    "attributes": {
      "name": "New targeting rule Example-Feature-Flag",
      "key": "new-targeting-rule-example-feature-flag",
      "targeting_rules": [],
      "variant_weights": [
        {
          "variant_id": "550e8400-e29b-41d4-a716-446655440002",
          "value": 100
        }
      ],
      "guardrail_metrics": [],
      "type": "CANARY"
    }
  }
}
```

{% /tab %}

### Response

{% tab title="201" %}
Created
{% tab title="Model" %}
Response containing a single targeting rule (allocation).

| Parent field       | Field                                             | Type      | Description                                                                                                                           |
| ------------------ | ------------------------------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------- |
|                    | data [*required*]                            | object    | Data wrapper for targeting rule allocation responses.                                                                                 |
| data               | attributes [*required*]                      | object    | Targeting rule (allocation) details for a feature flag environment.                                                                   |
| attributes         | created_at [*required*]                      | date-time | The timestamp when the targeting rule allocation was created.                                                                         |
| attributes         | environment_ids [*required*]                 | [string]  | Environment IDs associated with this targeting rule allocation.                                                                       |
| attributes         | experiment_id                                     | string    | The experiment ID linked to this targeting rule allocation.                                                                           |
| attributes         | exposure_schedule                                 | object    | Progressive release details for a targeting rule allocation.                                                                          |
| exposure_schedule  | absolute_start_time                               | date-time | The absolute UTC start time for this schedule.                                                                                        |
| exposure_schedule  | allocation_id [*required*]                   | uuid      | The targeting rule allocation ID this progressive rollout belongs to.                                                                 |
| exposure_schedule  | control_variant_id                                | string    | The control variant ID used for experiment comparisons.                                                                               |
| exposure_schedule  | created_at [*required*]                      | date-time | The timestamp when the schedule was created.                                                                                          |
| exposure_schedule  | guardrail_triggered_action                        | string    | Last guardrail action triggered for this schedule.                                                                                    |
| exposure_schedule  | guardrail_triggers [*required*]              | [object]  | Guardrail trigger records for this schedule.                                                                                          |
| guardrail_triggers | allocation_exposure_schedule_id [*required*] | uuid      | The progressive rollout ID this trigger belongs to.                                                                                   |
| guardrail_triggers | created_at [*required*]                      | date-time | The timestamp when this trigger was created.                                                                                          |
| guardrail_triggers | flagging_variant_id [*required*]             | uuid      | The variant ID that triggered this event.                                                                                             |
| guardrail_triggers | id [*required*]                              | uuid      | The unique identifier of the guardrail trigger.                                                                                       |
| guardrail_triggers | metric_id [*required*]                       | string    | The metric ID associated with the trigger.                                                                                            |
| guardrail_triggers | triggered_action [*required*]                | string    | The action that was triggered.                                                                                                        |
| guardrail_triggers | updated_at [*required*]                      | date-time | The timestamp when this trigger was last updated.                                                                                     |
| exposure_schedule  | id                                                | uuid      | The unique identifier of the progressive rollout.                                                                                     |
| exposure_schedule  | rollout_options [*required*]                 | object    | Applied progression options for a progressive rollout.                                                                                |
| rollout_options    | autostart [*required*]                       | boolean   | Whether the schedule starts automatically.                                                                                            |
| rollout_options    | selection_interval_ms [*required*]           | int64     | Interval in milliseconds for uniform interval strategies.                                                                             |
| rollout_options    | strategy [*required*]                        | enum      | The progression strategy used by a progressive rollout. Allowed enum values: `UNIFORM_INTERVALS,NO_ROLLOUT`                           |
| exposure_schedule  | rollout_steps [*required*]                   | [object]  | Ordered progression steps for exposure.                                                                                               |
| rollout_steps      | allocation_exposure_schedule_id [*required*] | uuid      | The progressive rollout ID this step belongs to.                                                                                      |
| rollout_steps      | created_at [*required*]                      | date-time | The timestamp when the progression step was created.                                                                                  |
| rollout_steps      | exposure_ratio [*required*]                  | double    | The exposure ratio for this step.                                                                                                     |
| rollout_steps      | grouped_step_index [*required*]              | int64     | Logical index grouping related steps.                                                                                                 |
| rollout_steps      | id [*required*]                              | uuid      | The unique identifier of the progression step.                                                                                        |
| rollout_steps      | interval_ms                                       | int64     | Step duration in milliseconds.                                                                                                        |
| rollout_steps      | is_pause_record [*required*]                 | boolean   | Whether this step represents a pause record.                                                                                          |
| rollout_steps      | order_position [*required*]                  | int64     | Sort order for the progression step.                                                                                                  |
| rollout_steps      | updated_at [*required*]                      | date-time | The timestamp when the progression step was last updated.                                                                             |
| exposure_schedule  | updated_at [*required*]                      | date-time | The timestamp when the schedule was last updated.                                                                                     |
| attributes         | guardrail_metrics [*required*]               | [object]  | Guardrail metrics associated with this targeting rule allocation.                                                                     |
| guardrail_metrics  | metric_id [*required*]                       | string    | The metric ID to monitor.                                                                                                             |
| guardrail_metrics  | trigger_action [*required*]                  | enum      | Action to perform when a guardrail threshold is triggered. Allowed enum values: `PAUSE,ABORT`                                         |
| guardrail_metrics  | triggered_by                                      | string    | The signal or system that triggered the action.                                                                                       |
| attributes         | id                                                | uuid      | The unique identifier of the targeting rule allocation.                                                                               |
| attributes         | key [*required*]                             | string    | The unique key of the targeting rule allocation.                                                                                      |
| attributes         | name [*required*]                            | string    | The display name of the targeting rule.                                                                                               |
| attributes         | order_position [*required*]                  | int64     | Sort order position within the environment.                                                                                           |
| attributes         | targeting_rules [*required*]                 | [object]  | Conditions associated with this targeting rule allocation.                                                                            |
| targeting_rules    | conditions [*required*]                      | [object]  | Conditions evaluated by this targeting rule.                                                                                          |
| conditions         | attribute [*required*]                       | string    | The user or request attribute to evaluate.                                                                                            |
| conditions         | created_at [*required*]                      | date-time | The timestamp when the condition was created.                                                                                         |
| conditions         | id [*required*]                              | uuid      | The unique identifier of the condition.                                                                                               |
| conditions         | operator [*required*]                        | enum      | The operator used in a targeting condition. Allowed enum values: `LT,LTE,GT,GTE,MATCHES,NOT_MATCHES,ONE_OF,NOT_ONE_OF,IS_NULL,EQUALS` |
| conditions         | updated_at [*required*]                      | date-time | The timestamp when the condition was last updated.                                                                                    |
| conditions         | value [*required*]                           | [string]  | Values used by the selected operator.                                                                                                 |
| targeting_rules    | created_at [*required*]                      | date-time | The timestamp when the targeting rule was created.                                                                                    |
| targeting_rules    | id [*required*]                              | uuid      | The unique identifier of the targeting rule.                                                                                          |
| targeting_rules    | updated_at [*required*]                      | date-time | The timestamp when the targeting rule was last updated.                                                                               |
| attributes         | type [*required*]                            | enum      | The type of targeting rule (called allocation in the API model). Allowed enum values: `FEATURE_GATE,CANARY`                           |
| attributes         | updated_at [*required*]                      | date-time | The timestamp when the targeting rule allocation was last updated.                                                                    |
| attributes         | variant_weights [*required*]                 | [object]  | Weighted variant assignments for this targeting rule allocation.                                                                      |
| variant_weights    | created_at                                        | date-time | The timestamp when the variant weight was created.                                                                                    |
| variant_weights    | id                                                | uuid      | Unique identifier of the variant weight assignment.                                                                                   |
| variant_weights    | updated_at                                        | date-time | The timestamp when the variant weight was last updated.                                                                               |
| variant_weights    | value [*required*]                           | double    | The percentage weight for the variant.                                                                                                |
| variant_weights    | variant                                           | object    | A variant of a feature flag.                                                                                                          |
| variant            | created_at                                        | date-time | The timestamp when the variant was created.                                                                                           |
| variant            | id [*required*]                              | uuid      | The unique identifier of the variant.                                                                                                 |
| variant            | key [*required*]                             | string    | The unique key of the variant.                                                                                                        |
| variant            | name [*required*]                            | string    | The name of the variant.                                                                                                              |
| variant            | updated_at                                        | date-time | The timestamp when the variant was last updated.                                                                                      |
| variant            | value [*required*]                           | string    | The value of the variant as a string.                                                                                                 |
| variant_weights    | variant_id [*required*]                      | uuid      | The variant ID.                                                                                                                       |
| data               | id [*required*]                              | uuid      | The unique identifier of the targeting rule allocation.                                                                               |
| data               | type [*required*]                            | enum      | The resource type. Allowed enum values: `allocations`                                                                                 |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "created_at": "2024-01-01T12:00:00Z",
      "environment_ids": [
        "550e8400-e29b-41d4-a716-446655440001"
      ],
      "experiment_id": "550e8400-e29b-41d4-a716-446655440030",
      "exposure_schedule": {
        "absolute_start_time": "2025-06-13T12:00:00Z",
        "allocation_id": "550e8400-e29b-41d4-a716-446655440020",
        "control_variant_id": "550e8400-e29b-41d4-a716-446655440012",
        "created_at": "2024-01-01T12:00:00Z",
        "guardrail_triggered_action": "PAUSE",
        "guardrail_triggers": [
          {
            "allocation_exposure_schedule_id": "550e8400-e29b-41d4-a716-446655440010",
            "created_at": "2024-01-01T12:00:00Z",
            "flagging_variant_id": "550e8400-e29b-41d4-a716-446655440001",
            "id": "550e8400-e29b-41d4-a716-446655440080",
            "metric_id": "metric-error-rate",
            "triggered_action": "PAUSE",
            "updated_at": "2024-01-01T12:00:00Z"
          }
        ],
        "id": "550e8400-e29b-41d4-a716-446655440010",
        "rollout_options": {
          "autostart": false,
          "selection_interval_ms": 3600000,
          "strategy": "UNIFORM_INTERVALS"
        },
        "rollout_steps": [
          {
            "allocation_exposure_schedule_id": "550e8400-e29b-41d4-a716-446655440010",
            "created_at": "2024-01-01T12:00:00Z",
            "exposure_ratio": 0.1,
            "grouped_step_index": 0,
            "id": "550e8400-e29b-41d4-a716-446655440040",
            "interval_ms": 3600000,
            "is_pause_record": false,
            "order_position": 0,
            "updated_at": "2024-01-01T12:00:00Z"
          }
        ],
        "updated_at": "2024-01-01T12:00:00Z"
      },
      "guardrail_metrics": [
        {
          "metric_id": "metric-error-rate",
          "trigger_action": "PAUSE",
          "triggered_by": "guardrail_monitor"
        }
      ],
      "id": "550e8400-e29b-41d4-a716-446655440020",
      "key": "prod-rollout",
      "name": "Production Rollout",
      "order_position": 0,
      "targeting_rules": [
        {
          "conditions": [
            {
              "attribute": "country",
              "created_at": "2024-01-01T12:00:00Z",
              "id": "550e8400-e29b-41d4-a716-446655440070",
              "operator": "ONE_OF",
              "updated_at": "2024-01-01T12:00:00Z",
              "value": [
                "US",
                "CA"
              ]
            }
          ],
          "created_at": "2024-01-01T12:00:00Z",
          "id": "550e8400-e29b-41d4-a716-446655440060",
          "updated_at": "2024-01-01T12:00:00Z"
        }
      ],
      "type": "FEATURE_GATE",
      "updated_at": "2024-01-01T12:00:00Z",
      "variant_weights": [
        {
          "created_at": "2024-01-01T12:00:00Z",
          "id": "59061199-e2ff-46e9-8b40-2193e3b21687",
          "updated_at": "2024-01-01T12:00:00Z",
          "value": 50,
          "variant": {
            "created_at": "2023-01-01T00:00:00Z",
            "id": "550e8400-e29b-41d4-a716-446655440002",
            "key": "variant-abc123",
            "name": "Variant ABC123",
            "updated_at": "2023-01-01T00:00:00Z",
            "value": "true"
          },
          "variant_id": "550e8400-e29b-41d4-a716-446655440001"
        }
      ]
    },
    "id": "550e8400-e29b-41d4-a716-446655440020",
    "type": "allocations"
  }
}
```

{% /tab %}

{% /tab %}

{% tab title="202" %}
Accepted - Approval required for this change
{% tab title="Model" %}
Response containing a single targeting rule (allocation).

| Parent field       | Field                                             | Type      | Description                                                                                                                           |
| ------------------ | ------------------------------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------- |
|                    | data [*required*]                            | object    | Data wrapper for targeting rule allocation responses.                                                                                 |
| data               | attributes [*required*]                      | object    | Targeting rule (allocation) details for a feature flag environment.                                                                   |
| attributes         | created_at [*required*]                      | date-time | The timestamp when the targeting rule allocation was created.                                                                         |
| attributes         | environment_ids [*required*]                 | [string]  | Environment IDs associated with this targeting rule allocation.                                                                       |
| attributes         | experiment_id                                     | string    | The experiment ID linked to this targeting rule allocation.                                                                           |
| attributes         | exposure_schedule                                 | object    | Progressive release details for a targeting rule allocation.                                                                          |
| exposure_schedule  | absolute_start_time                               | date-time | The absolute UTC start time for this schedule.                                                                                        |
| exposure_schedule  | allocation_id [*required*]                   | uuid      | The targeting rule allocation ID this progressive rollout belongs to.                                                                 |
| exposure_schedule  | control_variant_id                                | string    | The control variant ID used for experiment comparisons.                                                                               |
| exposure_schedule  | created_at [*required*]                      | date-time | The timestamp when the schedule was created.                                                                                          |
| exposure_schedule  | guardrail_triggered_action                        | string    | Last guardrail action triggered for this schedule.                                                                                    |
| exposure_schedule  | guardrail_triggers [*required*]              | [object]  | Guardrail trigger records for this schedule.                                                                                          |
| guardrail_triggers | allocation_exposure_schedule_id [*required*] | uuid      | The progressive rollout ID this trigger belongs to.                                                                                   |
| guardrail_triggers | created_at [*required*]                      | date-time | The timestamp when this trigger was created.                                                                                          |
| guardrail_triggers | flagging_variant_id [*required*]             | uuid      | The variant ID that triggered this event.                                                                                             |
| guardrail_triggers | id [*required*]                              | uuid      | The unique identifier of the guardrail trigger.                                                                                       |
| guardrail_triggers | metric_id [*required*]                       | string    | The metric ID associated with the trigger.                                                                                            |
| guardrail_triggers | triggered_action [*required*]                | string    | The action that was triggered.                                                                                                        |
| guardrail_triggers | updated_at [*required*]                      | date-time | The timestamp when this trigger was last updated.                                                                                     |
| exposure_schedule  | id                                                | uuid      | The unique identifier of the progressive rollout.                                                                                     |
| exposure_schedule  | rollout_options [*required*]                 | object    | Applied progression options for a progressive rollout.                                                                                |
| rollout_options    | autostart [*required*]                       | boolean   | Whether the schedule starts automatically.                                                                                            |
| rollout_options    | selection_interval_ms [*required*]           | int64     | Interval in milliseconds for uniform interval strategies.                                                                             |
| rollout_options    | strategy [*required*]                        | enum      | The progression strategy used by a progressive rollout. Allowed enum values: `UNIFORM_INTERVALS,NO_ROLLOUT`                           |
| exposure_schedule  | rollout_steps [*required*]                   | [object]  | Ordered progression steps for exposure.                                                                                               |
| rollout_steps      | allocation_exposure_schedule_id [*required*] | uuid      | The progressive rollout ID this step belongs to.                                                                                      |
| rollout_steps      | created_at [*required*]                      | date-time | The timestamp when the progression step was created.                                                                                  |
| rollout_steps      | exposure_ratio [*required*]                  | double    | The exposure ratio for this step.                                                                                                     |
| rollout_steps      | grouped_step_index [*required*]              | int64     | Logical index grouping related steps.                                                                                                 |
| rollout_steps      | id [*required*]                              | uuid      | The unique identifier of the progression step.                                                                                        |
| rollout_steps      | interval_ms                                       | int64     | Step duration in milliseconds.                                                                                                        |
| rollout_steps      | is_pause_record [*required*]                 | boolean   | Whether this step represents a pause record.                                                                                          |
| rollout_steps      | order_position [*required*]                  | int64     | Sort order for the progression step.                                                                                                  |
| rollout_steps      | updated_at [*required*]                      | date-time | The timestamp when the progression step was last updated.                                                                             |
| exposure_schedule  | updated_at [*required*]                      | date-time | The timestamp when the schedule was last updated.                                                                                     |
| attributes         | guardrail_metrics [*required*]               | [object]  | Guardrail metrics associated with this targeting rule allocation.                                                                     |
| guardrail_metrics  | metric_id [*required*]                       | string    | The metric ID to monitor.                                                                                                             |
| guardrail_metrics  | trigger_action [*required*]                  | enum      | Action to perform when a guardrail threshold is triggered. Allowed enum values: `PAUSE,ABORT`                                         |
| guardrail_metrics  | triggered_by                                      | string    | The signal or system that triggered the action.                                                                                       |
| attributes         | id                                                | uuid      | The unique identifier of the targeting rule allocation.                                                                               |
| attributes         | key [*required*]                             | string    | The unique key of the targeting rule allocation.                                                                                      |
| attributes         | name [*required*]                            | string    | The display name of the targeting rule.                                                                                               |
| attributes         | order_position [*required*]                  | int64     | Sort order position within the environment.                                                                                           |
| attributes         | targeting_rules [*required*]                 | [object]  | Conditions associated with this targeting rule allocation.                                                                            |
| targeting_rules    | conditions [*required*]                      | [object]  | Conditions evaluated by this targeting rule.                                                                                          |
| conditions         | attribute [*required*]                       | string    | The user or request attribute to evaluate.                                                                                            |
| conditions         | created_at [*required*]                      | date-time | The timestamp when the condition was created.                                                                                         |
| conditions         | id [*required*]                              | uuid      | The unique identifier of the condition.                                                                                               |
| conditions         | operator [*required*]                        | enum      | The operator used in a targeting condition. Allowed enum values: `LT,LTE,GT,GTE,MATCHES,NOT_MATCHES,ONE_OF,NOT_ONE_OF,IS_NULL,EQUALS` |
| conditions         | updated_at [*required*]                      | date-time | The timestamp when the condition was last updated.                                                                                    |
| conditions         | value [*required*]                           | [string]  | Values used by the selected operator.                                                                                                 |
| targeting_rules    | created_at [*required*]                      | date-time | The timestamp when the targeting rule was created.                                                                                    |
| targeting_rules    | id [*required*]                              | uuid      | The unique identifier of the targeting rule.                                                                                          |
| targeting_rules    | updated_at [*required*]                      | date-time | The timestamp when the targeting rule was last updated.                                                                               |
| attributes         | type [*required*]                            | enum      | The type of targeting rule (called allocation in the API model). Allowed enum values: `FEATURE_GATE,CANARY`                           |
| attributes         | updated_at [*required*]                      | date-time | The timestamp when the targeting rule allocation was last updated.                                                                    |
| attributes         | variant_weights [*required*]                 | [object]  | Weighted variant assignments for this targeting rule allocation.                                                                      |
| variant_weights    | created_at                                        | date-time | The timestamp when the variant weight was created.                                                                                    |
| variant_weights    | id                                                | uuid      | Unique identifier of the variant weight assignment.                                                                                   |
| variant_weights    | updated_at                                        | date-time | The timestamp when the variant weight was last updated.                                                                               |
| variant_weights    | value [*required*]                           | double    | The percentage weight for the variant.                                                                                                |
| variant_weights    | variant                                           | object    | A variant of a feature flag.                                                                                                          |
| variant            | created_at                                        | date-time | The timestamp when the variant was created.                                                                                           |
| variant            | id [*required*]                              | uuid      | The unique identifier of the variant.                                                                                                 |
| variant            | key [*required*]                             | string    | The unique key of the variant.                                                                                                        |
| variant            | name [*required*]                            | string    | The name of the variant.                                                                                                              |
| variant            | updated_at                                        | date-time | The timestamp when the variant was last updated.                                                                                      |
| variant            | value [*required*]                           | string    | The value of the variant as a string.                                                                                                 |
| variant_weights    | variant_id [*required*]                      | uuid      | The variant ID.                                                                                                                       |
| data               | id [*required*]                              | uuid      | The unique identifier of the targeting rule allocation.                                                                               |
| data               | type [*required*]                            | enum      | The resource type. Allowed enum values: `allocations`                                                                                 |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "created_at": "2024-01-01T12:00:00Z",
      "environment_ids": [
        "550e8400-e29b-41d4-a716-446655440001"
      ],
      "experiment_id": "550e8400-e29b-41d4-a716-446655440030",
      "exposure_schedule": {
        "absolute_start_time": "2025-06-13T12:00:00Z",
        "allocation_id": "550e8400-e29b-41d4-a716-446655440020",
        "control_variant_id": "550e8400-e29b-41d4-a716-446655440012",
        "created_at": "2024-01-01T12:00:00Z",
        "guardrail_triggered_action": "PAUSE",
        "guardrail_triggers": [
          {
            "allocation_exposure_schedule_id": "550e8400-e29b-41d4-a716-446655440010",
            "created_at": "2024-01-01T12:00:00Z",
            "flagging_variant_id": "550e8400-e29b-41d4-a716-446655440001",
            "id": "550e8400-e29b-41d4-a716-446655440080",
            "metric_id": "metric-error-rate",
            "triggered_action": "PAUSE",
            "updated_at": "2024-01-01T12:00:00Z"
          }
        ],
        "id": "550e8400-e29b-41d4-a716-446655440010",
        "rollout_options": {
          "autostart": false,
          "selection_interval_ms": 3600000,
          "strategy": "UNIFORM_INTERVALS"
        },
        "rollout_steps": [
          {
            "allocation_exposure_schedule_id": "550e8400-e29b-41d4-a716-446655440010",
            "created_at": "2024-01-01T12:00:00Z",
            "exposure_ratio": 0.1,
            "grouped_step_index": 0,
            "id": "550e8400-e29b-41d4-a716-446655440040",
            "interval_ms": 3600000,
            "is_pause_record": false,
            "order_position": 0,
            "updated_at": "2024-01-01T12:00:00Z"
          }
        ],
        "updated_at": "2024-01-01T12:00:00Z"
      },
      "guardrail_metrics": [
        {
          "metric_id": "metric-error-rate",
          "trigger_action": "PAUSE",
          "triggered_by": "guardrail_monitor"
        }
      ],
      "id": "550e8400-e29b-41d4-a716-446655440020",
      "key": "prod-rollout",
      "name": "Production Rollout",
      "order_position": 0,
      "targeting_rules": [
        {
          "conditions": [
            {
              "attribute": "country",
              "created_at": "2024-01-01T12:00:00Z",
              "id": "550e8400-e29b-41d4-a716-446655440070",
              "operator": "ONE_OF",
              "updated_at": "2024-01-01T12:00:00Z",
              "value": [
                "US",
                "CA"
              ]
            }
          ],
          "created_at": "2024-01-01T12:00:00Z",
          "id": "550e8400-e29b-41d4-a716-446655440060",
          "updated_at": "2024-01-01T12:00:00Z"
        }
      ],
      "type": "FEATURE_GATE",
      "updated_at": "2024-01-01T12:00:00Z",
      "variant_weights": [
        {
          "created_at": "2024-01-01T12:00:00Z",
          "id": "59061199-e2ff-46e9-8b40-2193e3b21687",
          "updated_at": "2024-01-01T12:00:00Z",
          "value": 50,
          "variant": {
            "created_at": "2023-01-01T00:00:00Z",
            "id": "550e8400-e29b-41d4-a716-446655440002",
            "key": "variant-abc123",
            "name": "Variant ABC123",
            "updated_at": "2023-01-01T00:00:00Z",
            "value": "true"
          },
          "variant_id": "550e8400-e29b-41d4-a716-446655440001"
        }
      ]
    },
    "id": "550e8400-e29b-41d4-a716-446655440020",
    "type": "allocations"
  }
}
```

{% /tab %}

{% /tab %}

{% tab title="400" %}
Bad Request
{% 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 %}

{% tab title="403" %}
Forbidden
{% 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 %}

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

{% tab title="409" %}
Conflict
{% 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 %}

{% 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 parametersexport feature_flag_id="550e8400-e29b-41d4-a716-446655440000"export environment_id="550e8400-e29b-41d4-a716-446655440001"\# Curl commandcurl -X POST "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/feature-flags/${feature_flag_id}/environments/${environment_id}/allocations" \
-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": {
    "type": "allocations",
    "attributes": {
      "name": "New targeting rule Example-Feature-Flag",
      "key": "new-targeting-rule-example-feature-flag",
      "targeting_rules": [],
      "variant_weights": [
        {
          "variant_id": "550e8400-e29b-41d4-a716-446655440002",
          "value": 100
        }
      ],
      "guardrail_metrics": [],
      "type": "CANARY"
    }
  }
}
EOF
                        
{% /tab %}

## Disable a feature flag in an environment{% #disable-a-feature-flag-in-an-environment %}

{% tab title="v2" %}

| Datadog site      | API endpoint                                                                                                    |
| ----------------- | --------------------------------------------------------------------------------------------------------------- |
| ap1.datadoghq.com | POST https://api.ap1.datadoghq.com/api/v2/feature-flags/{feature_flag_id}/environments/{environment_id}/disable |
| ap2.datadoghq.com | POST https://api.ap2.datadoghq.com/api/v2/feature-flags/{feature_flag_id}/environments/{environment_id}/disable |
| app.datadoghq.eu  | POST https://api.datadoghq.eu/api/v2/feature-flags/{feature_flag_id}/environments/{environment_id}/disable      |
| app.ddog-gov.com  | POST https://api.ddog-gov.com/api/v2/feature-flags/{feature_flag_id}/environments/{environment_id}/disable      |
| app.datadoghq.com | POST https://api.datadoghq.com/api/v2/feature-flags/{feature_flag_id}/environments/{environment_id}/disable     |
| us3.datadoghq.com | POST https://api.us3.datadoghq.com/api/v2/feature-flags/{feature_flag_id}/environments/{environment_id}/disable |
| us5.datadoghq.com | POST https://api.us5.datadoghq.com/api/v2/feature-flags/{feature_flag_id}/environments/{environment_id}/disable |

### Overview

Disable a feature flag in a specific environment. This endpoint requires all of the following permissions:
`feature_flag_config_write``feature_flag_environment_config_read`


### Arguments

#### Path Parameters

| Name                              | Type   | Description                 |
| --------------------------------- | ------ | --------------------------- |
| feature_flag_id [*required*] | string | The ID of the feature flag. |
| environment_id [*required*]  | string | The ID of the environment.  |

### Response

{% tab title="200" %}
OK
{% /tab %}

{% tab title="202" %}
Accepted - Approval required for this change
{% /tab %}

{% tab title="403" %}
Forbidden
{% 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 %}

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

{% 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 parametersexport feature_flag_id="550e8400-e29b-41d4-a716-446655440000"export environment_id="550e8400-e29b-41d4-a716-446655440001"\# Curl commandcurl -X POST "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/feature-flags/${feature_flag_id}/environments/${environment_id}/disable" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
                
{% /tab %}

## Enable a feature flag in an environment{% #enable-a-feature-flag-in-an-environment %}

{% tab title="v2" %}

| Datadog site      | API endpoint                                                                                                   |
| ----------------- | -------------------------------------------------------------------------------------------------------------- |
| ap1.datadoghq.com | POST https://api.ap1.datadoghq.com/api/v2/feature-flags/{feature_flag_id}/environments/{environment_id}/enable |
| ap2.datadoghq.com | POST https://api.ap2.datadoghq.com/api/v2/feature-flags/{feature_flag_id}/environments/{environment_id}/enable |
| app.datadoghq.eu  | POST https://api.datadoghq.eu/api/v2/feature-flags/{feature_flag_id}/environments/{environment_id}/enable      |
| app.ddog-gov.com  | POST https://api.ddog-gov.com/api/v2/feature-flags/{feature_flag_id}/environments/{environment_id}/enable      |
| app.datadoghq.com | POST https://api.datadoghq.com/api/v2/feature-flags/{feature_flag_id}/environments/{environment_id}/enable     |
| us3.datadoghq.com | POST https://api.us3.datadoghq.com/api/v2/feature-flags/{feature_flag_id}/environments/{environment_id}/enable |
| us5.datadoghq.com | POST https://api.us5.datadoghq.com/api/v2/feature-flags/{feature_flag_id}/environments/{environment_id}/enable |

### Overview

Enable a feature flag in a specific environment. This endpoint requires all of the following permissions:
`feature_flag_config_write``feature_flag_environment_config_read`


### Arguments

#### Path Parameters

| Name                              | Type   | Description                 |
| --------------------------------- | ------ | --------------------------- |
| feature_flag_id [*required*] | string | The ID of the feature flag. |
| environment_id [*required*]  | string | The ID of the environment.  |

### Response

{% tab title="200" %}
OK
{% /tab %}

{% tab title="202" %}
Accepted - Approval required for this change
{% /tab %}

{% tab title="403" %}
Forbidden
{% 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 %}

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

{% 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 parametersexport feature_flag_id="550e8400-e29b-41d4-a716-446655440000"export environment_id="550e8400-e29b-41d4-a716-446655440001"\# Curl commandcurl -X POST "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/feature-flags/${feature_flag_id}/environments/${environment_id}/enable" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
                
{% /tab %}

## Unarchive a feature flag{% #unarchive-a-feature-flag %}

{% tab title="v2" %}

| Datadog site      | API endpoint                                                                        |
| ----------------- | ----------------------------------------------------------------------------------- |
| ap1.datadoghq.com | POST https://api.ap1.datadoghq.com/api/v2/feature-flags/{feature_flag_id}/unarchive |
| ap2.datadoghq.com | POST https://api.ap2.datadoghq.com/api/v2/feature-flags/{feature_flag_id}/unarchive |
| app.datadoghq.eu  | POST https://api.datadoghq.eu/api/v2/feature-flags/{feature_flag_id}/unarchive      |
| app.ddog-gov.com  | POST https://api.ddog-gov.com/api/v2/feature-flags/{feature_flag_id}/unarchive      |
| app.datadoghq.com | POST https://api.datadoghq.com/api/v2/feature-flags/{feature_flag_id}/unarchive     |
| us3.datadoghq.com | POST https://api.us3.datadoghq.com/api/v2/feature-flags/{feature_flag_id}/unarchive |
| us5.datadoghq.com | POST https://api.us5.datadoghq.com/api/v2/feature-flags/{feature_flag_id}/unarchive |

### Overview

Unarchives a previously archived feature flag, making it visible in the main list again. This endpoint requires all of the following permissions:
`feature_flag_config_write``feature_flag_environment_config_read`


### Arguments

#### Path Parameters

| Name                              | Type   | Description                 |
| --------------------------------- | ------ | --------------------------- |
| feature_flag_id [*required*] | string | The ID of the feature flag. |

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response containing a feature flag.

| Parent field              | Field                            | Type      | Description                                                                                                  |
| ------------------------- | -------------------------------- | --------- | ------------------------------------------------------------------------------------------------------------ |
|                           | data [*required*]           | object    | A feature flag resource.                                                                                     |
| data                      | attributes [*required*]     | object    | Attributes of a feature flag.                                                                                |
| attributes                | archived_at                      | date-time | The timestamp when the feature flag was archived.                                                            |
| attributes                | created_at                       | date-time | The timestamp when the feature flag was created.                                                             |
| attributes                | created_by                       | uuid      | The ID of the user who created the feature flag.                                                             |
| attributes                | description [*required*]    | string    | The description of the feature flag.                                                                         |
| attributes                | distribution_channel             | string    | Distribution channel for the feature flag.                                                                   |
| attributes                | feature_flag_environments        | [object]  | Environment-specific settings for the feature flag.                                                          |
| feature_flag_environments | allocations                      | object    | Allocation metadata for this environment.                                                                    |
| feature_flag_environments | default_allocation_key           | string    | The allocation key used for the default variant.                                                             |
| feature_flag_environments | default_variant_id               | string    | The ID of the default variant for this environment.                                                          |
| feature_flag_environments | environment_id [*required*] | uuid      | The ID of the environment.                                                                                   |
| feature_flag_environments | environment_name                 | string    | The name of the environment.                                                                                 |
| feature_flag_environments | environment_queries              | [string]  | Queries that target this environment.                                                                        |
| feature_flag_environments | is_production                    | boolean   | Indicates whether the environment is production.                                                             |
| feature_flag_environments | override_allocation_key          | string    | The allocation key used for the override variant.                                                            |
| feature_flag_environments | override_variant_id              | string    | The ID of the override variant for this environment.                                                         |
| feature_flag_environments | pending_suggestion_id            | string    | Pending suggestion identifier, if approval is required.                                                      |
| feature_flag_environments | require_feature_flag_approval    | boolean   | Indicates whether feature flag changes require approval in this environment.                                 |
| feature_flag_environments | rollout_percentage               | int64     | Rollout percentage for this environment.                                                                     |
| feature_flag_environments | rules                            | [object]  | Environment targeting rules for this feature flag.                                                           |
| feature_flag_environments | status [*required*]         | enum      | The status of a feature flag in an environment. Allowed enum values: `ENABLED,DISABLED`                      |
| attributes                | json_schema                      | string    | JSON schema for validation when value_type is JSON.                                                          |
| attributes                | key [*required*]            | string    | The unique key of the feature flag.                                                                          |
| attributes                | last_updated_by                  | uuid      | The ID of the user who last updated the feature flag.                                                        |
| attributes                | name [*required*]           | string    | The name of the feature flag.                                                                                |
| attributes                | require_approval                 | boolean   | Indicates whether this feature flag requires approval for changes.                                           |
| attributes                | tags                             | [string]  | Tags associated with the feature flag.                                                                       |
| attributes                | updated_at                       | date-time | The timestamp when the feature flag was last updated.                                                        |
| attributes                | value_type [*required*]     | enum      | The type of values for the feature flag variants. Allowed enum values: `BOOLEAN,INTEGER,NUMERIC,STRING,JSON` |
| attributes                | variants [*required*]       | [object]  | The variants of the feature flag.                                                                            |
| variants                  | created_at                       | date-time | The timestamp when the variant was created.                                                                  |
| variants                  | id [*required*]             | uuid      | The unique identifier of the variant.                                                                        |
| variants                  | key [*required*]            | string    | The unique key of the variant.                                                                               |
| variants                  | name [*required*]           | string    | The name of the variant.                                                                                     |
| variants                  | updated_at                       | date-time | The timestamp when the variant was last updated.                                                             |
| variants                  | value [*required*]          | string    | The value of the variant as a string.                                                                        |
| data                      | id [*required*]             | uuid      | The unique identifier of the feature flag.                                                                   |
| data                      | type [*required*]           | enum      | The resource type. Allowed enum values: `feature-flags`                                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "archived_at": "2023-01-01T00:00:00Z",
      "created_at": "2023-01-01T00:00:00Z",
      "created_by": "550e8400-e29b-41d4-a716-446655440010",
      "description": "This is an example feature flag for demonstration",
      "distribution_channel": "ALL",
      "feature_flag_environments": [
        {
          "allocations": {},
          "default_allocation_key": "allocation-default-123abc",
          "default_variant_id": "550e8400-e29b-41d4-a716-446655440002",
          "environment_id": "550e8400-e29b-41d4-a716-446655440001",
          "environment_name": "env-search-term",
          "environment_queries": [
            "test-feature-flag",
            "env-search-term"
          ],
          "is_production": false,
          "override_allocation_key": "allocation-override-123abc",
          "override_variant_id": "550e8400-e29b-41d4-a716-446655440003",
          "pending_suggestion_id": "550e8400-e29b-41d4-a716-446655440099",
          "require_feature_flag_approval": false,
          "rollout_percentage": 0,
          "rules": [],
          "status": "ENABLED"
        }
      ],
      "json_schema": "{\"type\": \"object\", \"properties\": {\"enabled\": {\"type\": \"boolean\"}}}",
      "key": "feature-flag-abc123",
      "last_updated_by": "550e8400-e29b-41d4-a716-446655440010",
      "name": "Feature Flag ABC123",
      "require_approval": false,
      "tags": [
        []
      ],
      "updated_at": "2023-01-01T00:00:00Z",
      "value_type": "BOOLEAN",
      "variants": [
        {
          "created_at": "2023-01-01T00:00:00Z",
          "id": "550e8400-e29b-41d4-a716-446655440002",
          "key": "variant-abc123",
          "name": "Variant ABC123",
          "updated_at": "2023-01-01T00:00:00Z",
          "value": "true"
        }
      ]
    },
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "type": "feature-flags"
  }
}
```

{% /tab %}

{% /tab %}

{% tab title="400" %}
Bad Request
{% 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 %}

{% tab title="403" %}
Forbidden
{% 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 %}

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

{% 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 parametersexport feature_flag_id="550e8400-e29b-41d4-a716-446655440000"\# Curl commandcurl -X POST "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/feature-flags/${feature_flag_id}/unarchive" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
                
{% /tab %}

## Archive a feature flag{% #archive-a-feature-flag %}

{% tab title="v2" %}

| Datadog site      | API endpoint                                                                      |
| ----------------- | --------------------------------------------------------------------------------- |
| ap1.datadoghq.com | POST https://api.ap1.datadoghq.com/api/v2/feature-flags/{feature_flag_id}/archive |
| ap2.datadoghq.com | POST https://api.ap2.datadoghq.com/api/v2/feature-flags/{feature_flag_id}/archive |
| app.datadoghq.eu  | POST https://api.datadoghq.eu/api/v2/feature-flags/{feature_flag_id}/archive      |
| app.ddog-gov.com  | POST https://api.ddog-gov.com/api/v2/feature-flags/{feature_flag_id}/archive      |
| app.datadoghq.com | POST https://api.datadoghq.com/api/v2/feature-flags/{feature_flag_id}/archive     |
| us3.datadoghq.com | POST https://api.us3.datadoghq.com/api/v2/feature-flags/{feature_flag_id}/archive |
| us5.datadoghq.com | POST https://api.us5.datadoghq.com/api/v2/feature-flags/{feature_flag_id}/archive |

### Overview

Archives a feature flag. Archived flags are hidden from the main list but remain accessible and can be unarchived. This endpoint requires all of the following permissions:
`feature_flag_config_write``feature_flag_environment_config_read`


### Arguments

#### Path Parameters

| Name                              | Type   | Description                 |
| --------------------------------- | ------ | --------------------------- |
| feature_flag_id [*required*] | string | The ID of the feature flag. |

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response containing a feature flag.

| Parent field              | Field                            | Type      | Description                                                                                                  |
| ------------------------- | -------------------------------- | --------- | ------------------------------------------------------------------------------------------------------------ |
|                           | data [*required*]           | object    | A feature flag resource.                                                                                     |
| data                      | attributes [*required*]     | object    | Attributes of a feature flag.                                                                                |
| attributes                | archived_at                      | date-time | The timestamp when the feature flag was archived.                                                            |
| attributes                | created_at                       | date-time | The timestamp when the feature flag was created.                                                             |
| attributes                | created_by                       | uuid      | The ID of the user who created the feature flag.                                                             |
| attributes                | description [*required*]    | string    | The description of the feature flag.                                                                         |
| attributes                | distribution_channel             | string    | Distribution channel for the feature flag.                                                                   |
| attributes                | feature_flag_environments        | [object]  | Environment-specific settings for the feature flag.                                                          |
| feature_flag_environments | allocations                      | object    | Allocation metadata for this environment.                                                                    |
| feature_flag_environments | default_allocation_key           | string    | The allocation key used for the default variant.                                                             |
| feature_flag_environments | default_variant_id               | string    | The ID of the default variant for this environment.                                                          |
| feature_flag_environments | environment_id [*required*] | uuid      | The ID of the environment.                                                                                   |
| feature_flag_environments | environment_name                 | string    | The name of the environment.                                                                                 |
| feature_flag_environments | environment_queries              | [string]  | Queries that target this environment.                                                                        |
| feature_flag_environments | is_production                    | boolean   | Indicates whether the environment is production.                                                             |
| feature_flag_environments | override_allocation_key          | string    | The allocation key used for the override variant.                                                            |
| feature_flag_environments | override_variant_id              | string    | The ID of the override variant for this environment.                                                         |
| feature_flag_environments | pending_suggestion_id            | string    | Pending suggestion identifier, if approval is required.                                                      |
| feature_flag_environments | require_feature_flag_approval    | boolean   | Indicates whether feature flag changes require approval in this environment.                                 |
| feature_flag_environments | rollout_percentage               | int64     | Rollout percentage for this environment.                                                                     |
| feature_flag_environments | rules                            | [object]  | Environment targeting rules for this feature flag.                                                           |
| feature_flag_environments | status [*required*]         | enum      | The status of a feature flag in an environment. Allowed enum values: `ENABLED,DISABLED`                      |
| attributes                | json_schema                      | string    | JSON schema for validation when value_type is JSON.                                                          |
| attributes                | key [*required*]            | string    | The unique key of the feature flag.                                                                          |
| attributes                | last_updated_by                  | uuid      | The ID of the user who last updated the feature flag.                                                        |
| attributes                | name [*required*]           | string    | The name of the feature flag.                                                                                |
| attributes                | require_approval                 | boolean   | Indicates whether this feature flag requires approval for changes.                                           |
| attributes                | tags                             | [string]  | Tags associated with the feature flag.                                                                       |
| attributes                | updated_at                       | date-time | The timestamp when the feature flag was last updated.                                                        |
| attributes                | value_type [*required*]     | enum      | The type of values for the feature flag variants. Allowed enum values: `BOOLEAN,INTEGER,NUMERIC,STRING,JSON` |
| attributes                | variants [*required*]       | [object]  | The variants of the feature flag.                                                                            |
| variants                  | created_at                       | date-time | The timestamp when the variant was created.                                                                  |
| variants                  | id [*required*]             | uuid      | The unique identifier of the variant.                                                                        |
| variants                  | key [*required*]            | string    | The unique key of the variant.                                                                               |
| variants                  | name [*required*]           | string    | The name of the variant.                                                                                     |
| variants                  | updated_at                       | date-time | The timestamp when the variant was last updated.                                                             |
| variants                  | value [*required*]          | string    | The value of the variant as a string.                                                                        |
| data                      | id [*required*]             | uuid      | The unique identifier of the feature flag.                                                                   |
| data                      | type [*required*]           | enum      | The resource type. Allowed enum values: `feature-flags`                                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "archived_at": "2023-01-01T00:00:00Z",
      "created_at": "2023-01-01T00:00:00Z",
      "created_by": "550e8400-e29b-41d4-a716-446655440010",
      "description": "This is an example feature flag for demonstration",
      "distribution_channel": "ALL",
      "feature_flag_environments": [
        {
          "allocations": {},
          "default_allocation_key": "allocation-default-123abc",
          "default_variant_id": "550e8400-e29b-41d4-a716-446655440002",
          "environment_id": "550e8400-e29b-41d4-a716-446655440001",
          "environment_name": "env-search-term",
          "environment_queries": [
            "test-feature-flag",
            "env-search-term"
          ],
          "is_production": false,
          "override_allocation_key": "allocation-override-123abc",
          "override_variant_id": "550e8400-e29b-41d4-a716-446655440003",
          "pending_suggestion_id": "550e8400-e29b-41d4-a716-446655440099",
          "require_feature_flag_approval": false,
          "rollout_percentage": 0,
          "rules": [],
          "status": "ENABLED"
        }
      ],
      "json_schema": "{\"type\": \"object\", \"properties\": {\"enabled\": {\"type\": \"boolean\"}}}",
      "key": "feature-flag-abc123",
      "last_updated_by": "550e8400-e29b-41d4-a716-446655440010",
      "name": "Feature Flag ABC123",
      "require_approval": false,
      "tags": [
        []
      ],
      "updated_at": "2023-01-01T00:00:00Z",
      "value_type": "BOOLEAN",
      "variants": [
        {
          "created_at": "2023-01-01T00:00:00Z",
          "id": "550e8400-e29b-41d4-a716-446655440002",
          "key": "variant-abc123",
          "name": "Variant ABC123",
          "updated_at": "2023-01-01T00:00:00Z",
          "value": "true"
        }
      ]
    },
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "type": "feature-flags"
  }
}
```

{% /tab %}

{% /tab %}

{% tab title="400" %}
Bad Request
{% 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 %}

{% tab title="403" %}
Forbidden
{% 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 %}

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

{% 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 parametersexport feature_flag_id="550e8400-e29b-41d4-a716-446655440000"\# Curl commandcurl -X POST "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/feature-flags/${feature_flag_id}/archive" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
                
{% /tab %}

## Update a feature flag{% #update-a-feature-flag %}

{% tab title="v2" %}

| Datadog site      | API endpoint                                                             |
| ----------------- | ------------------------------------------------------------------------ |
| ap1.datadoghq.com | PUT https://api.ap1.datadoghq.com/api/v2/feature-flags/{feature_flag_id} |
| ap2.datadoghq.com | PUT https://api.ap2.datadoghq.com/api/v2/feature-flags/{feature_flag_id} |
| app.datadoghq.eu  | PUT https://api.datadoghq.eu/api/v2/feature-flags/{feature_flag_id}      |
| app.ddog-gov.com  | PUT https://api.ddog-gov.com/api/v2/feature-flags/{feature_flag_id}      |
| app.datadoghq.com | PUT https://api.datadoghq.com/api/v2/feature-flags/{feature_flag_id}     |
| us3.datadoghq.com | PUT https://api.us3.datadoghq.com/api/v2/feature-flags/{feature_flag_id} |
| us5.datadoghq.com | PUT https://api.us5.datadoghq.com/api/v2/feature-flags/{feature_flag_id} |

### Overview

Updates an existing feature flag's metadata such as name and description. Does not modify targeting rules or allocations. This endpoint requires all of the following permissions:
`feature_flag_config_write``feature_flag_environment_config_read`


### Arguments

#### Path Parameters

| Name                              | Type   | Description                 |
| --------------------------------- | ------ | --------------------------- |
| feature_flag_id [*required*] | string | The ID of the feature flag. |

### Request

#### Body Data (required)



{% tab title="Model" %}

| Parent field | Field                        | Type   | Description                                             |
| ------------ | ---------------------------- | ------ | ------------------------------------------------------- |
|              | data [*required*]       | object | Data for updating a feature flag.                       |
| data         | attributes [*required*] | object | Attributes for updating a feature flag.                 |
| attributes   | description                  | string | The description of the feature flag.                    |
| attributes   | json_schema                  | string | JSON schema for validation when value_type is JSON.     |
| attributes   | name                         | string | The name of the feature flag.                           |
| data         | type [*required*]       | enum   | The resource type. Allowed enum values: `feature-flags` |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "type": "feature-flags",
    "attributes": {
      "description": "Updated description for the feature flag",
      "name": "Updated Test Feature Flag Example-Feature-Flag"
    }
  }
}
```

{% /tab %}

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response containing a feature flag.

| Parent field              | Field                            | Type      | Description                                                                                                  |
| ------------------------- | -------------------------------- | --------- | ------------------------------------------------------------------------------------------------------------ |
|                           | data [*required*]           | object    | A feature flag resource.                                                                                     |
| data                      | attributes [*required*]     | object    | Attributes of a feature flag.                                                                                |
| attributes                | archived_at                      | date-time | The timestamp when the feature flag was archived.                                                            |
| attributes                | created_at                       | date-time | The timestamp when the feature flag was created.                                                             |
| attributes                | created_by                       | uuid      | The ID of the user who created the feature flag.                                                             |
| attributes                | description [*required*]    | string    | The description of the feature flag.                                                                         |
| attributes                | distribution_channel             | string    | Distribution channel for the feature flag.                                                                   |
| attributes                | feature_flag_environments        | [object]  | Environment-specific settings for the feature flag.                                                          |
| feature_flag_environments | allocations                      | object    | Allocation metadata for this environment.                                                                    |
| feature_flag_environments | default_allocation_key           | string    | The allocation key used for the default variant.                                                             |
| feature_flag_environments | default_variant_id               | string    | The ID of the default variant for this environment.                                                          |
| feature_flag_environments | environment_id [*required*] | uuid      | The ID of the environment.                                                                                   |
| feature_flag_environments | environment_name                 | string    | The name of the environment.                                                                                 |
| feature_flag_environments | environment_queries              | [string]  | Queries that target this environment.                                                                        |
| feature_flag_environments | is_production                    | boolean   | Indicates whether the environment is production.                                                             |
| feature_flag_environments | override_allocation_key          | string    | The allocation key used for the override variant.                                                            |
| feature_flag_environments | override_variant_id              | string    | The ID of the override variant for this environment.                                                         |
| feature_flag_environments | pending_suggestion_id            | string    | Pending suggestion identifier, if approval is required.                                                      |
| feature_flag_environments | require_feature_flag_approval    | boolean   | Indicates whether feature flag changes require approval in this environment.                                 |
| feature_flag_environments | rollout_percentage               | int64     | Rollout percentage for this environment.                                                                     |
| feature_flag_environments | rules                            | [object]  | Environment targeting rules for this feature flag.                                                           |
| feature_flag_environments | status [*required*]         | enum      | The status of a feature flag in an environment. Allowed enum values: `ENABLED,DISABLED`                      |
| attributes                | json_schema                      | string    | JSON schema for validation when value_type is JSON.                                                          |
| attributes                | key [*required*]            | string    | The unique key of the feature flag.                                                                          |
| attributes                | last_updated_by                  | uuid      | The ID of the user who last updated the feature flag.                                                        |
| attributes                | name [*required*]           | string    | The name of the feature flag.                                                                                |
| attributes                | require_approval                 | boolean   | Indicates whether this feature flag requires approval for changes.                                           |
| attributes                | tags                             | [string]  | Tags associated with the feature flag.                                                                       |
| attributes                | updated_at                       | date-time | The timestamp when the feature flag was last updated.                                                        |
| attributes                | value_type [*required*]     | enum      | The type of values for the feature flag variants. Allowed enum values: `BOOLEAN,INTEGER,NUMERIC,STRING,JSON` |
| attributes                | variants [*required*]       | [object]  | The variants of the feature flag.                                                                            |
| variants                  | created_at                       | date-time | The timestamp when the variant was created.                                                                  |
| variants                  | id [*required*]             | uuid      | The unique identifier of the variant.                                                                        |
| variants                  | key [*required*]            | string    | The unique key of the variant.                                                                               |
| variants                  | name [*required*]           | string    | The name of the variant.                                                                                     |
| variants                  | updated_at                       | date-time | The timestamp when the variant was last updated.                                                             |
| variants                  | value [*required*]          | string    | The value of the variant as a string.                                                                        |
| data                      | id [*required*]             | uuid      | The unique identifier of the feature flag.                                                                   |
| data                      | type [*required*]           | enum      | The resource type. Allowed enum values: `feature-flags`                                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "archived_at": "2023-01-01T00:00:00Z",
      "created_at": "2023-01-01T00:00:00Z",
      "created_by": "550e8400-e29b-41d4-a716-446655440010",
      "description": "This is an example feature flag for demonstration",
      "distribution_channel": "ALL",
      "feature_flag_environments": [
        {
          "allocations": {},
          "default_allocation_key": "allocation-default-123abc",
          "default_variant_id": "550e8400-e29b-41d4-a716-446655440002",
          "environment_id": "550e8400-e29b-41d4-a716-446655440001",
          "environment_name": "env-search-term",
          "environment_queries": [
            "test-feature-flag",
            "env-search-term"
          ],
          "is_production": false,
          "override_allocation_key": "allocation-override-123abc",
          "override_variant_id": "550e8400-e29b-41d4-a716-446655440003",
          "pending_suggestion_id": "550e8400-e29b-41d4-a716-446655440099",
          "require_feature_flag_approval": false,
          "rollout_percentage": 0,
          "rules": [],
          "status": "ENABLED"
        }
      ],
      "json_schema": "{\"type\": \"object\", \"properties\": {\"enabled\": {\"type\": \"boolean\"}}}",
      "key": "feature-flag-abc123",
      "last_updated_by": "550e8400-e29b-41d4-a716-446655440010",
      "name": "Feature Flag ABC123",
      "require_approval": false,
      "tags": [
        []
      ],
      "updated_at": "2023-01-01T00:00:00Z",
      "value_type": "BOOLEAN",
      "variants": [
        {
          "created_at": "2023-01-01T00:00:00Z",
          "id": "550e8400-e29b-41d4-a716-446655440002",
          "key": "variant-abc123",
          "name": "Variant ABC123",
          "updated_at": "2023-01-01T00:00:00Z",
          "value": "true"
        }
      ]
    },
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "type": "feature-flags"
  }
}
```

{% /tab %}

{% /tab %}

{% tab title="400" %}
Bad Request
{% 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 %}

{% tab title="403" %}
Forbidden
{% 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 %}

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

{% 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 parametersexport feature_flag_id="550e8400-e29b-41d4-a716-446655440000"\# Curl commandcurl -X PUT "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/feature-flags/${feature_flag_id}" \
-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": {
    "type": "feature-flags",
    "attributes": {
      "description": "Updated description for the feature flag",
      "name": "Updated Test Feature Flag Example-Feature-Flag"
    }
  }
}
EOF
                        
{% /tab %}

## Get a feature flag{% #get-a-feature-flag %}

{% tab title="v2" %}

| Datadog site      | API endpoint                                                             |
| ----------------- | ------------------------------------------------------------------------ |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v2/feature-flags/{feature_flag_id} |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v2/feature-flags/{feature_flag_id} |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v2/feature-flags/{feature_flag_id}      |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v2/feature-flags/{feature_flag_id}      |
| app.datadoghq.com | GET https://api.datadoghq.com/api/v2/feature-flags/{feature_flag_id}     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v2/feature-flags/{feature_flag_id} |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v2/feature-flags/{feature_flag_id} |

### Overview

Returns the details of a specific feature flag including variants and environment status. This endpoint requires all of the following permissions:
`feature_flag_config_read``feature_flag_environment_config_read`


### Arguments

#### Path Parameters

| Name                              | Type   | Description                 |
| --------------------------------- | ------ | --------------------------- |
| feature_flag_id [*required*] | string | The ID of the feature flag. |

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response containing a feature flag.

| Parent field              | Field                            | Type      | Description                                                                                                  |
| ------------------------- | -------------------------------- | --------- | ------------------------------------------------------------------------------------------------------------ |
|                           | data [*required*]           | object    | A feature flag resource.                                                                                     |
| data                      | attributes [*required*]     | object    | Attributes of a feature flag.                                                                                |
| attributes                | archived_at                      | date-time | The timestamp when the feature flag was archived.                                                            |
| attributes                | created_at                       | date-time | The timestamp when the feature flag was created.                                                             |
| attributes                | created_by                       | uuid      | The ID of the user who created the feature flag.                                                             |
| attributes                | description [*required*]    | string    | The description of the feature flag.                                                                         |
| attributes                | distribution_channel             | string    | Distribution channel for the feature flag.                                                                   |
| attributes                | feature_flag_environments        | [object]  | Environment-specific settings for the feature flag.                                                          |
| feature_flag_environments | allocations                      | object    | Allocation metadata for this environment.                                                                    |
| feature_flag_environments | default_allocation_key           | string    | The allocation key used for the default variant.                                                             |
| feature_flag_environments | default_variant_id               | string    | The ID of the default variant for this environment.                                                          |
| feature_flag_environments | environment_id [*required*] | uuid      | The ID of the environment.                                                                                   |
| feature_flag_environments | environment_name                 | string    | The name of the environment.                                                                                 |
| feature_flag_environments | environment_queries              | [string]  | Queries that target this environment.                                                                        |
| feature_flag_environments | is_production                    | boolean   | Indicates whether the environment is production.                                                             |
| feature_flag_environments | override_allocation_key          | string    | The allocation key used for the override variant.                                                            |
| feature_flag_environments | override_variant_id              | string    | The ID of the override variant for this environment.                                                         |
| feature_flag_environments | pending_suggestion_id            | string    | Pending suggestion identifier, if approval is required.                                                      |
| feature_flag_environments | require_feature_flag_approval    | boolean   | Indicates whether feature flag changes require approval in this environment.                                 |
| feature_flag_environments | rollout_percentage               | int64     | Rollout percentage for this environment.                                                                     |
| feature_flag_environments | rules                            | [object]  | Environment targeting rules for this feature flag.                                                           |
| feature_flag_environments | status [*required*]         | enum      | The status of a feature flag in an environment. Allowed enum values: `ENABLED,DISABLED`                      |
| attributes                | json_schema                      | string    | JSON schema for validation when value_type is JSON.                                                          |
| attributes                | key [*required*]            | string    | The unique key of the feature flag.                                                                          |
| attributes                | last_updated_by                  | uuid      | The ID of the user who last updated the feature flag.                                                        |
| attributes                | name [*required*]           | string    | The name of the feature flag.                                                                                |
| attributes                | require_approval                 | boolean   | Indicates whether this feature flag requires approval for changes.                                           |
| attributes                | tags                             | [string]  | Tags associated with the feature flag.                                                                       |
| attributes                | updated_at                       | date-time | The timestamp when the feature flag was last updated.                                                        |
| attributes                | value_type [*required*]     | enum      | The type of values for the feature flag variants. Allowed enum values: `BOOLEAN,INTEGER,NUMERIC,STRING,JSON` |
| attributes                | variants [*required*]       | [object]  | The variants of the feature flag.                                                                            |
| variants                  | created_at                       | date-time | The timestamp when the variant was created.                                                                  |
| variants                  | id [*required*]             | uuid      | The unique identifier of the variant.                                                                        |
| variants                  | key [*required*]            | string    | The unique key of the variant.                                                                               |
| variants                  | name [*required*]           | string    | The name of the variant.                                                                                     |
| variants                  | updated_at                       | date-time | The timestamp when the variant was last updated.                                                             |
| variants                  | value [*required*]          | string    | The value of the variant as a string.                                                                        |
| data                      | id [*required*]             | uuid      | The unique identifier of the feature flag.                                                                   |
| data                      | type [*required*]           | enum      | The resource type. Allowed enum values: `feature-flags`                                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "archived_at": "2023-01-01T00:00:00Z",
      "created_at": "2023-01-01T00:00:00Z",
      "created_by": "550e8400-e29b-41d4-a716-446655440010",
      "description": "This is an example feature flag for demonstration",
      "distribution_channel": "ALL",
      "feature_flag_environments": [
        {
          "allocations": {},
          "default_allocation_key": "allocation-default-123abc",
          "default_variant_id": "550e8400-e29b-41d4-a716-446655440002",
          "environment_id": "550e8400-e29b-41d4-a716-446655440001",
          "environment_name": "env-search-term",
          "environment_queries": [
            "test-feature-flag",
            "env-search-term"
          ],
          "is_production": false,
          "override_allocation_key": "allocation-override-123abc",
          "override_variant_id": "550e8400-e29b-41d4-a716-446655440003",
          "pending_suggestion_id": "550e8400-e29b-41d4-a716-446655440099",
          "require_feature_flag_approval": false,
          "rollout_percentage": 0,
          "rules": [],
          "status": "ENABLED"
        }
      ],
      "json_schema": "{\"type\": \"object\", \"properties\": {\"enabled\": {\"type\": \"boolean\"}}}",
      "key": "feature-flag-abc123",
      "last_updated_by": "550e8400-e29b-41d4-a716-446655440010",
      "name": "Feature Flag ABC123",
      "require_approval": false,
      "tags": [
        []
      ],
      "updated_at": "2023-01-01T00:00:00Z",
      "value_type": "BOOLEAN",
      "variants": [
        {
          "created_at": "2023-01-01T00:00:00Z",
          "id": "550e8400-e29b-41d4-a716-446655440002",
          "key": "variant-abc123",
          "name": "Variant ABC123",
          "updated_at": "2023-01-01T00:00:00Z",
          "value": "true"
        }
      ]
    },
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "type": "feature-flags"
  }
}
```

{% /tab %}

{% /tab %}

{% tab title="403" %}
Forbidden
{% 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 %}

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

{% 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 parametersexport feature_flag_id="550e8400-e29b-41d4-a716-446655440000"\# Curl commandcurl -X GET "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/feature-flags/${feature_flag_id}" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
                
{% /tab %}

## Create a feature flag{% #create-a-feature-flag %}

{% tab title="v2" %}

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

### Overview

Creates a new feature flag with variants. This endpoint requires all of the following permissions:
`feature_flag_config_write``feature_flag_environment_config_read`


### Request

#### Body Data (required)



{% tab title="Model" %}

| Parent field | Field                         | Type     | Description                                                                                                  |
| ------------ | ----------------------------- | -------- | ------------------------------------------------------------------------------------------------------------ |
|              | data [*required*]        | object   | Data for creating a new feature flag.                                                                        |
| data         | attributes [*required*]  | object   | Attributes for creating a new feature flag.                                                                  |
| attributes   | default_variant_key           | string   | The key of the default variant.                                                                              |
| attributes   | description [*required*] | string   | The description of the feature flag.                                                                         |
| attributes   | json_schema                   | string   | JSON schema for validation when value_type is JSON.                                                          |
| attributes   | key [*required*]         | string   | The unique key of the feature flag.                                                                          |
| attributes   | name [*required*]        | string   | The name of the feature flag.                                                                                |
| attributes   | value_type [*required*]  | enum     | The type of values for the feature flag variants. Allowed enum values: `BOOLEAN,INTEGER,NUMERIC,STRING,JSON` |
| attributes   | variants [*required*]    | [object] | The variants of the feature flag.                                                                            |
| variants     | key [*required*]         | string   | The unique key of the variant.                                                                               |
| variants     | name [*required*]        | string   | The name of the variant.                                                                                     |
| variants     | value [*required*]       | string   | The value of the variant as a string.                                                                        |
| data         | type [*required*]        | enum     | The resource type. Allowed enum values: `feature-flags`                                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "type": "feature-flags",
    "attributes": {
      "default_variant_key": "variant-Example-Feature-Flag-1",
      "description": "Test feature flag for BDD scenarios",
      "key": "test-feature-flag-Example-Feature-Flag",
      "name": "Test Feature Flag Example-Feature-Flag",
      "value_type": "BOOLEAN",
      "variants": [
        {
          "key": "variant-Example-Feature-Flag-1",
          "name": "Variant Example-Feature-Flag A",
          "value": "true"
        },
        {
          "key": "variant-Example-Feature-Flag-2",
          "name": "Variant Example-Feature-Flag B",
          "value": "false"
        }
      ]
    }
  }
}
```

{% /tab %}

### Response

{% tab title="201" %}
Created
{% tab title="Model" %}
Response containing a feature flag.

| Parent field              | Field                            | Type      | Description                                                                                                  |
| ------------------------- | -------------------------------- | --------- | ------------------------------------------------------------------------------------------------------------ |
|                           | data [*required*]           | object    | A feature flag resource.                                                                                     |
| data                      | attributes [*required*]     | object    | Attributes of a feature flag.                                                                                |
| attributes                | archived_at                      | date-time | The timestamp when the feature flag was archived.                                                            |
| attributes                | created_at                       | date-time | The timestamp when the feature flag was created.                                                             |
| attributes                | created_by                       | uuid      | The ID of the user who created the feature flag.                                                             |
| attributes                | description [*required*]    | string    | The description of the feature flag.                                                                         |
| attributes                | distribution_channel             | string    | Distribution channel for the feature flag.                                                                   |
| attributes                | feature_flag_environments        | [object]  | Environment-specific settings for the feature flag.                                                          |
| feature_flag_environments | allocations                      | object    | Allocation metadata for this environment.                                                                    |
| feature_flag_environments | default_allocation_key           | string    | The allocation key used for the default variant.                                                             |
| feature_flag_environments | default_variant_id               | string    | The ID of the default variant for this environment.                                                          |
| feature_flag_environments | environment_id [*required*] | uuid      | The ID of the environment.                                                                                   |
| feature_flag_environments | environment_name                 | string    | The name of the environment.                                                                                 |
| feature_flag_environments | environment_queries              | [string]  | Queries that target this environment.                                                                        |
| feature_flag_environments | is_production                    | boolean   | Indicates whether the environment is production.                                                             |
| feature_flag_environments | override_allocation_key          | string    | The allocation key used for the override variant.                                                            |
| feature_flag_environments | override_variant_id              | string    | The ID of the override variant for this environment.                                                         |
| feature_flag_environments | pending_suggestion_id            | string    | Pending suggestion identifier, if approval is required.                                                      |
| feature_flag_environments | require_feature_flag_approval    | boolean   | Indicates whether feature flag changes require approval in this environment.                                 |
| feature_flag_environments | rollout_percentage               | int64     | Rollout percentage for this environment.                                                                     |
| feature_flag_environments | rules                            | [object]  | Environment targeting rules for this feature flag.                                                           |
| feature_flag_environments | status [*required*]         | enum      | The status of a feature flag in an environment. Allowed enum values: `ENABLED,DISABLED`                      |
| attributes                | json_schema                      | string    | JSON schema for validation when value_type is JSON.                                                          |
| attributes                | key [*required*]            | string    | The unique key of the feature flag.                                                                          |
| attributes                | last_updated_by                  | uuid      | The ID of the user who last updated the feature flag.                                                        |
| attributes                | name [*required*]           | string    | The name of the feature flag.                                                                                |
| attributes                | require_approval                 | boolean   | Indicates whether this feature flag requires approval for changes.                                           |
| attributes                | tags                             | [string]  | Tags associated with the feature flag.                                                                       |
| attributes                | updated_at                       | date-time | The timestamp when the feature flag was last updated.                                                        |
| attributes                | value_type [*required*]     | enum      | The type of values for the feature flag variants. Allowed enum values: `BOOLEAN,INTEGER,NUMERIC,STRING,JSON` |
| attributes                | variants [*required*]       | [object]  | The variants of the feature flag.                                                                            |
| variants                  | created_at                       | date-time | The timestamp when the variant was created.                                                                  |
| variants                  | id [*required*]             | uuid      | The unique identifier of the variant.                                                                        |
| variants                  | key [*required*]            | string    | The unique key of the variant.                                                                               |
| variants                  | name [*required*]           | string    | The name of the variant.                                                                                     |
| variants                  | updated_at                       | date-time | The timestamp when the variant was last updated.                                                             |
| variants                  | value [*required*]          | string    | The value of the variant as a string.                                                                        |
| data                      | id [*required*]             | uuid      | The unique identifier of the feature flag.                                                                   |
| data                      | type [*required*]           | enum      | The resource type. Allowed enum values: `feature-flags`                                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "archived_at": "2023-01-01T00:00:00Z",
      "created_at": "2023-01-01T00:00:00Z",
      "created_by": "550e8400-e29b-41d4-a716-446655440010",
      "description": "This is an example feature flag for demonstration",
      "distribution_channel": "ALL",
      "feature_flag_environments": [
        {
          "allocations": {},
          "default_allocation_key": "allocation-default-123abc",
          "default_variant_id": "550e8400-e29b-41d4-a716-446655440002",
          "environment_id": "550e8400-e29b-41d4-a716-446655440001",
          "environment_name": "env-search-term",
          "environment_queries": [
            "test-feature-flag",
            "env-search-term"
          ],
          "is_production": false,
          "override_allocation_key": "allocation-override-123abc",
          "override_variant_id": "550e8400-e29b-41d4-a716-446655440003",
          "pending_suggestion_id": "550e8400-e29b-41d4-a716-446655440099",
          "require_feature_flag_approval": false,
          "rollout_percentage": 0,
          "rules": [],
          "status": "ENABLED"
        }
      ],
      "json_schema": "{\"type\": \"object\", \"properties\": {\"enabled\": {\"type\": \"boolean\"}}}",
      "key": "feature-flag-abc123",
      "last_updated_by": "550e8400-e29b-41d4-a716-446655440010",
      "name": "Feature Flag ABC123",
      "require_approval": false,
      "tags": [
        []
      ],
      "updated_at": "2023-01-01T00:00:00Z",
      "value_type": "BOOLEAN",
      "variants": [
        {
          "created_at": "2023-01-01T00:00:00Z",
          "id": "550e8400-e29b-41d4-a716-446655440002",
          "key": "variant-abc123",
          "name": "Variant ABC123",
          "updated_at": "2023-01-01T00:00:00Z",
          "value": "true"
        }
      ]
    },
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "type": "feature-flags"
  }
}
```

{% /tab %}

{% /tab %}

{% tab title="400" %}
Bad Request
{% 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 %}

{% tab title="403" %}
Forbidden
{% 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 %}

{% tab title="409" %}
Conflict
{% 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 %}

{% 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

##### 
                          \# Curl commandcurl -X POST "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/feature-flags" \
-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": {
    "type": "feature-flags",
    "attributes": {
      "default_variant_key": "variant-Example-Feature-Flag-1",
      "description": "Test feature flag for BDD scenarios",
      "key": "test-feature-flag-Example-Feature-Flag",
      "name": "Test Feature Flag Example-Feature-Flag",
      "value_type": "BOOLEAN",
      "variants": [
        {
          "key": "variant-Example-Feature-Flag-1",
          "name": "Variant Example-Feature-Flag A",
          "value": "true"
        },
        {
          "key": "variant-Example-Feature-Flag-2",
          "name": "Variant Example-Feature-Flag B",
          "value": "false"
        }
      ]
    }
  }
}
EOF
                        
{% /tab %}

## List feature flags{% #list-feature-flags %}

{% tab title="v2" %}

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

### Overview

Returns a list of feature flags for the organization. Supports filtering by key and archived status. This endpoint requires all of the following permissions:
`feature_flag_config_read``feature_flag_environment_config_read`


### Arguments

#### Query Strings

| Name        | Type    | Description                                     |
| ----------- | ------- | ----------------------------------------------- |
| key         | string  | Filter feature flags by key (partial matching). |
| is_archived | boolean | Filter by archived status.                      |
| limit       | integer | Maximum number of results to return.            |
| offset      | integer | Number of results to skip.                      |

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response containing a list of feature flags.

| Parent field              | Field                            | Type      | Description                                                                                                  |
| ------------------------- | -------------------------------- | --------- | ------------------------------------------------------------------------------------------------------------ |
|                           | data [*required*]           | [object]  | List of feature flags.                                                                                       |
| data                      | attributes [*required*]     | object    | Attributes of a feature flag.                                                                                |
| attributes                | archived_at                      | date-time | The timestamp when the feature flag was archived.                                                            |
| attributes                | created_at                       | date-time | The timestamp when the feature flag was created.                                                             |
| attributes                | created_by                       | uuid      | The ID of the user who created the feature flag.                                                             |
| attributes                | description [*required*]    | string    | The description of the feature flag.                                                                         |
| attributes                | distribution_channel             | string    | Distribution channel for the feature flag.                                                                   |
| attributes                | feature_flag_environments        | [object]  | Environment-specific settings for the feature flag.                                                          |
| feature_flag_environments | allocations                      | object    | Allocation metadata for this environment.                                                                    |
| feature_flag_environments | default_allocation_key           | string    | The allocation key used for the default variant.                                                             |
| feature_flag_environments | default_variant_id               | string    | The ID of the default variant for this environment.                                                          |
| feature_flag_environments | environment_id [*required*] | uuid      | The ID of the environment.                                                                                   |
| feature_flag_environments | environment_name                 | string    | The name of the environment.                                                                                 |
| feature_flag_environments | environment_queries              | [string]  | Queries that target this environment.                                                                        |
| feature_flag_environments | is_production                    | boolean   | Indicates whether the environment is production.                                                             |
| feature_flag_environments | override_allocation_key          | string    | The allocation key used for the override variant.                                                            |
| feature_flag_environments | override_variant_id              | string    | The ID of the override variant for this environment.                                                         |
| feature_flag_environments | pending_suggestion_id            | string    | Pending suggestion identifier, if approval is required.                                                      |
| feature_flag_environments | require_feature_flag_approval    | boolean   | Indicates whether feature flag changes require approval in this environment.                                 |
| feature_flag_environments | rollout_percentage               | int64     | Rollout percentage for this environment.                                                                     |
| feature_flag_environments | rules                            | [object]  | Environment targeting rules for this feature flag.                                                           |
| feature_flag_environments | status [*required*]         | enum      | The status of a feature flag in an environment. Allowed enum values: `ENABLED,DISABLED`                      |
| attributes                | json_schema                      | string    | JSON schema for validation when value_type is JSON.                                                          |
| attributes                | key [*required*]            | string    | The unique key of the feature flag.                                                                          |
| attributes                | last_updated_by                  | uuid      | The ID of the user who last updated the feature flag.                                                        |
| attributes                | name [*required*]           | string    | The name of the feature flag.                                                                                |
| attributes                | require_approval                 | boolean   | Indicates whether this feature flag requires approval for changes.                                           |
| attributes                | tags                             | [string]  | Tags associated with the feature flag.                                                                       |
| attributes                | updated_at                       | date-time | The timestamp when the feature flag was last updated.                                                        |
| attributes                | value_type [*required*]     | enum      | The type of values for the feature flag variants. Allowed enum values: `BOOLEAN,INTEGER,NUMERIC,STRING,JSON` |
| attributes                | variants [*required*]       | [object]  | The variants of the feature flag.                                                                            |
| variants                  | created_at                       | date-time | The timestamp when the variant was created.                                                                  |
| variants                  | id [*required*]             | uuid      | The unique identifier of the variant.                                                                        |
| variants                  | key [*required*]            | string    | The unique key of the variant.                                                                               |
| variants                  | name [*required*]           | string    | The name of the variant.                                                                                     |
| variants                  | updated_at                       | date-time | The timestamp when the variant was last updated.                                                             |
| variants                  | value [*required*]          | string    | The value of the variant as a string.                                                                        |
| data                      | id [*required*]             | uuid      | The unique identifier of the feature flag.                                                                   |
| data                      | type [*required*]           | enum      | The resource type. Allowed enum values: `feature-flags`                                                      |
|                           | meta                             | object    | Pagination metadata for feature flags.                                                                       |
| meta                      | page                             | object    | Pagination metadata for feature flags list responses.                                                        |
| page                      | total_count                      | int64     | Total number of items.                                                                                       |
| page                      | total_filtered_count             | int64     | Total number of items matching the filter.                                                                   |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": [
    {
      "attributes": {
        "archived_at": "2023-01-01T00:00:00Z",
        "created_at": "2023-01-01T00:00:00Z",
        "created_by": "550e8400-e29b-41d4-a716-446655440010",
        "description": "This is an example feature flag for demonstration",
        "distribution_channel": "ALL",
        "feature_flag_environments": [
          {
            "allocations": {},
            "default_allocation_key": "allocation-default-123abc",
            "default_variant_id": "550e8400-e29b-41d4-a716-446655440002",
            "environment_id": "550e8400-e29b-41d4-a716-446655440001",
            "environment_name": "env-search-term",
            "environment_queries": [
              "test-feature-flag",
              "env-search-term"
            ],
            "is_production": false,
            "override_allocation_key": "allocation-override-123abc",
            "override_variant_id": "550e8400-e29b-41d4-a716-446655440003",
            "pending_suggestion_id": "550e8400-e29b-41d4-a716-446655440099",
            "require_feature_flag_approval": false,
            "rollout_percentage": 0,
            "rules": [],
            "status": "ENABLED"
          }
        ],
        "json_schema": "{\"type\": \"object\", \"properties\": {\"enabled\": {\"type\": \"boolean\"}}}",
        "key": "feature-flag-abc123",
        "last_updated_by": "550e8400-e29b-41d4-a716-446655440010",
        "name": "Feature Flag ABC123",
        "require_approval": false,
        "tags": [
          []
        ],
        "updated_at": "2023-01-01T00:00:00Z",
        "value_type": "BOOLEAN",
        "variants": [
          {
            "created_at": "2023-01-01T00:00:00Z",
            "id": "550e8400-e29b-41d4-a716-446655440002",
            "key": "variant-abc123",
            "name": "Variant ABC123",
            "updated_at": "2023-01-01T00:00:00Z",
            "value": "true"
          }
        ]
      },
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "type": "feature-flags"
    }
  ],
  "meta": {
    "page": {
      "total_count": 100,
      "total_filtered_count": 25
    }
  }
}
```

{% /tab %}

{% /tab %}

{% tab title="403" %}
Forbidden
{% 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 %}

{% 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

##### 
                  \# Curl commandcurl -X GET "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/feature-flags" \
-H "Accept: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
                
{% /tab %}
