이 페이지는 아직 한국어로 제공되지 않습니다. 번역 작업 중입니다.
현재 번역 프로젝트에 대한 질문이나 피드백이 있으신 경우 언제든지 연락주시기 바랍니다.

Feature Flags

Manage feature flags and environments.

DELETE https://api.ap1.datadoghq.com/api/v2/feature-flags/environments/{environment_id}https://api.ap2.datadoghq.com/api/v2/feature-flags/environments/{environment_id}https://api.datadoghq.eu/api/v2/feature-flags/environments/{environment_id}https://api.ddog-gov.com/api/v2/feature-flags/environments/{environment_id}https://api.datadoghq.com/api/v2/feature-flags/environments/{environment_id}https://api.us3.datadoghq.com/api/v2/feature-flags/environments/{environment_id}https://api.us5.datadoghq.com/api/v2/feature-flags/environments/{environment_id}

개요

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

인수

경로 파라미터

이름

유형

설명

environment_id [required]

string

The ID of the environment.

응답

No Content

Forbidden

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

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

코드 사례

                  # Path parameters
export environment_id="550e8400-e29b-41d4-a716-446655440001"
# Curl command
curl -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}"

PUT https://api.ap1.datadoghq.com/api/v2/feature-flags/environments/{environment_id}https://api.ap2.datadoghq.com/api/v2/feature-flags/environments/{environment_id}https://api.datadoghq.eu/api/v2/feature-flags/environments/{environment_id}https://api.ddog-gov.com/api/v2/feature-flags/environments/{environment_id}https://api.datadoghq.com/api/v2/feature-flags/environments/{environment_id}https://api.us3.datadoghq.com/api/v2/feature-flags/environments/{environment_id}https://api.us5.datadoghq.com/api/v2/feature-flags/environments/{environment_id}

개요

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

인수

경로 파라미터

이름

유형

설명

environment_id [required]

string

The ID of the environment.

요청

Body Data (required)

Expand All

항목

유형

설명

data [required]

object

Data for updating an environment.

attributes [required]

object

Attributes for updating an environment.

is_production

boolean

Indicates whether this is a production environment.

name

string

The name of the environment.

queries

[string]

List of queries to define the environment scope.

require_feature_flag_approval

boolean

Indicates whether feature flag changes require approval in this environment.

type [required]

enum

The resource type. Allowed enum values: environments

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

응답

OK

Response containing an environment.

Expand All

항목

유형

설명

data [required]

object

A feature flag environment resource.

attributes [required]

object

Attributes of an environment.

created_at

date-time

The timestamp when the environment was created.

description

string

The description of the environment.

is_production

boolean

Indicates whether this is a production environment.

key

string

The unique key of the environment.

name [required]

string

The name of the environment.

queries

[string]

List of queries to define the environment scope.

require_feature_flag_approval

boolean

Indicates whether feature flag changes require approval in this environment.

updated_at

date-time

The timestamp when the environment was last updated.

id [required]

uuid

The unique identifier of the environment.

type [required]

enum

The resource type. Allowed enum values: environments

{
  "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"
  }
}

Bad Request

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

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

코드 사례

                  # Path parameters
export environment_id="550e8400-e29b-41d4-a716-446655440001"
# Curl command
curl -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

GET https://api.ap1.datadoghq.com/api/v2/feature-flags/environments/{environment_id}https://api.ap2.datadoghq.com/api/v2/feature-flags/environments/{environment_id}https://api.datadoghq.eu/api/v2/feature-flags/environments/{environment_id}https://api.ddog-gov.com/api/v2/feature-flags/environments/{environment_id}https://api.datadoghq.com/api/v2/feature-flags/environments/{environment_id}https://api.us3.datadoghq.com/api/v2/feature-flags/environments/{environment_id}https://api.us5.datadoghq.com/api/v2/feature-flags/environments/{environment_id}

개요

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

인수

경로 파라미터

이름

유형

설명

environment_id [required]

string

The ID of the environment.

응답

OK

Response containing an environment.

Expand All

항목

유형

설명

data [required]

object

A feature flag environment resource.

attributes [required]

object

Attributes of an environment.

created_at

date-time

The timestamp when the environment was created.

description

string

The description of the environment.

is_production

boolean

Indicates whether this is a production environment.

key

string

The unique key of the environment.

name [required]

string

The name of the environment.

queries

[string]

List of queries to define the environment scope.

require_feature_flag_approval

boolean

Indicates whether feature flag changes require approval in this environment.

updated_at

date-time

The timestamp when the environment was last updated.

id [required]

uuid

The unique identifier of the environment.

type [required]

enum

The resource type. Allowed enum values: environments

{
  "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"
  }
}

Forbidden

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

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

코드 사례

                  # Path parameters
export environment_id="550e8400-e29b-41d4-a716-446655440001"
# Curl command
curl -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}"

POST https://api.ap1.datadoghq.com/api/v2/feature-flags/environmentshttps://api.ap2.datadoghq.com/api/v2/feature-flags/environmentshttps://api.datadoghq.eu/api/v2/feature-flags/environmentshttps://api.ddog-gov.com/api/v2/feature-flags/environmentshttps://api.datadoghq.com/api/v2/feature-flags/environmentshttps://api.us3.datadoghq.com/api/v2/feature-flags/environmentshttps://api.us5.datadoghq.com/api/v2/feature-flags/environments

개요

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

요청

Body Data (required)

Expand All

항목

유형

설명

data [required]

object

Data for creating a new environment.

attributes [required]

object

Attributes for creating a new environment.

is_production

boolean

Indicates whether this is a production environment.

name [required]

string

The name of the environment.

queries [required]

[string]

List of queries to define the environment scope.

require_feature_flag_approval

boolean

Indicates whether feature flag changes require approval in this environment.

type [required]

enum

The resource type. Allowed enum values: environments

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

응답

Created

Response containing an environment.

Expand All

항목

유형

설명

data [required]

object

A feature flag environment resource.

attributes [required]

object

Attributes of an environment.

created_at

date-time

The timestamp when the environment was created.

description

string

The description of the environment.

is_production

boolean

Indicates whether this is a production environment.

key

string

The unique key of the environment.

name [required]

string

The name of the environment.

queries

[string]

List of queries to define the environment scope.

require_feature_flag_approval

boolean

Indicates whether feature flag changes require approval in this environment.

updated_at

date-time

The timestamp when the environment was last updated.

id [required]

uuid

The unique identifier of the environment.

type [required]

enum

The resource type. Allowed enum values: environments

{
  "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"
  }
}

Bad Request

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

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

Conflict

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

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

코드 사례

                          # Curl command
curl -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

GET https://api.ap1.datadoghq.com/api/v2/feature-flags/environmentshttps://api.ap2.datadoghq.com/api/v2/feature-flags/environmentshttps://api.datadoghq.eu/api/v2/feature-flags/environmentshttps://api.ddog-gov.com/api/v2/feature-flags/environmentshttps://api.datadoghq.com/api/v2/feature-flags/environmentshttps://api.us3.datadoghq.com/api/v2/feature-flags/environmentshttps://api.us5.datadoghq.com/api/v2/feature-flags/environments

개요

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

인수

쿼리 문자열

이름

유형

설명

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.

응답

OK

Response containing a list of environments.

Expand All

항목

유형

설명

data [required]

[object]

List of environments.

attributes [required]

object

Attributes of an environment.

created_at

date-time

The timestamp when the environment was created.

description

string

The description of the environment.

is_production

boolean

Indicates whether this is a production environment.

key

string

The unique key of the environment.

name [required]

string

The name of the environment.

queries

[string]

List of queries to define the environment scope.

require_feature_flag_approval

boolean

Indicates whether feature flag changes require approval in this environment.

updated_at

date-time

The timestamp when the environment was last updated.

id [required]

uuid

The unique identifier of the environment.

type [required]

enum

The resource type. Allowed enum values: environments

meta

object

Pagination metadata for environments.

page

object

total_count

int64

Total number of items.

total_filtered_count

int64

Total number of items matching the filter.

{
  "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
    }
  }
}

Forbidden

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

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

코드 사례

                  # Curl command
curl -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}"

POST https://api.ap1.datadoghq.com/api/v2/feature-flags/{feature_flag_id}/environments/{environment_id}/disablehttps://api.ap2.datadoghq.com/api/v2/feature-flags/{feature_flag_id}/environments/{environment_id}/disablehttps://api.datadoghq.eu/api/v2/feature-flags/{feature_flag_id}/environments/{environment_id}/disablehttps://api.ddog-gov.com/api/v2/feature-flags/{feature_flag_id}/environments/{environment_id}/disablehttps://api.datadoghq.com/api/v2/feature-flags/{feature_flag_id}/environments/{environment_id}/disablehttps://api.us3.datadoghq.com/api/v2/feature-flags/{feature_flag_id}/environments/{environment_id}/disablehttps://api.us5.datadoghq.com/api/v2/feature-flags/{feature_flag_id}/environments/{environment_id}/disable

개요

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

  • 인수

    경로 파라미터

    이름

    유형

    설명

    feature_flag_id [required]

    string

    The ID of the feature flag.

    environment_id [required]

    string

    The ID of the environment.

    응답

    OK

    Accepted - Approval required for this change

    Forbidden

    API error response.

    Expand All

    항목

    유형

    설명

    errors [required]

    [string]

    A list of errors.

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

    Not Found

    API error response.

    Expand All

    항목

    유형

    설명

    errors [required]

    [string]

    A list of errors.

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

    Too many requests

    API error response.

    Expand All

    항목

    유형

    설명

    errors [required]

    [string]

    A list of errors.

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

    코드 사례

                      # Path parameters
    export feature_flag_id="550e8400-e29b-41d4-a716-446655440000"
    export environment_id="550e8400-e29b-41d4-a716-446655440001"
    # Curl command
    curl -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}"

    POST https://api.ap1.datadoghq.com/api/v2/feature-flags/{feature_flag_id}/environments/{environment_id}/enablehttps://api.ap2.datadoghq.com/api/v2/feature-flags/{feature_flag_id}/environments/{environment_id}/enablehttps://api.datadoghq.eu/api/v2/feature-flags/{feature_flag_id}/environments/{environment_id}/enablehttps://api.ddog-gov.com/api/v2/feature-flags/{feature_flag_id}/environments/{environment_id}/enablehttps://api.datadoghq.com/api/v2/feature-flags/{feature_flag_id}/environments/{environment_id}/enablehttps://api.us3.datadoghq.com/api/v2/feature-flags/{feature_flag_id}/environments/{environment_id}/enablehttps://api.us5.datadoghq.com/api/v2/feature-flags/{feature_flag_id}/environments/{environment_id}/enable

    개요

    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

  • 인수

    경로 파라미터

    이름

    유형

    설명

    feature_flag_id [required]

    string

    The ID of the feature flag.

    environment_id [required]

    string

    The ID of the environment.

    응답

    OK

    Accepted - Approval required for this change

    Forbidden

    API error response.

    Expand All

    항목

    유형

    설명

    errors [required]

    [string]

    A list of errors.

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

    Not Found

    API error response.

    Expand All

    항목

    유형

    설명

    errors [required]

    [string]

    A list of errors.

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

    Too many requests

    API error response.

    Expand All

    항목

    유형

    설명

    errors [required]

    [string]

    A list of errors.

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

    코드 사례

                      # Path parameters
    export feature_flag_id="550e8400-e29b-41d4-a716-446655440000"
    export environment_id="550e8400-e29b-41d4-a716-446655440001"
    # Curl command
    curl -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}"

    POST https://api.ap1.datadoghq.com/api/v2/feature-flags/{feature_flag_id}/unarchivehttps://api.ap2.datadoghq.com/api/v2/feature-flags/{feature_flag_id}/unarchivehttps://api.datadoghq.eu/api/v2/feature-flags/{feature_flag_id}/unarchivehttps://api.ddog-gov.com/api/v2/feature-flags/{feature_flag_id}/unarchivehttps://api.datadoghq.com/api/v2/feature-flags/{feature_flag_id}/unarchivehttps://api.us3.datadoghq.com/api/v2/feature-flags/{feature_flag_id}/unarchivehttps://api.us5.datadoghq.com/api/v2/feature-flags/{feature_flag_id}/unarchive

    개요

    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

  • 인수

    경로 파라미터

    이름

    유형

    설명

    feature_flag_id [required]

    string

    The ID of the feature flag.

    응답

    OK

    Response containing a feature flag.

    Expand All

    항목

    유형

    설명

    data [required]

    object

    A feature flag resource.

    attributes [required]

    object

    Attributes of a feature flag.

    archived_at

    date-time

    The timestamp when the feature flag was archived.

    created_at

    date-time

    The timestamp when the feature flag was created.

    created_by

    uuid

    The ID of the user who created the feature flag.

    description [required]

    string

    The description of the feature flag.

    distribution_channel

    string

    Distribution channel for the feature flag.

    feature_flag_environments

    [object]

    Environment-specific settings for the feature flag.

    allocations

    object

    Allocation metadata for this environment.

    default_allocation_key

    string

    The allocation key used for the default variant.

    default_variant_id

    string

    The ID of the default variant for this environment.

    environment_id [required]

    uuid

    The ID of the environment.

    environment_name

    string

    The name of the environment.

    is_production

    boolean

    Indicates whether the environment is production.

    override_allocation_key

    string

    The allocation key used for the override variant.

    override_variant_id

    string

    The ID of the override variant for this environment.

    pending_suggestion_id

    string

    Pending suggestion identifier, if approval is required.

    require_feature_flag_approval

    boolean

    Indicates whether feature flag changes require approval in this environment.

    rollout_percentage

    int64

    Rollout percentage for this environment.

    rules

    [object]

    Environment targeting rules for this feature flag.

    status [required]

    enum

    The status of a feature flag in an environment. Allowed enum values: ENABLED,DISABLED

    json_schema

    string

    JSON schema for validation when value_type is JSON.

    key [required]

    string

    The unique key of the feature flag.

    last_updated_by

    uuid

    The ID of the user who last updated the feature flag.

    name [required]

    string

    The name of the feature flag.

    require_approval

    boolean

    Indicates whether this feature flag requires approval for changes.

    updated_at

    date-time

    The timestamp when the feature flag was last updated.

    value_type [required]

    enum

    The type of values for the feature flag variants. Allowed enum values: BOOLEAN,INTEGER,NUMERIC,STRING,JSON

    variants [required]

    [object]

    The variants of the feature flag.

    created_at

    date-time

    The timestamp when the variant was created.

    id [required]

    uuid

    The unique identifier of the variant.

    key [required]

    string

    The unique key of the variant.

    name [required]

    string

    The name of the variant.

    updated_at

    date-time

    The timestamp when the variant was last updated.

    value [required]

    string

    The value of the variant as a string.

    id [required]

    uuid

    The unique identifier of the feature flag.

    type [required]

    enum

    The resource type. Allowed enum values: feature-flags

    {
      "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",
              "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,
          "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"
      }
    }

    Bad Request

    API error response.

    Expand All

    항목

    유형

    설명

    errors [required]

    [string]

    A list of errors.

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

    Forbidden

    API error response.

    Expand All

    항목

    유형

    설명

    errors [required]

    [string]

    A list of errors.

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

    Not Found

    API error response.

    Expand All

    항목

    유형

    설명

    errors [required]

    [string]

    A list of errors.

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

    Too many requests

    API error response.

    Expand All

    항목

    유형

    설명

    errors [required]

    [string]

    A list of errors.

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

    코드 사례

                      # Path parameters
    export feature_flag_id="550e8400-e29b-41d4-a716-446655440000"
    # Curl command
    curl -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}"

    POST https://api.ap1.datadoghq.com/api/v2/feature-flags/{feature_flag_id}/archivehttps://api.ap2.datadoghq.com/api/v2/feature-flags/{feature_flag_id}/archivehttps://api.datadoghq.eu/api/v2/feature-flags/{feature_flag_id}/archivehttps://api.ddog-gov.com/api/v2/feature-flags/{feature_flag_id}/archivehttps://api.datadoghq.com/api/v2/feature-flags/{feature_flag_id}/archivehttps://api.us3.datadoghq.com/api/v2/feature-flags/{feature_flag_id}/archivehttps://api.us5.datadoghq.com/api/v2/feature-flags/{feature_flag_id}/archive

    개요

    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

  • 인수

    경로 파라미터

    이름

    유형

    설명

    feature_flag_id [required]

    string

    The ID of the feature flag.

    응답

    OK

    Response containing a feature flag.

    Expand All

    항목

    유형

    설명

    data [required]

    object

    A feature flag resource.

    attributes [required]

    object

    Attributes of a feature flag.

    archived_at

    date-time

    The timestamp when the feature flag was archived.

    created_at

    date-time

    The timestamp when the feature flag was created.

    created_by

    uuid

    The ID of the user who created the feature flag.

    description [required]

    string

    The description of the feature flag.

    distribution_channel

    string

    Distribution channel for the feature flag.

    feature_flag_environments

    [object]

    Environment-specific settings for the feature flag.

    allocations

    object

    Allocation metadata for this environment.

    default_allocation_key

    string

    The allocation key used for the default variant.

    default_variant_id

    string

    The ID of the default variant for this environment.

    environment_id [required]

    uuid

    The ID of the environment.

    environment_name

    string

    The name of the environment.

    is_production

    boolean

    Indicates whether the environment is production.

    override_allocation_key

    string

    The allocation key used for the override variant.

    override_variant_id

    string

    The ID of the override variant for this environment.

    pending_suggestion_id

    string

    Pending suggestion identifier, if approval is required.

    require_feature_flag_approval

    boolean

    Indicates whether feature flag changes require approval in this environment.

    rollout_percentage

    int64

    Rollout percentage for this environment.

    rules

    [object]

    Environment targeting rules for this feature flag.

    status [required]

    enum

    The status of a feature flag in an environment. Allowed enum values: ENABLED,DISABLED

    json_schema

    string

    JSON schema for validation when value_type is JSON.

    key [required]

    string

    The unique key of the feature flag.

    last_updated_by

    uuid

    The ID of the user who last updated the feature flag.

    name [required]

    string

    The name of the feature flag.

    require_approval

    boolean

    Indicates whether this feature flag requires approval for changes.

    updated_at

    date-time

    The timestamp when the feature flag was last updated.

    value_type [required]

    enum

    The type of values for the feature flag variants. Allowed enum values: BOOLEAN,INTEGER,NUMERIC,STRING,JSON

    variants [required]

    [object]

    The variants of the feature flag.

    created_at

    date-time

    The timestamp when the variant was created.

    id [required]

    uuid

    The unique identifier of the variant.

    key [required]

    string

    The unique key of the variant.

    name [required]

    string

    The name of the variant.

    updated_at

    date-time

    The timestamp when the variant was last updated.

    value [required]

    string

    The value of the variant as a string.

    id [required]

    uuid

    The unique identifier of the feature flag.

    type [required]

    enum

    The resource type. Allowed enum values: feature-flags

    {
      "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",
              "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,
          "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"
      }
    }

    Bad Request

    API error response.

    Expand All

    항목

    유형

    설명

    errors [required]

    [string]

    A list of errors.

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

    Forbidden

    API error response.

    Expand All

    항목

    유형

    설명

    errors [required]

    [string]

    A list of errors.

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

    Not Found

    API error response.

    Expand All

    항목

    유형

    설명

    errors [required]

    [string]

    A list of errors.

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

    Too many requests

    API error response.

    Expand All

    항목

    유형

    설명

    errors [required]

    [string]

    A list of errors.

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

    코드 사례

                      # Path parameters
    export feature_flag_id="550e8400-e29b-41d4-a716-446655440000"
    # Curl command
    curl -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}"

    PUT https://api.ap1.datadoghq.com/api/v2/feature-flags/{feature_flag_id}https://api.ap2.datadoghq.com/api/v2/feature-flags/{feature_flag_id}https://api.datadoghq.eu/api/v2/feature-flags/{feature_flag_id}https://api.ddog-gov.com/api/v2/feature-flags/{feature_flag_id}https://api.datadoghq.com/api/v2/feature-flags/{feature_flag_id}https://api.us3.datadoghq.com/api/v2/feature-flags/{feature_flag_id}https://api.us5.datadoghq.com/api/v2/feature-flags/{feature_flag_id}

    개요

    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

  • 인수

    경로 파라미터

    이름

    유형

    설명

    feature_flag_id [required]

    string

    The ID of the feature flag.

    요청

    Body Data (required)

    Expand All

    항목

    유형

    설명

    data [required]

    object

    Data for updating a feature flag.

    attributes [required]

    object

    Attributes for updating a feature flag.

    description

    string

    The description of the feature flag.

    json_schema

    string

    JSON schema for validation when value_type is JSON.

    name

    string

    The name of the feature flag.

    type [required]

    enum

    The resource type. Allowed enum values: feature-flags

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

    응답

    OK

    Response containing a feature flag.

    Expand All

    항목

    유형

    설명

    data [required]

    object

    A feature flag resource.

    attributes [required]

    object

    Attributes of a feature flag.

    archived_at

    date-time

    The timestamp when the feature flag was archived.

    created_at

    date-time

    The timestamp when the feature flag was created.

    created_by

    uuid

    The ID of the user who created the feature flag.

    description [required]

    string

    The description of the feature flag.

    distribution_channel

    string

    Distribution channel for the feature flag.

    feature_flag_environments

    [object]

    Environment-specific settings for the feature flag.

    allocations

    object

    Allocation metadata for this environment.

    default_allocation_key

    string

    The allocation key used for the default variant.

    default_variant_id

    string

    The ID of the default variant for this environment.

    environment_id [required]

    uuid

    The ID of the environment.

    environment_name

    string

    The name of the environment.

    is_production

    boolean

    Indicates whether the environment is production.

    override_allocation_key

    string

    The allocation key used for the override variant.

    override_variant_id

    string

    The ID of the override variant for this environment.

    pending_suggestion_id

    string

    Pending suggestion identifier, if approval is required.

    require_feature_flag_approval

    boolean

    Indicates whether feature flag changes require approval in this environment.

    rollout_percentage

    int64

    Rollout percentage for this environment.

    rules

    [object]

    Environment targeting rules for this feature flag.

    status [required]

    enum

    The status of a feature flag in an environment. Allowed enum values: ENABLED,DISABLED

    json_schema

    string

    JSON schema for validation when value_type is JSON.

    key [required]

    string

    The unique key of the feature flag.

    last_updated_by

    uuid

    The ID of the user who last updated the feature flag.

    name [required]

    string

    The name of the feature flag.

    require_approval

    boolean

    Indicates whether this feature flag requires approval for changes.

    updated_at

    date-time

    The timestamp when the feature flag was last updated.

    value_type [required]

    enum

    The type of values for the feature flag variants. Allowed enum values: BOOLEAN,INTEGER,NUMERIC,STRING,JSON

    variants [required]

    [object]

    The variants of the feature flag.

    created_at

    date-time

    The timestamp when the variant was created.

    id [required]

    uuid

    The unique identifier of the variant.

    key [required]

    string

    The unique key of the variant.

    name [required]

    string

    The name of the variant.

    updated_at

    date-time

    The timestamp when the variant was last updated.

    value [required]

    string

    The value of the variant as a string.

    id [required]

    uuid

    The unique identifier of the feature flag.

    type [required]

    enum

    The resource type. Allowed enum values: feature-flags

    {
      "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",
              "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,
          "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"
      }
    }

    Bad Request

    API error response.

    Expand All

    항목

    유형

    설명

    errors [required]

    [string]

    A list of errors.

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

    Forbidden

    API error response.

    Expand All

    항목

    유형

    설명

    errors [required]

    [string]

    A list of errors.

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

    Not Found

    API error response.

    Expand All

    항목

    유형

    설명

    errors [required]

    [string]

    A list of errors.

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

    Too many requests

    API error response.

    Expand All

    항목

    유형

    설명

    errors [required]

    [string]

    A list of errors.

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

    코드 사례

                              # Path parameters
    export feature_flag_id="550e8400-e29b-41d4-a716-446655440000"
    # Curl command
    curl -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

    GET https://api.ap1.datadoghq.com/api/v2/feature-flags/{feature_flag_id}https://api.ap2.datadoghq.com/api/v2/feature-flags/{feature_flag_id}https://api.datadoghq.eu/api/v2/feature-flags/{feature_flag_id}https://api.ddog-gov.com/api/v2/feature-flags/{feature_flag_id}https://api.datadoghq.com/api/v2/feature-flags/{feature_flag_id}https://api.us3.datadoghq.com/api/v2/feature-flags/{feature_flag_id}https://api.us5.datadoghq.com/api/v2/feature-flags/{feature_flag_id}

    개요

    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

  • 인수

    경로 파라미터

    이름

    유형

    설명

    feature_flag_id [required]

    string

    The ID of the feature flag.

    응답

    OK

    Response containing a feature flag.

    Expand All

    항목

    유형

    설명

    data [required]

    object

    A feature flag resource.

    attributes [required]

    object

    Attributes of a feature flag.

    archived_at

    date-time

    The timestamp when the feature flag was archived.

    created_at

    date-time

    The timestamp when the feature flag was created.

    created_by

    uuid

    The ID of the user who created the feature flag.

    description [required]

    string

    The description of the feature flag.

    distribution_channel

    string

    Distribution channel for the feature flag.

    feature_flag_environments

    [object]

    Environment-specific settings for the feature flag.

    allocations

    object

    Allocation metadata for this environment.

    default_allocation_key

    string

    The allocation key used for the default variant.

    default_variant_id

    string

    The ID of the default variant for this environment.

    environment_id [required]

    uuid

    The ID of the environment.

    environment_name

    string

    The name of the environment.

    is_production

    boolean

    Indicates whether the environment is production.

    override_allocation_key

    string

    The allocation key used for the override variant.

    override_variant_id

    string

    The ID of the override variant for this environment.

    pending_suggestion_id

    string

    Pending suggestion identifier, if approval is required.

    require_feature_flag_approval

    boolean

    Indicates whether feature flag changes require approval in this environment.

    rollout_percentage

    int64

    Rollout percentage for this environment.

    rules

    [object]

    Environment targeting rules for this feature flag.

    status [required]

    enum

    The status of a feature flag in an environment. Allowed enum values: ENABLED,DISABLED

    json_schema

    string

    JSON schema for validation when value_type is JSON.

    key [required]

    string

    The unique key of the feature flag.

    last_updated_by

    uuid

    The ID of the user who last updated the feature flag.

    name [required]

    string

    The name of the feature flag.

    require_approval

    boolean

    Indicates whether this feature flag requires approval for changes.

    updated_at

    date-time

    The timestamp when the feature flag was last updated.

    value_type [required]

    enum

    The type of values for the feature flag variants. Allowed enum values: BOOLEAN,INTEGER,NUMERIC,STRING,JSON

    variants [required]

    [object]

    The variants of the feature flag.

    created_at

    date-time

    The timestamp when the variant was created.

    id [required]

    uuid

    The unique identifier of the variant.

    key [required]

    string

    The unique key of the variant.

    name [required]

    string

    The name of the variant.

    updated_at

    date-time

    The timestamp when the variant was last updated.

    value [required]

    string

    The value of the variant as a string.

    id [required]

    uuid

    The unique identifier of the feature flag.

    type [required]

    enum

    The resource type. Allowed enum values: feature-flags

    {
      "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",
              "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,
          "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"
      }
    }

    Forbidden

    API error response.

    Expand All

    항목

    유형

    설명

    errors [required]

    [string]

    A list of errors.

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

    Not Found

    API error response.

    Expand All

    항목

    유형

    설명

    errors [required]

    [string]

    A list of errors.

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

    Too many requests

    API error response.

    Expand All

    항목

    유형

    설명

    errors [required]

    [string]

    A list of errors.

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

    코드 사례

                      # Path parameters
    export feature_flag_id="550e8400-e29b-41d4-a716-446655440000"
    # Curl command
    curl -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}"

    POST https://api.ap1.datadoghq.com/api/v2/feature-flagshttps://api.ap2.datadoghq.com/api/v2/feature-flagshttps://api.datadoghq.eu/api/v2/feature-flagshttps://api.ddog-gov.com/api/v2/feature-flagshttps://api.datadoghq.com/api/v2/feature-flagshttps://api.us3.datadoghq.com/api/v2/feature-flagshttps://api.us5.datadoghq.com/api/v2/feature-flags

    개요

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

  • feature_flag_config_write
  • feature_flag_environment_config_read

  • 요청

    Body Data (required)

    Expand All

    항목

    유형

    설명

    data [required]

    object

    Data for creating a new feature flag.

    attributes [required]

    object

    Attributes for creating a new feature flag.

    default_variant_key

    string

    The key of the default variant.

    description [required]

    string

    The description of the feature flag.

    json_schema

    string

    JSON schema for validation when value_type is JSON.

    key [required]

    string

    The unique key of the feature flag.

    name [required]

    string

    The name of the feature flag.

    value_type [required]

    enum

    The type of values for the feature flag variants. Allowed enum values: BOOLEAN,INTEGER,NUMERIC,STRING,JSON

    variants [required]

    [object]

    The variants of the feature flag.

    key [required]

    string

    The unique key of the variant.

    name [required]

    string

    The name of the variant.

    value [required]

    string

    The value of the variant as a string.

    type [required]

    enum

    The resource type. Allowed enum values: feature-flags

    {
      "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"
            }
          ]
        }
      }
    }

    응답

    Created

    Response containing a feature flag.

    Expand All

    항목

    유형

    설명

    data [required]

    object

    A feature flag resource.

    attributes [required]

    object

    Attributes of a feature flag.

    archived_at

    date-time

    The timestamp when the feature flag was archived.

    created_at

    date-time

    The timestamp when the feature flag was created.

    created_by

    uuid

    The ID of the user who created the feature flag.

    description [required]

    string

    The description of the feature flag.

    distribution_channel

    string

    Distribution channel for the feature flag.

    feature_flag_environments

    [object]

    Environment-specific settings for the feature flag.

    allocations

    object

    Allocation metadata for this environment.

    default_allocation_key

    string

    The allocation key used for the default variant.

    default_variant_id

    string

    The ID of the default variant for this environment.

    environment_id [required]

    uuid

    The ID of the environment.

    environment_name

    string

    The name of the environment.

    is_production

    boolean

    Indicates whether the environment is production.

    override_allocation_key

    string

    The allocation key used for the override variant.

    override_variant_id

    string

    The ID of the override variant for this environment.

    pending_suggestion_id

    string

    Pending suggestion identifier, if approval is required.

    require_feature_flag_approval

    boolean

    Indicates whether feature flag changes require approval in this environment.

    rollout_percentage

    int64

    Rollout percentage for this environment.

    rules

    [object]

    Environment targeting rules for this feature flag.

    status [required]

    enum

    The status of a feature flag in an environment. Allowed enum values: ENABLED,DISABLED

    json_schema

    string

    JSON schema for validation when value_type is JSON.

    key [required]

    string

    The unique key of the feature flag.

    last_updated_by

    uuid

    The ID of the user who last updated the feature flag.

    name [required]

    string

    The name of the feature flag.

    require_approval

    boolean

    Indicates whether this feature flag requires approval for changes.

    updated_at

    date-time

    The timestamp when the feature flag was last updated.

    value_type [required]

    enum

    The type of values for the feature flag variants. Allowed enum values: BOOLEAN,INTEGER,NUMERIC,STRING,JSON

    variants [required]

    [object]

    The variants of the feature flag.

    created_at

    date-time

    The timestamp when the variant was created.

    id [required]

    uuid

    The unique identifier of the variant.

    key [required]

    string

    The unique key of the variant.

    name [required]

    string

    The name of the variant.

    updated_at

    date-time

    The timestamp when the variant was last updated.

    value [required]

    string

    The value of the variant as a string.

    id [required]

    uuid

    The unique identifier of the feature flag.

    type [required]

    enum

    The resource type. Allowed enum values: feature-flags

    {
      "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",
              "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,
          "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"
      }
    }

    Bad Request

    API error response.

    Expand All

    항목

    유형

    설명

    errors [required]

    [string]

    A list of errors.

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

    Forbidden

    API error response.

    Expand All

    항목

    유형

    설명

    errors [required]

    [string]

    A list of errors.

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

    Conflict

    API error response.

    Expand All

    항목

    유형

    설명

    errors [required]

    [string]

    A list of errors.

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

    Too many requests

    API error response.

    Expand All

    항목

    유형

    설명

    errors [required]

    [string]

    A list of errors.

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

    코드 사례

                              # Curl command
    curl -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

    GET https://api.ap1.datadoghq.com/api/v2/feature-flagshttps://api.ap2.datadoghq.com/api/v2/feature-flagshttps://api.datadoghq.eu/api/v2/feature-flagshttps://api.ddog-gov.com/api/v2/feature-flagshttps://api.datadoghq.com/api/v2/feature-flagshttps://api.us3.datadoghq.com/api/v2/feature-flagshttps://api.us5.datadoghq.com/api/v2/feature-flags

    개요

    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

  • 인수

    쿼리 문자열

    이름

    유형

    설명

    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.

    응답

    OK

    Response containing a list of feature flags.

    Expand All

    항목

    유형

    설명

    data [required]

    [object]

    List of feature flags.

    attributes [required]

    object

    Attributes of a feature flag.

    archived_at

    date-time

    The timestamp when the feature flag was archived.

    created_at

    date-time

    The timestamp when the feature flag was created.

    created_by

    uuid

    The ID of the user who created the feature flag.

    description [required]

    string

    The description of the feature flag.

    distribution_channel

    string

    Distribution channel for the feature flag.

    feature_flag_environments

    [object]

    Environment-specific settings for the feature flag.

    allocations

    object

    Allocation metadata for this environment.

    default_allocation_key

    string

    The allocation key used for the default variant.

    default_variant_id

    string

    The ID of the default variant for this environment.

    environment_id [required]

    uuid

    The ID of the environment.

    environment_name

    string

    The name of the environment.

    is_production

    boolean

    Indicates whether the environment is production.

    override_allocation_key

    string

    The allocation key used for the override variant.

    override_variant_id

    string

    The ID of the override variant for this environment.

    pending_suggestion_id

    string

    Pending suggestion identifier, if approval is required.

    require_feature_flag_approval

    boolean

    Indicates whether feature flag changes require approval in this environment.

    rollout_percentage

    int64

    Rollout percentage for this environment.

    rules

    [object]

    Environment targeting rules for this feature flag.

    status [required]

    enum

    The status of a feature flag in an environment. Allowed enum values: ENABLED,DISABLED

    json_schema

    string

    JSON schema for validation when value_type is JSON.

    key [required]

    string

    The unique key of the feature flag.

    last_updated_by

    uuid

    The ID of the user who last updated the feature flag.

    name [required]

    string

    The name of the feature flag.

    require_approval

    boolean

    Indicates whether this feature flag requires approval for changes.

    updated_at

    date-time

    The timestamp when the feature flag was last updated.

    value_type [required]

    enum

    The type of values for the feature flag variants. Allowed enum values: BOOLEAN,INTEGER,NUMERIC,STRING,JSON

    variants [required]

    [object]

    The variants of the feature flag.

    created_at

    date-time

    The timestamp when the variant was created.

    id [required]

    uuid

    The unique identifier of the variant.

    key [required]

    string

    The unique key of the variant.

    name [required]

    string

    The name of the variant.

    updated_at

    date-time

    The timestamp when the variant was last updated.

    value [required]

    string

    The value of the variant as a string.

    id [required]

    uuid

    The unique identifier of the feature flag.

    type [required]

    enum

    The resource type. Allowed enum values: feature-flags

    meta

    object

    Pagination metadata for feature flags.

    page

    object

    total_count

    int64

    Total number of items.

    total_filtered_count

    int64

    Total number of items matching the filter.

    {
      "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",
                "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,
            "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
        }
      }
    }

    Forbidden

    API error response.

    Expand All

    항목

    유형

    설명

    errors [required]

    [string]

    A list of errors.

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

    Too many requests

    API error response.

    Expand All

    항목

    유형

    설명

    errors [required]

    [string]

    A list of errors.

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

    코드 사례

                      # Curl command
    curl -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}"