Get flag status across environments
curl --request GET \
--url https://app.launchdarkly.com/api/v2/flag-status/{projectKey}/{featureFlagKey} \
--header 'Authorization: <api-key>'import requests
url = "https://app.launchdarkly.com/api/v2/flag-status/{projectKey}/{featureFlagKey}"
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-status/{projectKey}/{featureFlagKey}', 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-status/{projectKey}/{featureFlagKey}",
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-status/{projectKey}/{featureFlagKey}"
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-status/{projectKey}/{featureFlagKey}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.launchdarkly.com/api/v2/flag-status/{projectKey}/{featureFlagKey}")
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{
"environments": {
"production": {
"lastRequested": "2020-02-05T18:17:01.514Z",
"name": "inactive"
}
},
"key": "flag-key-123abc",
"_links": {
"parent": {
"href": "/api/v2/flag-status",
"type": "application/json"
},
"self": {
"href": "/api/v2/flag-status/my-project/my-flag",
"type": "application/json"
}
}
}{
"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."
}Get flag status across environments
Get the status for a particular feature flag across environments.
GET
/
api
/
v2
/
flag-status
/
{projectKey}
/
{featureFlagKey}
Get flag status across environments
curl --request GET \
--url https://app.launchdarkly.com/api/v2/flag-status/{projectKey}/{featureFlagKey} \
--header 'Authorization: <api-key>'import requests
url = "https://app.launchdarkly.com/api/v2/flag-status/{projectKey}/{featureFlagKey}"
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-status/{projectKey}/{featureFlagKey}', 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-status/{projectKey}/{featureFlagKey}",
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-status/{projectKey}/{featureFlagKey}"
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-status/{projectKey}/{featureFlagKey}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.launchdarkly.com/api/v2/flag-status/{projectKey}/{featureFlagKey}")
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{
"environments": {
"production": {
"lastRequested": "2020-02-05T18:17:01.514Z",
"name": "inactive"
}
},
"key": "flag-key-123abc",
"_links": {
"parent": {
"href": "/api/v2/flag-status",
"type": "application/json"
},
"self": {
"href": "/api/v2/flag-status/my-project/my-flag",
"type": "application/json"
}
}
}{
"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 feature flag key
Query Parameters
Optional environment filter
Response
Flag status across environments response
Flag status for environment.
Show child attributes
Show child attributes
Example:
{ "production": { "lastRequested": "2020-02-05T18:17:01.514Z", "name": "inactive" } }
feature flag key
Example:
"flag-key-123abc"
Show child attributes
Show child attributes
Example:
{ "parent": { "href": "/api/v2/flag-status", "type": "application/json" }, "self": { "href": "/api/v2/flag-status/my-project/my-flag", "type": "application/json" } }