List dependent feature flags by environment
For the complete documentation index, see llms.txt. For the full documentation snapshot, see llms-full.txt.
Flag prerequisites is an Enterprise feature
Flag prerequisites is available to customers on an Enterprise plan. To learn more, read about our pricing. To upgrade your plan, contact Sales.
List dependent flags across all environments for the flag specified in the path parameters. A dependent flag is a flag that uses another flag as a prerequisite. To learn more, read Flag prerequisites.
curl --request GET \
--url https://app.launchdarkly.com/api/v2/flags/{projectKey}/{environmentKey}/{featureFlagKey}/dependent-flags \
--header 'Authorization: <api-key>'import requests
url = "https://app.launchdarkly.com/api/v2/flags/{projectKey}/{environmentKey}/{featureFlagKey}/dependent-flags"
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/flags/{projectKey}/{environmentKey}/{featureFlagKey}/dependent-flags', 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/flags/{projectKey}/{environmentKey}/{featureFlagKey}/dependent-flags",
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/flags/{projectKey}/{environmentKey}/{featureFlagKey}/dependent-flags"
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/flags/{projectKey}/{environmentKey}/{featureFlagKey}/dependent-flags")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.launchdarkly.com/api/v2/flags/{projectKey}/{environmentKey}/{featureFlagKey}/dependent-flags")
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{
"items": [
{
"key": "dependent-flag-key-123abc",
"_links": {},
"_site": "{ \"href\": \"/example-project/example-environment/features/example-dependent-flag\", \"type\": \"text/html\" }",
"name": "Example dependent flag"
}
],
"_links": {},
"_site": "{ \"href\": \"/example-project/~/features/example-prereq-flag\", \"type\": \"text/html\" }"
}{
"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
The feature flag key
Response
Dependent flags collection response
A list of dependent flags, which are flags that use the requested flag as a prerequisite
Show child attributes
Show child attributes
The location and content type of related resources
Show child attributes
Show child attributes
Details on how to access the prerequisite flag in the LaunchDarkly UI
Show child attributes
Show child attributes
"{ \"href\": \"/example-project/~/features/example-prereq-flag\", \"type\": \"text/html\" }"
curl --request GET \
--url https://app.launchdarkly.com/api/v2/flags/{projectKey}/{environmentKey}/{featureFlagKey}/dependent-flags \
--header 'Authorization: <api-key>'import requests
url = "https://app.launchdarkly.com/api/v2/flags/{projectKey}/{environmentKey}/{featureFlagKey}/dependent-flags"
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/flags/{projectKey}/{environmentKey}/{featureFlagKey}/dependent-flags', 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/flags/{projectKey}/{environmentKey}/{featureFlagKey}/dependent-flags",
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/flags/{projectKey}/{environmentKey}/{featureFlagKey}/dependent-flags"
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/flags/{projectKey}/{environmentKey}/{featureFlagKey}/dependent-flags")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.launchdarkly.com/api/v2/flags/{projectKey}/{environmentKey}/{featureFlagKey}/dependent-flags")
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{
"items": [
{
"key": "dependent-flag-key-123abc",
"_links": {},
"_site": "{ \"href\": \"/example-project/example-environment/features/example-dependent-flag\", \"type\": \"text/html\" }",
"name": "Example dependent flag"
}
],
"_links": {},
"_site": "{ \"href\": \"/example-project/~/features/example-prereq-flag\", \"type\": \"text/html\" }"
}{
"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."
}