---
title: "Get feature flag"
method: GET
path: "/api/v2/flags/{projectKey}/{featureFlagKey}"
tags: ["Feature flags"]
---

# 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.

> #### Recommended use
>
> 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

- `projectKey` string, string, required — The project key
- `featureFlagKey` string, string, required — The feature flag key

## Query parameters

- `env` string, string — Filter configurations by environment
- `expand` string, string — A comma-separated list of fields to expand in the response. Supported fields are explained above.

## Response `200`

Global flag response

- FeatureFlag
  - `name` string, required — A human-friendly name for the feature flag
  - `kind` 'boolean' | 'multivariate', required — Kind of feature flag
  - `description` string — Description of the feature flag
  - `key` string, required — A unique key used to reference the flag in your code
  - `_version` integer, required — Version of the feature flag
  - `creationDate` integer, required
  - `includeInSnippet` boolean — Deprecated, use <code>clientSideAvailability</code>. Whether this flag should be made available to the client-side JavaScript SDK
  - `clientSideAvailability` ClientSideAvailability
    - `usingMobileKey` boolean
    - `usingEnvironmentId` boolean
  - `variations` Variation[], required — An array of possible variations for the flag
    - `_id` string — The ID of the variation. Leave empty when you are creating a flag.
    - `value` unknown, required
    - `description` string — Description of the variation. Defaults to an empty string, but is omitted from the response if not set.
    - `name` string — A human-friendly name for the variation. Defaults to an empty string, but is omitted from the response if not set.
  - `temporary` boolean, required — Whether the flag is a temporary flag
  - `tags` string[], required — Tags for the feature flag
  - `_links` object, required — The location and content type of related resources
  - `maintainerId` string — Associated maintainerId for the feature flag
  - `_maintainer` MemberSummary
    - `_links` object, required — The location and content type of related resources
    - `_id` string, required — The member's ID
    - `firstName` string — The member's first name
    - `lastName` string — The member's last name
    - `role` string, required — The member's base role. If the member has no additional roles, this role will be in effect.
    - `email` string, required — The member's email address
  - `maintainerTeamKey` string — The key of the associated team that maintains this feature flag
  - `_maintainerTeam` MaintainerTeam
    - `key` string, required — The key of the maintainer team
    - `name` string, required — A human-friendly name for the maintainer team
    - `_links` object — The location and content type of related resources
  - `goalIds` string[] — Deprecated, use <code>experiments</code> instead
  - `experiments` ExperimentInfoRep, required
    - `baselineIdx` integer, required
    - `items` LegacyExperimentRep[], required
      - `metricKey` string
      - `_metric` MetricListingRep
        - `experimentCount` integer — The number of experiments using this metric
        - `metricGroupCount` integer — The number of metric groups using this metric
        - `activeExperimentCount` integer — The number of active experiments using this metric
        - `activeGuardedRolloutCount` integer — The number of active guarded rollouts using this metric
        - `_id` string, required — The ID of this metric
        - `_versionId` string, required — The version ID of the metric
        - `_version` integer — Version of the metric
        - `key` string, required — A unique key to reference the metric
        - `name` string, required — A human-friendly name for the metric
        - `kind` 'pageview' | 'click' | 'custom', required — The kind of event the metric tracks
        - `_attachedFlagCount` integer — The number of feature flags currently attached to this metric
        - `_links` object, required — The location and content type of related resources
        - `_site` Link
          - `href` string
          - `type` string
        - `_access` Access
          - `denied` AccessDenied[], required
            - `action` string, required
            - `reason` AccessDeniedReason, required
              - …
          - `allowed` AccessAllowedRep[], required
            - `action` string, required
            - `reason` AccessAllowedReason, required
              - …
        - `tags` string[], required — Tags for the metric
        - `_creationDate` integer, required
        - `lastModified` Modification
          - `date` string, date-time
        - `maintainerId` string — The ID of the member who maintains this metric
        - `_maintainer` MemberSummary
          - `_links` object, required — The location and content type of related resources
          - `_id` string, required — The member's ID
          - `firstName` string — The member's first name
          - `lastName` string — The member's last name
          - `role` string, required — The member's base role. If the member has no additional roles, this role will be in effect.
          - `email` string, required — The member's email address
        - `description` string — Description of the metric
        - `category` string — The category of the metric
        - `isNumeric` boolean — For custom metrics, whether to track numeric changes in value against a baseline (<code>true</code>) or to track a conversion when an end user takes an action (<code>false</code>).
        - `successCriteria` 'HigherThanBaseline' | 'LowerThanBaseline' — For custom metrics, the success criteria
        - `unit` string — For numeric custom metrics, the unit of measure
        - `eventKey` string — For custom metrics, the event key to use in your code
        - `randomizationUnits` string[] — An array of randomization units allowed for this metric
        - `filters` Filter
          - `type` 'group' | 'contextAttribute' | 'eventProperty', required — Filter type. One of [contextAttribute, eventProperty, group]
          - `attribute` string — If not a group node, the context attribute name or event property name to filter on
          - `op` string, required
          - `values` unknown[], required — The context attribute / event property values or group member nodes
            - unknown
          - `contextKind` string — For context attribute filters, the context kind.
          - `negate` boolean, required — If set, then take the inverse of the operator. 'in' becomes 'not in'.
        - `unitAggregationType` 'average' | 'sum' — The method by which multiple unit event values are aggregated
        - `analysisType` 'mean' | 'percentile' — The method for analyzing metric events
        - `percentileValue` integer — The percentile for the analysis method. An integer denoting the target percentile between 0 and 100. Required when <code>analysisType</code> is <code>percentile</code>.
        - `eventDefault` MetricEventDefaultRep
          - `disabled` boolean — Whether to disable defaulting missing unit events when calculating results. Defaults to false
          - `value` number — The default value applied to missing unit events. Set to 0 when <code>disabled</code> is false. No other values are currently supported.
        - `dataSource` MetricDataSourceRefRep, required
          - `key` string, required
          - `environmentKey` string
          - `_name` string
          - `_integrationKey` string
        - `lastSeen` integer
        - `archived` boolean — Whether the metric version is archived
        - `archivedAt` integer
        - `selector` string — For click metrics, the CSS selectors
        - `urls` UrlMatcher[]
      - `environments` string[]
      - `_environmentSettings` object
  - `customProperties` CustomProperties, required
  - `archived` boolean, required — Boolean indicating if the feature flag is archived
  - `archivedDate` integer
  - `deprecated` boolean — Boolean indicating if the feature flag is deprecated
  - `deprecatedDate` integer
  - `defaults` Defaults
    - `onVariation` integer, required — The index, from the array of variations for this flag, of the variation to serve by default when targeting is on.
    - `offVariation` integer, required — The index, from the array of variations for this flag, of the variation to serve by default when targeting is off.
  - `_purpose` string
  - `migrationSettings` FlagMigrationSettingsRep
    - `contextKind` string — The context kind targeted by this migration flag. Only applicable for six-stage migrations.
    - `stageCount` integer — The number of stages for this migration flag
  - `environments` object — Details on the environments for this flag. Only returned if the request is filtered by environment, using the <code>filterEnv</code> query parameter.

## Other responses

- `401` — Invalid access token
- `403` — Forbidden
- `404` — Invalid resource identifier
- `429` — Rate limited

## Changes

- **2026-02-28** `69c5c9aafe78` — 10 info
  - added the optional property `environments/additionalProperties/rules/items/disabled` to the response with the `200` status
  - added the optional property `experiments/items/items/_metric/_version` to the response with the `200` status
  - added the optional property `experiments/items/items/_metric/activeExperimentCount` to the response with the `200` status
  - added the optional property `experiments/items/items/_metric/activeGuardedRolloutCount` to the response with the `200` status
  - …6 more

[Change history](https://skmtc.dev/launchdarkly/apis/launchdarkly-rest-api/changes/api/v2/flags/:projectKey/:featureFlagKey/get.md)

---

[API](https://skmtc.dev/launchdarkly/apis/launchdarkly-rest-api.md) · [All operations](https://skmtc.dev/launchdarkly/apis/launchdarkly-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/launchdarkly/launchdarkly-rest-api/revisions/69c5c9aafe78/schema)
