For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Sign inTry it free
DocsGuidesSDKsIntegrationsAPI docsTutorialsFlagship blog
DocsGuidesSDKsIntegrationsAPI docsTutorialsFlagship blog
  • REST API overview
    • Access Tokens
    • Account Members
    • Account Usage Beta
    • AI Configs
    • Announcements
    • Applications Beta
    • Approvals
    • Approvals Beta
    • Audit Log
    • Code References
    • Contexts
    • Context Settings
    • Custom Roles
    • Data Export Destinations
    • Environments
    • Experiments
    • Feature Flags
      • POSTCopy feature flag
      • POSTCreate a feature flag
      • DELDelete feature flag
      • GETGet expiring context targets for feature flag
      • GETGet expiring user targets for feature flag
      • GETGet feature flag
      • GETGet feature flag status
      • GETGet flag status across environments
      • POSTGet migration safety issues
      • GETList feature flag statuses
      • GETList feature flags
      • PATCHUpdate expiring context targets on feature flag
      • PATCHUpdate expiring user targets on feature flag
      • PATCHUpdate feature flag
    • Feature Flags Beta
    • Flag Import Configurations Beta
    • Flag Links Beta
    • Flag Triggers
    • Follow Flags
    • Holdouts Beta
    • Insights Charts Beta
    • Insights Deployments Beta
    • Insights Flag Events Beta
    • Insights Pull Requests Beta
    • Insights Repositories Beta
    • Insights Scores Beta
    • Integration Audit Log Subscriptions
    • Integration Delivery Configurations Beta
    • Integrations Beta
    • Layers
    • Metrics
    • Metrics Beta
    • OAuth2 Clients
    • Persistent Store Integrations Beta
    • Projects
    • Relay Proxy Configurations
    • Release Pipelines Beta
    • Releases Beta
    • Scheduled Changes
    • Segments
    • Tags
    • Teams
    • Teams Beta
    • Users
    • Users Beta
    • User Settings
    • Views Beta
    • Webhooks
    • Workflows
    • Workflow Templates
    • Other
Sign inTry it free
LogoLogo
REST API overviewFeature Flags

List feature flags

GET
/api/v2/flags/:projectKey
GET
/api/v2/flags/:projectKey
$curl https://app.launchdarkly.com/api/v2/flags/projectKey \
> -H "Authorization: <apiKey>"
1{
2 "items": [
3 {
4 "name": "My Flag",
5 "kind": "boolean",
6 "key": "flag-key-123abc",
7 "_version": 1,
8 "creationDate": 1494437420312,
9 "variations": [
10 {
11 "value": null,
12 "_id": "e432f62b-55f6-49dd-a02f-eb24acf39d05"
13 },
14 {
15 "value": null,
16 "_id": "a00bf58d-d252-476c-b915-15a74becacb4"
17 }
18 ],
19 "temporary": true,
20 "tags": [
21 "example-tag"
22 ],
23 "_links": {
24 "parent": {
25 "href": "/api/v2/flags/my-project",
26 "type": "application/json"
27 },
28 "self": {
29 "href": "/api/v2/flags/my-project/my-flag",
30 "type": "application/json"
31 }
32 },
33 "experiments": {
34 "baselineIdx": 1,
35 "items": [
36 {
37 "metricKey": "my-metric",
38 "_metric": {
39 "_id": "5902deadbeef667524a01290",
40 "_versionId": "version-id-123abc",
41 "key": "metric-key-123abc",
42 "name": "My metric",
43 "kind": "custom",
44 "_links": {
45 "parent": {
46 "href": "/api/v2/metrics/my-project",
47 "type": "application/json"
48 },
49 "self": {
50 "href": "/api/v2/metrics/my-project/my-metric",
51 "type": "application/json"
52 }
53 },
54 "tags": [],
55 "_creationDate": 1628192791148,
56 "dataSource": {
57 "key": "string",
58 "environmentKey": "string",
59 "_name": "string",
60 "_integrationKey": "string"
61 },
62 "experimentCount": 0,
63 "metricGroupCount": 0,
64 "activeExperimentCount": 2,
65 "activeGuardedRolloutCount": 1,
66 "_version": 1,
67 "_attachedFlagCount": 0,
68 "_site": {},
69 "_access": {
70 "denied": [
71 {
72 "action": "string",
73 "reason": {
74 "effect": "allow",
75 "resources": [
76 "proj/*:env/*;qa_*:/flag/*"
77 ],
78 "notResources": [
79 "string"
80 ],
81 "actions": [
82 "*"
83 ],
84 "notActions": [
85 "string"
86 ],
87 "role_name": "string"
88 }
89 }
90 ],
91 "allowed": [
92 {
93 "action": "string",
94 "reason": {
95 "effect": "allow",
96 "resources": [
97 "proj/*:env/*;qa_*:/flag/*"
98 ],
99 "notResources": [
100 "string"
101 ],
102 "actions": [
103 "*"
104 ],
105 "notActions": [
106 "string"
107 ],
108 "role_name": "string"
109 }
110 }
111 ]
112 },
113 "lastModified": {
114 "date": "2021-08-05T19:46:31.148082Z"
115 },
116 "maintainerId": "569fdeadbeef1644facecafe",
117 "_maintainer": {
118 "_links": {
119 "self": {
120 "href": "/api/v2/members/569f183514f4432160000007",
121 "type": "application/json"
122 }
123 },
124 "_id": "569f183514f4432160000007",
125 "role": "admin",
126 "email": "ariel@acme.com"
127 },
128 "description": "string",
129 "category": "Error monitoring",
130 "isNumeric": true,
131 "successCriteria": "HigherThanBaseline",
132 "unit": "string",
133 "eventKey": "Order placed",
134 "analysisUnits": [
135 "user"
136 ],
137 "filters": {
138 "type": "contextAttribute",
139 "op": "in",
140 "values": [
141 "JP"
142 ],
143 "negate": false
144 },
145 "unitAggregationType": "average",
146 "analysisType": "mean",
147 "percentileValue": 95,
148 "eventDefault": {
149 "disabled": true,
150 "value": 0
151 },
152 "lastSeen": 1,
153 "archived": true,
154 "archivedAt": 1609459200000,
155 "selector": "string",
156 "urls": [
157 "[{\"kind\":\"exact\",\"url\":\"https://www.example.com/page1\"}]"
158 ],
159 "windowStartOffset": 1,
160 "windowEndOffset": 1,
161 "winsorLowerPercentile": 1,
162 "winsorUpperPercentile": 99.5,
163 "winsorExcludeImputed": false,
164 "traceQuery": "service.name = \"checkout\"",
165 "traceValueLocation": "duration",
166 "randomizationUnits": [
167 "user"
168 ]
169 },
170 "environments": [
171 "production",
172 "test",
173 "my-environment"
174 ],
175 "_environmentSettings": {}
176 }
177 ]
178 },
179 "customProperties": "{\"jira.issues\":{\"name\":\"Jira issues\",\"value\":[\"is-123\",\"is-456\"]}}",
180 "archived": false,
181 "description": "This flag controls the example widgets",
182 "clientSideAvailability": {},
183 "maintainerId": "569f183514f4432160000007",
184 "_maintainer": {
185 "_links": {
186 "self": {
187 "href": "/api/v2/members/569f183514f4432160000007",
188 "type": "application/json"
189 }
190 },
191 "_id": "569f183514f4432160000007",
192 "role": "admin",
193 "email": "ariel@acme.com",
194 "firstName": "Ariel",
195 "lastName": "Flores"
196 },
197 "maintainerTeamKey": "team-1",
198 "_maintainerTeam": {
199 "key": "team-key-123abc",
200 "name": "Example team",
201 "_links": {
202 "parent": {
203 "href": "/api/v2/teams",
204 "type": "application/json"
205 },
206 "roles": {
207 "href": "/api/v2/teams/example-team/roles",
208 "type": "application/json"
209 },
210 "self": {
211 "href": "/api/v2/teams/example-team",
212 "type": "application/json"
213 }
214 }
215 },
216 "archivedDate": 1494437420312,
217 "deprecated": false,
218 "deprecatedDate": 1494437420312,
219 "defaults": {
220 "onVariation": 0,
221 "offVariation": 1
222 },
223 "_purpose": "string",
224 "migrationSettings": {
225 "contextKind": "device",
226 "stageCount": 6
227 },
228 "environments": {
229 "my-environment": {
230 "on": false,
231 "archived": false,
232 "salt": "61eddeadbeef4da1facecafe3a60a397",
233 "sel": "810edeadbeef4844facecafe438f2999492",
234 "lastModified": 1627071171347,
235 "version": 1,
236 "_site": {
237 "href": "/default/my-environment/features/client-side-flag",
238 "type": "text/html"
239 },
240 "_environmentName": "My Environment",
241 "trackEvents": false,
242 "trackEventsFallthrough": false,
243 "targets": [
244 {
245 "values": [
246 "user-key-123abc"
247 ],
248 "variation": 0,
249 "contextKind": "user"
250 }
251 ],
252 "contextTargets": [
253 {
254 "values": [
255 "device-key-123abc"
256 ],
257 "variation": 0,
258 "contextKind": "device"
259 }
260 ],
261 "rules": [],
262 "fallthrough": {
263 "variation": 0
264 },
265 "offVariation": 1,
266 "prerequisites": [],
267 "_summary": {
268 "variations": {
269 "0": {
270 "rules": 0,
271 "nullRules": 0,
272 "targets": 1,
273 "contextTargets": 1,
274 "isFallthrough": true
275 },
276 "1": {
277 "rules": 0,
278 "nullRules": 0,
279 "targets": 0,
280 "isOff": true
281 }
282 },
283 "prerequisites": 0
284 }
285 }
286 },
287 "includeInSnippet": true,
288 "goalIds": []
289 }
290 ],
291 "_links": {
292 "self": {
293 "href": "/api/v2/flags/default",
294 "type": "application/json"
295 }
296 },
297 "totalCount": 1,
298 "totalCountWithDifferences": 0
299}
Get a list of all feature flags in the given project. You can include information specific to different environments by adding `env` query parameter. For example, setting `env=production` adds configuration details about your production environment to the response. You can also filter feature flags by tag with the `tag` query parameter. > #### Recommended use > > This endpoint can return a large amount of information. We recommend using some or all of these query parameters to decrease response time and overall payload size: `limit`, `env`, `query`, and `filter=creationDate`. ### Filtering flags You can filter on certain fields using the `filter` query parameter. For example, setting `filter=query:dark-mode,tags:beta+test` matches flags with the string `dark-mode` in their key or name, ignoring case, which also have the tags `beta` and `test`. The `filter` query parameter supports the following arguments: | Filter argument | Description | Example | |-----------------------|-------------|----------------------| | `applicationEvaluated` | A string. It filters the list to flags that are evaluated in the application with the given key. | `filter=applicationEvaluated:com.launchdarkly.cafe` | | `archived` | (deprecated) A boolean value. It filters the list to archived flags. | Use `filter=state:archived` instead | | `contextKindsEvaluated` | A `+`-separated list of context kind keys. It filters the list to flags which have been evaluated in the past 30 days for all of the context kinds in the list. | `filter=contextKindsEvaluated:user+application` | | `codeReferences.max` | An integer value. Use `0` to return flags that do not have code references. | `filter=codeReferences.max:0` | | `codeReferences.min` | An integer value. Use `1` to return flags that do have code references. | `filter=codeReferences.min:1` | | `creationDate` | An object with an optional `before` field whose value is Unix time in milliseconds. It filters the list to flags created before the date. | `filter=creationDate:{"before":1690527600000}` | | `evaluated` | An object that contains a key of `after` and a value in Unix time in milliseconds. It filters the list to all flags that have been evaluated since the time you specify, in the environment provided. This filter requires the `filterEnv` filter. | `filter=evaluated:{"after":1690527600000},filterEnv:production` | | `filterEnv` | A valid environment key. You must use this field for filters that are environment-specific. If there are multiple environment-specific filters, you only need to include this field once. | `filter=evaluated:{"after": 1590768455282},filterEnv:production` | | `guardedRollout` | A string, one of `any`, `monitoring`, `regressed`, `rolledBack`, `completed`, `archived`. It filters the list to flags that are part of guarded rollouts. | `filter=guardedRollout:monitoring` | | `hasExperiment` | A boolean value. It filters the list to flags that are used in an experiment. | `filter=hasExperiment:true` | | `maintainerId` | A valid member ID. It filters the list to flags that are maintained by this member. | `filter=maintainerId:12ab3c45de678910abc12345` | | `maintainerTeamKey` | A string. It filters the list to flags that are maintained by the team with this key. | `filter=maintainerTeamKey:example-team-key` | | `query` | A string. It filters the list to flags that include the specified string in their key or name. It is not case sensitive. | `filter=query:example` | | `releasePipeline` | A release pipeline key. It filters the list to flags that are either currently active in the release pipeline or have completed the release pipeline. | `filter=releasePipeline:default-release-pipeline` | | `state` | A string, either `live`, `deprecated`, or `archived`. It filters the list to flags in this state. | `filter=state:archived` | | `sdkAvailability` | A string, one of `client`, `mobile`, `anyClient`, `server`. Using `client` filters the list to flags whose client-side SDK availability is set to use the client-side ID. Using `mobile` filters to flags set to use the mobile key. Using `anyClient` filters to flags set to use either the client-side ID or the mobile key. Using `server` filters to flags set to use neither, that is, to flags only available in server-side SDKs. | `filter=sdkAvailability:client` | | `tags` | A `+`-separated list of tags. It filters the list to flags that have all of the tags in the list. | `filter=tags:beta+test` | | `type` | A string, either `temporary` or `permanent`. It filters the list to flags with the specified type. | `filter=type:permanent` | The documented values for the `filter` query are prior to URL encoding. For example, the `+` in `filter=tags:beta+test` must be encoded to `%2B`. By default, this endpoint returns all flags. You can page through the list with the `limit` parameter and by following the `first`, `prev`, `next`, and `last` links in the returned `_links` field. These links will not be present if the pages they refer to don't exist. For example, the `first` and `prev` links will be missing from the response on the first page. ### Sorting flags You can sort flags based on the following fields: - `creationDate` sorts by the creation date of the flag. - `key` sorts by the key of the flag. - `maintainerId` sorts by the flag maintainer. - `name` sorts by flag name. - `tags` sorts by tags. - `targetingModifiedDate` sorts by the date that the flag's targeting rules were last modified in a given environment. It must be used with `env` parameter and it can not be combined with any other sort. If multiple `env` values are provided, it will perform sort using the first one. For example, `sort=-targetingModifiedDate&env=production&env=staging` returns results sorted by `targetingModifiedDate` for the `production` environment. - `type` sorts by flag type All fields are sorted in ascending order by default. To sort in descending order, prefix the field with a dash ( - ). For example, `sort=-name` sorts the response by flag name in descending order. ### Expanding response LaunchDarkly supports the `expand` query param to include additional fields in the response, with the following fields: - `codeReferences` includes code references for the feature flag - `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. ### Migration flags For migration flags, the cohort information is included in the `rules` property of a flag's response, and default cohort information is included in the `fallthrough` property of a flag's response. To learn more, read [Migration Flags](https://launchdarkly.com/docs/home/flags/migration).
Was this page helpful?
Previous

Update expiring context targets on feature flag

Next
Built with

Get a list of all feature flags in the given project. You can include information specific to different environments by adding env query parameter. For example, setting env=production adds configuration details about your production environment to the response. You can also filter feature flags by tag with the tag query parameter.

Recommended use

This endpoint can return a large amount of information. We recommend using some or all of these query parameters to decrease response time and overall payload size: limit, env, query, and filter=creationDate.

Filtering flags

You can filter on certain fields using the filter query parameter. For example, setting filter=query:dark-mode,tags:beta+test matches flags with the string dark-mode in their key or name, ignoring case, which also have the tags beta and test.

The filter query parameter supports the following arguments:

Filter argumentDescriptionExample
applicationEvaluatedA string. It filters the list to flags that are evaluated in the application with the given key.filter=applicationEvaluated:com.launchdarkly.cafe
archived(deprecated) A boolean value. It filters the list to archived flags.Use filter=state:archived instead
contextKindsEvaluatedA +-separated list of context kind keys. It filters the list to flags which have been evaluated in the past 30 days for all of the context kinds in the list.filter=contextKindsEvaluated:user+application
codeReferences.maxAn integer value. Use 0 to return flags that do not have code references.filter=codeReferences.max:0
codeReferences.minAn integer value. Use 1 to return flags that do have code references.filter=codeReferences.min:1
creationDateAn object with an optional before field whose value is Unix time in milliseconds. It filters the list to flags created before the date.filter=creationDate:{"before":1690527600000}
evaluatedAn object that contains a key of after and a value in Unix time in milliseconds. It filters the list to all flags that have been evaluated since the time you specify, in the environment provided. This filter requires the filterEnv filter.filter=evaluated:{"after":1690527600000},filterEnv:production
filterEnvA valid environment key. You must use this field for filters that are environment-specific. If there are multiple environment-specific filters, you only need to include this field once.filter=evaluated:{"after": 1590768455282},filterEnv:production
guardedRolloutA string, one of any, monitoring, regressed, rolledBack, completed, archived. It filters the list to flags that are part of guarded rollouts.filter=guardedRollout:monitoring
hasExperimentA boolean value. It filters the list to flags that are used in an experiment.filter=hasExperiment:true
maintainerIdA valid member ID. It filters the list to flags that are maintained by this member.filter=maintainerId:12ab3c45de678910abc12345
maintainerTeamKeyA string. It filters the list to flags that are maintained by the team with this key.filter=maintainerTeamKey:example-team-key
queryA string. It filters the list to flags that include the specified string in their key or name. It is not case sensitive.filter=query:example
releasePipelineA release pipeline key. It filters the list to flags that are either currently active in the release pipeline or have completed the release pipeline.filter=releasePipeline:default-release-pipeline
stateA string, either live, deprecated, or archived. It filters the list to flags in this state.filter=state:archived
sdkAvailabilityA string, one of client, mobile, anyClient, server. Using client filters the list to flags whose client-side SDK availability is set to use the client-side ID. Using mobile filters to flags set to use the mobile key. Using anyClient filters to flags set to use either the client-side ID or the mobile key. Using server filters to flags set to use neither, that is, to flags only available in server-side SDKs.filter=sdkAvailability:client
tagsA +-separated list of tags. It filters the list to flags that have all of the tags in the list.filter=tags:beta+test
typeA string, either temporary or permanent. It filters the list to flags with the specified type.filter=type:permanent

The documented values for the filter query are prior to URL encoding. For example, the + in filter=tags:beta+test must be encoded to %2B.

By default, this endpoint returns all flags. You can page through the list with the limit parameter and by following the first, prev, next, and last links in the returned _links field. These links will not be present if the pages they refer to don’t exist. For example, the first and prev links will be missing from the response on the first page.

Sorting flags

You can sort flags based on the following fields:

  • creationDate sorts by the creation date of the flag.
  • key sorts by the key of the flag.
  • maintainerId sorts by the flag maintainer.
  • name sorts by flag name.
  • tags sorts by tags.
  • targetingModifiedDate sorts by the date that the flag’s targeting rules were last modified in a given environment. It must be used with env parameter and it can not be combined with any other sort. If multiple env values are provided, it will perform sort using the first one. For example, sort=-targetingModifiedDate&env=production&env=staging returns results sorted by targetingModifiedDate for the production environment.
  • type sorts by flag type

All fields are sorted in ascending order by default. To sort in descending order, prefix the field with a dash ( - ). For example, sort=-name sorts the response by flag name in descending order.

Expanding response

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

  • codeReferences includes code references for the feature flag
  • 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.

Migration flags

For migration flags, the cohort information is included in the rules property of a flag’s response, and default cohort information is included in the fallthrough property of a flag’s response. To learn more, read Migration Flags.

Authentication

Authorizationstring
API Key authentication via header

Path parameters

projectKeystringRequiredformat: "string"
The project key

Query parameters

envstringOptionalformat: "string"
Filter configurations by environment
tagstringOptionalformat: "string"
Filter feature flags by tag
limitlongOptional
The number of feature flags to return. Defaults to 20.
offsetlongOptional

Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query limit.

archivedbooleanOptionalDeprecated

Deprecated, use filter=archived:true instead. A boolean to filter the list to archived flags. When this is absent, only unarchived flags will be returned

summarybooleanOptional

By default, flags do not include their lists of prerequisites, targets, or rules for each environment. Set summary=0 and include the env query parameter to include these fields for each flag returned.

filterstringOptionalformat: "string"

A comma-separated list of filters. Each filter is of the form field:value. Read the endpoint description for a full list of available filter fields.

sortstringOptionalformat: "string"

A comma-separated list of fields to sort by. Fields prefixed by a dash ( - ) sort in descending order. Read the endpoint description for a full list of available sort fields.

comparebooleanOptionalDeprecated

Deprecated, unavailable in API version 20240415. A boolean to filter results by only flags that have differences between environments.

expandstringOptionalformat: "string"

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

Response

Global flags collection response
itemslist of objects
An array of feature flags
_linksmap from strings to objects
The location and content type of related resources
totalCountinteger
The total number of flags
totalCountWithDifferencesinteger

The number of flags that have differences between environments. Only shown when query parameter compare is true.

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
429
Too Many Requests Error