curl --request GET \
--url https://app.launchdarkly.com/api/v2/projects/{projectKey}/flags/{flagKey}/environments/{environmentKey}/releases \
--header 'Authorization: <api-key>' \
--header 'LD-API-Version: <ld-api-version>'import requests
url = "https://app.launchdarkly.com/api/v2/projects/{projectKey}/flags/{flagKey}/environments/{environmentKey}/releases"
headers = {
"LD-API-Version": "<ld-api-version>",
"Authorization": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'LD-API-Version': '<ld-api-version>', Authorization: '<api-key>'}
};
fetch('https://app.launchdarkly.com/api/v2/projects/{projectKey}/flags/{flagKey}/environments/{environmentKey}/releases', 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}/flags/{flagKey}/environments/{environmentKey}/releases",
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>",
"LD-API-Version: <ld-api-version>"
],
]);
$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}/flags/{flagKey}/environments/{environmentKey}/releases"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("LD-API-Version", "<ld-api-version>")
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}/flags/{flagKey}/environments/{environmentKey}/releases")
.header("LD-API-Version", "<ld-api-version>")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.launchdarkly.com/api/v2/projects/{projectKey}/flags/{flagKey}/environments/{environmentKey}/releases")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["LD-API-Version"] = '<ld-api-version>'
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"_links": {
"key": {
"href": "href",
"type": "type"
}
},
"totalCount": 1,
"items": [
{
"originalVariationId": "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"_links": {
"key": {
"href": "href",
"type": "type"
}
},
"kind": "progressive",
"startedAt": 7,
"originalVariationValue": "",
"cleanupBehavior": "remove_rules_and_update_default_rule",
"environmentKey": "environmentKey",
"targetVariationValue": "",
"createdAt": 4,
"projectKey": "projectKey",
"statusReason": "waiting_regression_detected",
"advancementMode": "manual",
"endedAt": 1,
"id": "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"targetVariationId": "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"metrics": [
{
"metricKey": "metricKey",
"definition": "",
"autoRollback": true,
"analysisUnit": "analysisUnit",
"metricVersionId": "046b6c7f-0b8a-43b9-b35d-6489e6daee91"
},
{
"metricKey": "metricKey",
"definition": "",
"autoRollback": true,
"analysisUnit": "analysisUnit",
"metricVersionId": "046b6c7f-0b8a-43b9-b35d-6489e6daee91"
}
],
"randomizationUnit": "randomizationUnit",
"currentPhaseIndex": 0,
"flagKey": "flagKey",
"phases": [
{
"metricStatuses": {
"key": "ok"
},
"statusReason": null,
"endedAt": 3,
"phaseIndex": 0,
"description": "description",
"currentStepIndex": 0,
"startedAt": 9,
"id": "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"ruleId": "ruleId",
"steps": [
{
"allocation": 14658,
"stepIndex": 0,
"endedAt": 2,
"startedAt": 5,
"durationMillis": 1
},
{
"allocation": 14658,
"stepIndex": 0,
"endedAt": 2,
"startedAt": 5,
"durationMillis": 1
}
],
"status": null
},
{
"metricStatuses": {
"key": "ok"
},
"statusReason": null,
"endedAt": 3,
"phaseIndex": 0,
"description": "description",
"currentStepIndex": 0,
"startedAt": 9,
"id": "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"ruleId": "ruleId",
"steps": [
{
"allocation": 14658,
"stepIndex": 0,
"endedAt": 2,
"startedAt": 5,
"durationMillis": 1
},
{
"allocation": 14658,
"stepIndex": 0,
"endedAt": 2,
"startedAt": 5,
"durationMillis": 1
}
],
"status": null
}
],
"status": "pending"
},
{
"originalVariationId": "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"_links": {
"key": {
"href": "href",
"type": "type"
}
},
"kind": "progressive",
"startedAt": 7,
"originalVariationValue": "",
"cleanupBehavior": "remove_rules_and_update_default_rule",
"environmentKey": "environmentKey",
"targetVariationValue": "",
"createdAt": 4,
"projectKey": "projectKey",
"statusReason": "waiting_regression_detected",
"advancementMode": "manual",
"endedAt": 1,
"id": "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"targetVariationId": "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"metrics": [
{
"metricKey": "metricKey",
"definition": "",
"autoRollback": true,
"analysisUnit": "analysisUnit",
"metricVersionId": "046b6c7f-0b8a-43b9-b35d-6489e6daee91"
},
{
"metricKey": "metricKey",
"definition": "",
"autoRollback": true,
"analysisUnit": "analysisUnit",
"metricVersionId": "046b6c7f-0b8a-43b9-b35d-6489e6daee91"
}
],
"randomizationUnit": "randomizationUnit",
"currentPhaseIndex": 0,
"flagKey": "flagKey",
"phases": [
{
"metricStatuses": {
"key": "ok"
},
"statusReason": null,
"endedAt": 3,
"phaseIndex": 0,
"description": "description",
"currentStepIndex": 0,
"startedAt": 9,
"id": "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"ruleId": "ruleId",
"steps": [
{
"allocation": 14658,
"stepIndex": 0,
"endedAt": 2,
"startedAt": 5,
"durationMillis": 1
},
{
"allocation": 14658,
"stepIndex": 0,
"endedAt": 2,
"startedAt": 5,
"durationMillis": 1
}
],
"status": null
},
{
"metricStatuses": {
"key": "ok"
},
"statusReason": null,
"endedAt": 3,
"phaseIndex": 0,
"description": "description",
"currentStepIndex": 0,
"startedAt": 9,
"id": "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"ruleId": "ruleId",
"steps": [
{
"allocation": 14658,
"stepIndex": 0,
"endedAt": 2,
"startedAt": 5,
"durationMillis": 1
},
{
"allocation": 14658,
"stepIndex": 0,
"endedAt": 2,
"startedAt": 5,
"durationMillis": 1
}
],
"status": null
}
],
"status": "pending"
}
]
}{
"code": "code",
"message": "message"
}{
"code": "code",
"message": "message"
}{
"code": "code",
"message": "message"
}{
"code": "code",
"message": "message"
}{
"code": "code",
"message": "message"
}{
"code": "code",
"message": "message"
}List environment releases
Returns the environment releases for the flag in the environment, newest first.
Each release includes its phases in phase-index order.
Metric definitions are not included. To get them, call
getEnvironmentRelease with expand=metrics.
Returns an empty items array when the flag has no releases in the environment,
or when no release matches the filter.
Releases that ended more than 90 days ago are not returned.
Results are paginated. By default, the first 25 releases are returned. Use
limit and offset to page through the rest, and totalCount to learn how
many releases match in total. The _links object includes first, prev,
next, and last links where they apply.
curl --request GET \
--url https://app.launchdarkly.com/api/v2/projects/{projectKey}/flags/{flagKey}/environments/{environmentKey}/releases \
--header 'Authorization: <api-key>' \
--header 'LD-API-Version: <ld-api-version>'import requests
url = "https://app.launchdarkly.com/api/v2/projects/{projectKey}/flags/{flagKey}/environments/{environmentKey}/releases"
headers = {
"LD-API-Version": "<ld-api-version>",
"Authorization": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'LD-API-Version': '<ld-api-version>', Authorization: '<api-key>'}
};
fetch('https://app.launchdarkly.com/api/v2/projects/{projectKey}/flags/{flagKey}/environments/{environmentKey}/releases', 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}/flags/{flagKey}/environments/{environmentKey}/releases",
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>",
"LD-API-Version: <ld-api-version>"
],
]);
$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}/flags/{flagKey}/environments/{environmentKey}/releases"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("LD-API-Version", "<ld-api-version>")
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}/flags/{flagKey}/environments/{environmentKey}/releases")
.header("LD-API-Version", "<ld-api-version>")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.launchdarkly.com/api/v2/projects/{projectKey}/flags/{flagKey}/environments/{environmentKey}/releases")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["LD-API-Version"] = '<ld-api-version>'
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"_links": {
"key": {
"href": "href",
"type": "type"
}
},
"totalCount": 1,
"items": [
{
"originalVariationId": "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"_links": {
"key": {
"href": "href",
"type": "type"
}
},
"kind": "progressive",
"startedAt": 7,
"originalVariationValue": "",
"cleanupBehavior": "remove_rules_and_update_default_rule",
"environmentKey": "environmentKey",
"targetVariationValue": "",
"createdAt": 4,
"projectKey": "projectKey",
"statusReason": "waiting_regression_detected",
"advancementMode": "manual",
"endedAt": 1,
"id": "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"targetVariationId": "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"metrics": [
{
"metricKey": "metricKey",
"definition": "",
"autoRollback": true,
"analysisUnit": "analysisUnit",
"metricVersionId": "046b6c7f-0b8a-43b9-b35d-6489e6daee91"
},
{
"metricKey": "metricKey",
"definition": "",
"autoRollback": true,
"analysisUnit": "analysisUnit",
"metricVersionId": "046b6c7f-0b8a-43b9-b35d-6489e6daee91"
}
],
"randomizationUnit": "randomizationUnit",
"currentPhaseIndex": 0,
"flagKey": "flagKey",
"phases": [
{
"metricStatuses": {
"key": "ok"
},
"statusReason": null,
"endedAt": 3,
"phaseIndex": 0,
"description": "description",
"currentStepIndex": 0,
"startedAt": 9,
"id": "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"ruleId": "ruleId",
"steps": [
{
"allocation": 14658,
"stepIndex": 0,
"endedAt": 2,
"startedAt": 5,
"durationMillis": 1
},
{
"allocation": 14658,
"stepIndex": 0,
"endedAt": 2,
"startedAt": 5,
"durationMillis": 1
}
],
"status": null
},
{
"metricStatuses": {
"key": "ok"
},
"statusReason": null,
"endedAt": 3,
"phaseIndex": 0,
"description": "description",
"currentStepIndex": 0,
"startedAt": 9,
"id": "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"ruleId": "ruleId",
"steps": [
{
"allocation": 14658,
"stepIndex": 0,
"endedAt": 2,
"startedAt": 5,
"durationMillis": 1
},
{
"allocation": 14658,
"stepIndex": 0,
"endedAt": 2,
"startedAt": 5,
"durationMillis": 1
}
],
"status": null
}
],
"status": "pending"
},
{
"originalVariationId": "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"_links": {
"key": {
"href": "href",
"type": "type"
}
},
"kind": "progressive",
"startedAt": 7,
"originalVariationValue": "",
"cleanupBehavior": "remove_rules_and_update_default_rule",
"environmentKey": "environmentKey",
"targetVariationValue": "",
"createdAt": 4,
"projectKey": "projectKey",
"statusReason": "waiting_regression_detected",
"advancementMode": "manual",
"endedAt": 1,
"id": "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"targetVariationId": "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"metrics": [
{
"metricKey": "metricKey",
"definition": "",
"autoRollback": true,
"analysisUnit": "analysisUnit",
"metricVersionId": "046b6c7f-0b8a-43b9-b35d-6489e6daee91"
},
{
"metricKey": "metricKey",
"definition": "",
"autoRollback": true,
"analysisUnit": "analysisUnit",
"metricVersionId": "046b6c7f-0b8a-43b9-b35d-6489e6daee91"
}
],
"randomizationUnit": "randomizationUnit",
"currentPhaseIndex": 0,
"flagKey": "flagKey",
"phases": [
{
"metricStatuses": {
"key": "ok"
},
"statusReason": null,
"endedAt": 3,
"phaseIndex": 0,
"description": "description",
"currentStepIndex": 0,
"startedAt": 9,
"id": "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"ruleId": "ruleId",
"steps": [
{
"allocation": 14658,
"stepIndex": 0,
"endedAt": 2,
"startedAt": 5,
"durationMillis": 1
},
{
"allocation": 14658,
"stepIndex": 0,
"endedAt": 2,
"startedAt": 5,
"durationMillis": 1
}
],
"status": null
},
{
"metricStatuses": {
"key": "ok"
},
"statusReason": null,
"endedAt": 3,
"phaseIndex": 0,
"description": "description",
"currentStepIndex": 0,
"startedAt": 9,
"id": "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
"ruleId": "ruleId",
"steps": [
{
"allocation": 14658,
"stepIndex": 0,
"endedAt": 2,
"startedAt": 5,
"durationMillis": 1
},
{
"allocation": 14658,
"stepIndex": 0,
"endedAt": 2,
"startedAt": 5,
"durationMillis": 1
}
],
"status": null
}
],
"status": "pending"
}
]
}{
"code": "code",
"message": "message"
}{
"code": "code",
"message": "message"
}{
"code": "code",
"message": "message"
}{
"code": "code",
"message": "message"
}{
"code": "code",
"message": "message"
}{
"code": "code",
"message": "message"
}Query Parameters
Response
Environment releases.
One page of environment releases for one flag in one environment, newest first.