Get feature flag

GET
/api/v2/flags/:projectKey/:featureFlagKey

Get a single feature flag by key. By default, this returns the configurations for all environments. You can filter environments with the env query parameter. For example, setting env=production restricts the returned configurations to just the production environment.

This endpoint can return a large amount of information. Specifying one or multiple environments with the env parameter can decrease response time and overall payload size. We recommend using this parameter to return only the environments relevant to your query.

Expanding response

LaunchDarkly supports the expand query param to include additional fields in the response, with the following fields:

  • evaluation includes evaluation information within returned environments, including which context kinds the flag has been evaluated for in the past 30 days
  • migrationSettings includes migration settings information within the flag and within returned environments. These settings are only included for migration flags, that is, where purpose is migration.

For example, expand=evaluation includes the evaluation field in the response.

Path parameters

projectKeystringRequired

The project key

featureFlagKeystringRequired

The feature flag key

Query parameters

envstringOptional

Filter configurations by environment

expandstringOptional

A comma-separated list of fields to expand in the response. Supported fields are explained above.

Response

Global flag response

namestring

A human-friendly name for the feature flag

kindenum
Allowed values: booleanmultivariate

Kind of feature flag

keystring

A unique key used to reference the flag in your code

_versioninteger

Version of the feature flag

creationDatelong

Timestamp of flag creation date

variationslist of objects

An array of possible variations for the flag

temporaryboolean

Whether the flag is a temporary flag

tagslist of strings

Tags for the feature flag

experimentsobject

Experimentation data for the feature flag

customPropertiesmap from strings to objects

Metadata attached to the feature flag, in the form of the property key associated with a name and array of values for the metadata to associate with this flag. Typically used to store data related to an integration.

archivedboolean

Boolean indicating if the feature flag is archived

descriptionstringOptional

Description of the feature flag

clientSideAvailabilityobjectOptional

Which type of client-side SDKs the feature flag is available to

maintainerIdstringOptional

Associated maintainerId for the feature flag

_maintainerobjectOptional

Associated maintainer member info for the feature flag

maintainerTeamKeystringOptional

The key of the associated team that maintains this feature flag

_maintainerTeamobjectOptional

Associated maintainer team info for the feature flag

archivedDatelongOptional

If archived is true, date of archive

deprecatedbooleanOptional

Boolean indicating if the feature flag is deprecated

deprecatedDatelongOptional

If deprecated is true, date of deprecation

defaultsobjectOptional

The indices, from the array of variations, for the variations to serve by default when targeting is on and when targeting is off. These variations will be used for this flag in new environments. If omitted, the first and last variation will be used.

_purposestringOptional
migrationSettingsobjectOptional

Migration-related settings for the flag

environmentsmap from strings to objectsOptional

Details on the environments for this flag. Only returned if the request is filtered by environment, using the filterEnv query parameter.

includeInSnippetbooleanOptionalDeprecated

Deprecated, use clientSideAvailability. Whether this flag should be made available to the client-side JavaScript SDK

goalIdslist of stringsOptionalDeprecated

Deprecated, use experiments instead

Errors

Built with