List flag settings for user
curl --request GET \
--url https://app.launchdarkly.com/api/v2/users/{projectKey}/{environmentKey}/{userKey}/flags \
--header 'Authorization: <api-key>'import requests
url = "https://app.launchdarkly.com/api/v2/users/{projectKey}/{environmentKey}/{userKey}/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/users/{projectKey}/{environmentKey}/{userKey}/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/users/{projectKey}/{environmentKey}/{userKey}/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/users/{projectKey}/{environmentKey}/{userKey}/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/users/{projectKey}/{environmentKey}/{userKey}/flags")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.launchdarkly.com/api/v2/users/{projectKey}/{environmentKey}/{userKey}/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": {
"alternate.page": {
"_links": {
"self": {
"href": "/api/v2/users/lacuna/production/Abbie_Braun/flags/alternate.page",
"type": "application/json"
}
},
"_value": false,
"setting": null
},
"sort.order": {
"_links": {
"self": {
"href": "/api/v2/users/lacuna/production/Abbie_Braun/flags/sort.order",
"type": "application/json"
}
},
"_value": true,
"setting": null
}
},
"_links": {
"self": {
"href": "/api/v2/users/lacuna/production/Abbie_Braun/flags",
"type": "application/json"
}
}
}{
"code": "invalid_request",
"message": "Invalid request body"
}{
"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."
}List flag settings for user
deprecated
Get the current flag settings for a given user.
The _value is the flag variation that the user receives. The setting indicates whether you’ve explicitly targeted a user to receive a particular variation. For example, if you have turned off a feature flag for a user, this setting will be false. The example response indicates that the user Abbie_Braun has the sort.order flag enabled and the alternate.page flag disabled, and that the user has not been explicitly targeted to receive a particular variation.
GET
/
api
/
v2
/
users
/
{projectKey}
/
{environmentKey}
/
{userKey}
/
flags
List flag settings for user
curl --request GET \
--url https://app.launchdarkly.com/api/v2/users/{projectKey}/{environmentKey}/{userKey}/flags \
--header 'Authorization: <api-key>'import requests
url = "https://app.launchdarkly.com/api/v2/users/{projectKey}/{environmentKey}/{userKey}/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/users/{projectKey}/{environmentKey}/{userKey}/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/users/{projectKey}/{environmentKey}/{userKey}/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/users/{projectKey}/{environmentKey}/{userKey}/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/users/{projectKey}/{environmentKey}/{userKey}/flags")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.launchdarkly.com/api/v2/users/{projectKey}/{environmentKey}/{userKey}/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": {
"alternate.page": {
"_links": {
"self": {
"href": "/api/v2/users/lacuna/production/Abbie_Braun/flags/alternate.page",
"type": "application/json"
}
},
"_value": false,
"setting": null
},
"sort.order": {
"_links": {
"self": {
"href": "/api/v2/users/lacuna/production/Abbie_Braun/flags/sort.order",
"type": "application/json"
}
},
"_value": true,
"setting": null
}
},
"_links": {
"self": {
"href": "/api/v2/users/lacuna/production/Abbie_Braun/flags",
"type": "application/json"
}
}
}{
"code": "invalid_request",
"message": "Invalid request body"
}{
"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."
}Path Parameters
Response
User flag settings collection response
An array of flag settings for the user
Show child attributes
Show child attributes
Example:
{
"alternate.page": {
"_links": {
"self": {
"href": "/api/v2/users/lacuna/production/Abbie_Braun/flags/alternate.page",
"type": "application/json"
}
},
"_value": false,
"setting": null
},
"sort.order": {
"_links": {
"self": {
"href": "/api/v2/users/lacuna/production/Abbie_Braun/flags/sort.order",
"type": "application/json"
}
},
"_value": true,
"setting": null
}
}