Skip to main content

feature_flags

Creates, updates, deletes, gets or lists a feature_flags resource.

Overview

Namefeature_flags
TypeResource
Iddatadog.software_delivery.feature_flags

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstring (uuid)The unique identifier of the feature flag. (example: 550e8400-e29b-41d4-a716-446655440000)
attributesobjectAttributes of a feature flag.
typestringThe resource type. (feature-flags) (example: feature-flags)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_feature_flagselectfeature_flag_idReturns the details of a specific feature flag<br />including variants and environment status.
list_feature_flagsselectkey, is_archived, limit, offsetReturns a list of feature flags for the organization.<br />Supports filtering by key and archived status.
create_feature_flaginsertdataCreates a new feature flag with variants.
update_feature_flagreplacefeature_flag_id, dataUpdates an existing feature flag's metadata such as<br /> name and description. Does not modify targeting rules or allocations.
archive_feature_flagexecfeature_flag_idArchives a feature flag. Archived flags are<br />hidden from the main list but remain accessible and can be unarchived.
unarchive_feature_flagexecfeature_flag_idUnarchives a previously archived feature flag,<br />making it visible in the main list again.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
feature_flag_idstring (uuid)The ID of the feature flag.
sitestringThe Datadog site (region) for your organization, for example datadoghq.com, us3.datadoghq.com, us5.datadoghq.com, ap1.datadoghq.com, ap2.datadoghq.com, datadoghq.eu, ddog-gov.com. Resolved from the DD_SITE environment variable when set. Optional: defaults to datadoghq.com, or the value of the DD_SITE environment variable when set; a WHERE value overrides both.
is_archivedbooleanFilter by archived status. (example: false)
keystringFilter feature flags by key (partial matching). (example: flag-search-term)
limitinteger (int64)Maximum number of results to return. (example: 10)
offsetinteger (int64)Number of results to skip. (example: 0)

SELECT examples

Returns the details of a specific feature flag<br />including variants and environment status.

SELECT
id,
attributes,
type
FROM datadog.software_delivery.feature_flags
WHERE feature_flag_id = '{{ feature_flag_id }}' -- required
;

INSERT examples

Creates a new feature flag with variants.

INSERT INTO datadog.software_delivery.feature_flags (
data
)
SELECT
'{{ data }}' /* required */
RETURNING
data
;

REPLACE examples

Updates an existing feature flag's metadata such as<br /> name and description. Does not modify targeting rules or allocations.

REPLACE datadog.software_delivery.feature_flags
SET
data = '{{ data }}'
WHERE
feature_flag_id = '{{ feature_flag_id }}' --required
AND data = '{{ data }}' --required
RETURNING
data;

Lifecycle Methods

EXEC variables use wire (API) names.

Archives a feature flag. Archived flags are<br />hidden from the main list but remain accessible and can be unarchived.

EXEC datadog.software_delivery.feature_flags.archive_feature_flag
@feature_flag_id='{{ feature_flag_id }}' --required
;