Feature flags
List feature flag statuses
For the complete documentation index, see llms.txt. For the full documentation snapshot, see llms-full.txt.
Get a list of statuses for all feature flags. The status includes the last time the feature flag was requested, as well as a state, which is one of the following:
new: You created the flag fewer than seven days ago and it has never been requested.active: LaunchDarkly is receiving requests for this flag, but there are either multiple variations configured, or it is toggled off, or there have been changes to configuration in the past seven days.inactive: You created the feature flag more than seven days ago, and hasn’t been requested within the past seven days.launched: LaunchDarkly is receiving requests for this flag, it is toggled on, there is only one variation configured, and there have been no changes to configuration in the past seven days.
To learn more, read Flag statuses.
GET
/
api
/
v2
/
flag-statuses
/
{projectKey}
/
{environmentKey}
List feature flag statuses
curl --request GET \
--url https://app.launchdarkly.com/api/v2/flag-statuses/{projectKey}/{environmentKey} \
--header 'Authorization: <api-key>'import requests
url = "https://app.launchdarkly.com/api/v2/flag-statuses/{projectKey}/{environmentKey}"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://app.launchdarkly.com/api/v2/flag-statuses/{projectKey}/{environmentKey}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.launchdarkly.com/api/v2/flag-statuses/{projectKey}/{environmentKey}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.launchdarkly.com/api/v2/flag-statuses/{projectKey}/{environmentKey}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.launchdarkly.com/api/v2/flag-statuses/{projectKey}/{environmentKey}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.launchdarkly.com/api/v2/flag-statuses/{projectKey}/{environmentKey}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"_links": {
"self": {
"href": "/api/v2/flag-statuses/my-project/my-environment",
"type": "application/json"
}
},
"items": [
{
"name": "inactive",
"_links": {
"parent": {
"href": "/api/v2/flags/my-project/my-flag",
"type": "application/json"
},
"self": {
"href": "/api/v2/flag-statuses/my-project/my-flag",
"type": "application/json"
}
},
"lastRequested": "2020-02-05T18:17:01.514Z",
"default": "<unknown>"
}
]
}{
"code": "unauthorized",
"message": "Invalid access token"
}{
"code": "forbidden",
"message": "Forbidden. Access to the requested resource was denied."
}{
"code": "not_found",
"message": "Invalid resource identifier"
}{
"code": "rate_limited",
"message": "You've exceeded the API rate limit. Try again later."
}Authorizations
Path Parameters
The project key
The environment key
⌘I
List feature flag statuses
curl --request GET \
--url https://app.launchdarkly.com/api/v2/flag-statuses/{projectKey}/{environmentKey} \
--header 'Authorization: <api-key>'import requests
url = "https://app.launchdarkly.com/api/v2/flag-statuses/{projectKey}/{environmentKey}"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://app.launchdarkly.com/api/v2/flag-statuses/{projectKey}/{environmentKey}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.launchdarkly.com/api/v2/flag-statuses/{projectKey}/{environmentKey}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.launchdarkly.com/api/v2/flag-statuses/{projectKey}/{environmentKey}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.launchdarkly.com/api/v2/flag-statuses/{projectKey}/{environmentKey}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.launchdarkly.com/api/v2/flag-statuses/{projectKey}/{environmentKey}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"_links": {
"self": {
"href": "/api/v2/flag-statuses/my-project/my-environment",
"type": "application/json"
}
},
"items": [
{
"name": "inactive",
"_links": {
"parent": {
"href": "/api/v2/flags/my-project/my-flag",
"type": "application/json"
},
"self": {
"href": "/api/v2/flag-statuses/my-project/my-flag",
"type": "application/json"
}
},
"lastRequested": "2020-02-05T18:17:01.514Z",
"default": "<unknown>"
}
]
}{
"code": "unauthorized",
"message": "Invalid access token"
}{
"code": "forbidden",
"message": "Forbidden. Access to the requested resource was denied."
}{
"code": "not_found",
"message": "Invalid resource identifier"
}{
"code": "rate_limited",
"message": "You've exceeded the API rate limit. Try again later."
}