Get flag defaults for project
curl --request GET \
--url https://app.launchdarkly.com/api/v2/projects/{projectKey}/flag-defaults \
--header 'Authorization: <api-key>'import requests
url = "https://app.launchdarkly.com/api/v2/projects/{projectKey}/flag-defaults"
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/projects/{projectKey}/flag-defaults', 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/projects/{projectKey}/flag-defaults",
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/projects/{projectKey}/flag-defaults"
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/projects/{projectKey}/flag-defaults")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.launchdarkly.com/api/v2/projects/{projectKey}/flag-defaults")
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": {},
"key": "<string>",
"tags": [
"tag-1",
"tag-2"
],
"temporary": true,
"defaultClientSideAvailability": "{\"usingMobileKey\": true, \"usingEnvironmentId\": false}",
"booleanDefaults": {
"trueDisplayName": "True",
"falseDisplayName": "False",
"trueDescription": "serve true",
"falseDescription": "serve false",
"onVariation": 0,
"offVariation": 1
}
}{
"code": "unauthorized",
"message": "Invalid access token"
}{
"code": "forbidden",
"message": "Forbidden. Access to the requested resource was denied."
}{
"code": "not_found",
"message": "Invalid resource identifier"
}Get flag defaults for project
Get the flag defaults for a specific project.
GET
/
api
/
v2
/
projects
/
{projectKey}
/
flag-defaults
Get flag defaults for project
curl --request GET \
--url https://app.launchdarkly.com/api/v2/projects/{projectKey}/flag-defaults \
--header 'Authorization: <api-key>'import requests
url = "https://app.launchdarkly.com/api/v2/projects/{projectKey}/flag-defaults"
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/projects/{projectKey}/flag-defaults', 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/projects/{projectKey}/flag-defaults",
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/projects/{projectKey}/flag-defaults"
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/projects/{projectKey}/flag-defaults")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.launchdarkly.com/api/v2/projects/{projectKey}/flag-defaults")
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": {},
"key": "<string>",
"tags": [
"tag-1",
"tag-2"
],
"temporary": true,
"defaultClientSideAvailability": "{\"usingMobileKey\": true, \"usingEnvironmentId\": false}",
"booleanDefaults": {
"trueDisplayName": "True",
"falseDisplayName": "False",
"trueDescription": "serve true",
"falseDescription": "serve false",
"onVariation": 0,
"offVariation": 1
}
}{
"code": "unauthorized",
"message": "Invalid access token"
}{
"code": "forbidden",
"message": "Forbidden. Access to the requested resource was denied."
}{
"code": "not_found",
"message": "Invalid resource identifier"
}Authorizations
Path Parameters
The project key
Response
Flag defaults response
The location and content type of related resources
Show child attributes
Show child attributes
A unique key for the flag default
A list of default tags for each flag
Example:
["tag-1", "tag-2"]
Whether the flag should be temporary by default
Example:
true
Which client-side SDK types can use this flag by default. Set usingMobileKey to make the flag available for mobile SDKs. Set usingEnvironmentId to make the flag available for client-side SDKs.
Show child attributes
Show child attributes
Example:
"{\"usingMobileKey\": true, \"usingEnvironmentId\": false}"
Defaults for boolean flags within this project
Show child attributes
Show child attributes