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
      • POSTCreate environment
      • DELDelete environment
      • GETGet environment
      • GETList environments
      • POSTReset environment mobile SDK key
      • POSTReset environment SDK key
      • PATCHUpdate environment
    • Experiments
    • Feature Flags
    • 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 overviewEnvironments

List environments

GET
/api/v2/projects/:projectKey/environments
GET
/api/v2/projects/:projectKey/environments
$curl https://app.launchdarkly.com/api/v2/projects/projectKey/environments \
> -H "Authorization: <apiKey>"
1{
2 "items": [
3 {
4 "_links": {
5 "self": {
6 "href": "/api/v2/projects/my-project/environments/my-environment",
7 "type": "application/json"
8 }
9 },
10 "_id": "57be1db38b75bf0772d11384",
11 "key": "environment-key-123abc",
12 "name": "My Environment",
13 "apiKey": "sdk-xxx",
14 "mobileKey": "mob-xxx",
15 "color": "F5A623",
16 "defaultTtl": 5,
17 "secureMode": true,
18 "defaultTrackEvents": false,
19 "requireComments": true,
20 "confirmChanges": true,
21 "tags": [
22 "ops"
23 ],
24 "critical": true,
25 "_access": {
26 "denied": [
27 {
28 "action": "string",
29 "reason": {
30 "effect": "allow",
31 "resources": [
32 "proj/*:env/*;qa_*:/flag/*"
33 ],
34 "notResources": [
35 "string"
36 ],
37 "actions": [
38 "*"
39 ],
40 "notActions": [
41 "string"
42 ],
43 "role_name": "string"
44 }
45 }
46 ],
47 "allowed": [
48 {
49 "action": "string",
50 "reason": {
51 "effect": "allow",
52 "resources": [
53 "proj/*:env/*;qa_*:/flag/*"
54 ],
55 "notResources": [
56 "string"
57 ],
58 "actions": [
59 "*"
60 ],
61 "notActions": [
62 "string"
63 ],
64 "role_name": "string"
65 }
66 }
67 ]
68 },
69 "approvalSettings": {
70 "required": true,
71 "bypassApprovalsForPendingChanges": false,
72 "minNumApprovals": 1,
73 "canReviewOwnRequest": false,
74 "canApplyDeclinedChanges": true,
75 "serviceKind": "launchdarkly",
76 "serviceConfig": {},
77 "requiredApprovalTags": [
78 "require-approval"
79 ],
80 "autoApplyApprovedChanges": true,
81 "serviceKindConfigurationId": "1ef45a85-218f-4428-a8b2-a97e5f56c258"
82 },
83 "resourceApprovalSettings": {}
84 }
85 ],
86 "_links": {},
87 "totalCount": 2
88}
Return a list of environments for the specified project. By default, this returns the first 20 environments. Page through this list with the `limit` parameter and by following the `first`, `prev`, `next`, and `last` links in the `_links` field that returns. If those links do not appear, 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, because there is no previous page and you cannot return to the first page when you are already on the first page. ### Filtering environments LaunchDarkly supports two fields for filters: - `query` is a string that matches against the environments' names and keys. It is not case sensitive. - `tags` is a `+`-separated list of environment tags. It filters the list of environments that have all of the tags in the list. For example, the filter `filter=query:abc,tags:tag-1+tag-2` matches environments with the string `abc` in their name or key and also are tagged with `tag-1` and `tag-2`. The filter is not case-sensitive. The documented values for `filter` query parameters are prior to URL encoding. For example, the `+` in `filter=tags:tag-1+tag-2` must be encoded to `%2B`. ### Sorting environments LaunchDarkly supports the following fields for sorting: - `createdOn` sorts by the creation date of the environment. - `critical` sorts by whether the environments are marked as critical. - `name` sorts by environment name. For example, `sort=name` sorts the response by environment name in ascending order.
Was this page helpful?
Previous

Reset environment mobile SDK key

Next
Built with

Return a list of environments for the specified project.

By default, this returns the first 20 environments. Page through this list with the limit parameter and by following the first, prev, next, and last links in the _links field that returns. If those links do not appear, 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, because there is no previous page and you cannot return to the first page when you are already on the first page.

Filtering environments

LaunchDarkly supports two fields for filters:

  • query is a string that matches against the environments’ names and keys. It is not case sensitive.
  • tags is a +-separated list of environment tags. It filters the list of environments that have all of the tags in the list.

For example, the filter filter=query:abc,tags:tag-1+tag-2 matches environments with the string abc in their name or key and also are tagged with tag-1 and tag-2. The filter is not case-sensitive.

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

Sorting environments

LaunchDarkly supports the following fields for sorting:

  • createdOn sorts by the creation date of the environment.
  • critical sorts by whether the environments are marked as critical.
  • name sorts by environment name.

For example, sort=name sorts the response by environment name in ascending order.

Authentication

Authorizationstring
API Key authentication via header

Path parameters

projectKeystringRequiredformat: "string"
The project key

Query parameters

limitlongOptional
The number of environments to return in the response. Defaults to 20.
offsetlongOptional

Where to start in the list. This is for use 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.

filterstringOptionalformat: "string"

A comma-separated list of filters. Each filter is of the form field:value.

sortstringOptionalformat: "string"

A comma-separated list of fields to sort by. Fields prefixed by a dash ( - ) sort in descending order.

Response

Environments collection response
itemslist of objects
An array of environments
_linksmap from strings to objects
The location and content type of related resources
totalCountinteger
The number of environments returned

Errors

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