Update the order of existing release policies
curl --request POST \
--url https://app.launchdarkly.com/api/v2/projects/{projectKey}/release-policies/order \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--header 'LD-API-Version: <ld-api-version>' \
--data '[
"<string>"
]'import requests
url = "https://app.launchdarkly.com/api/v2/projects/{projectKey}/release-policies/order"
payload = ["<string>"]
headers = {
"LD-API-Version": "<ld-api-version>",
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'LD-API-Version': '<ld-api-version>',
Authorization: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify(['<string>'])
};
fetch('https://app.launchdarkly.com/api/v2/projects/{projectKey}/release-policies/order', 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}/release-policies/order",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.launchdarkly.com/api/v2/projects/{projectKey}/release-policies/order"
payload := strings.NewReader("[\n \"<string>\"\n]")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("LD-API-Version", "<ld-api-version>")
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.launchdarkly.com/api/v2/projects/{projectKey}/release-policies/order")
.header("LD-API-Version", "<ld-api-version>")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("[\n \"<string>\"\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.launchdarkly.com/api/v2/projects/{projectKey}/release-policies/order")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["LD-API-Version"] = '<ld-api-version>'
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "[\n \"<string>\"\n]"
response = http.request(request)
puts response.read_body[
{
"releaseMethod": "guarded-release",
"_access": {
"allowed": [
{
"reason": {
"role_name": "role_name",
"notActions": [
null,
null
],
"notResources": [
"notResources",
"notResources"
],
"effect": "allow",
"resources": [
"proj/*:env/*;qa_*:/flag/*"
],
"actions": [
"*"
]
},
"action": "action"
},
{
"reason": {
"role_name": "role_name",
"notActions": [
null,
null
],
"notResources": [
"notResources",
"notResources"
],
"effect": "allow",
"resources": [
"proj/*:env/*;qa_*:/flag/*"
],
"actions": [
"*"
]
},
"action": "action"
}
],
"denied": [
{
"reason": {
"role_name": "role_name",
"notActions": [
null,
null
],
"notResources": [
"notResources",
"notResources"
],
"effect": "allow",
"resources": [
"proj/*:env/*;qa_*:/flag/*"
],
"actions": [
"*"
]
},
"action": "action"
},
{
"reason": {
"role_name": "role_name",
"notActions": [
null,
null
],
"notResources": [
"notResources",
"notResources"
],
"effect": "allow",
"resources": [
"proj/*:env/*;qa_*:/flag/*"
],
"actions": [
"*"
]
},
"action": "action"
}
]
},
"scope": {
"environmentKeys": [
"production",
"staging"
],
"flagTagKeys": [
"frontend",
"backend"
],
"viewKeys": [
"feature-a",
"team-a"
]
},
"progressiveReleaseConfig": {
"rolloutContextKindKey": "user",
"stages": [
{
"allocation": 25000,
"durationMillis": 60000
},
{
"allocation": 25000,
"durationMillis": 60000
}
]
},
"name": "Production Release",
"rank": 1,
"_id": "550e8400-e29b-41d4-a716-446655440000",
"guardedReleaseConfig": {
"metricKeys": [
"http-errors",
"latency"
],
"rolloutContextKindKey": "user",
"metricGroupKeys": [
"frontend-metrics",
"backend-metrics"
],
"minSampleSize": 100,
"stages": [
{
"allocation": 25000,
"durationMillis": 60000
},
{
"allocation": 25000,
"durationMillis": 60000
}
],
"rollbackOnRegression": true
},
"key": "production-release"
}
]{
"code": "code",
"message": "message"
}{
"code": "code",
"message": "message"
}{
"code": "code",
"message": "message"
}{
"code": "code",
"message": "message"
}{
"code": "code",
"message": "message"
}Update the order of existing release policies
Update the order of existing release policies for the specified project.
POST
/
api
/
v2
/
projects
/
{projectKey}
/
release-policies
/
order
Update the order of existing release policies
curl --request POST \
--url https://app.launchdarkly.com/api/v2/projects/{projectKey}/release-policies/order \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--header 'LD-API-Version: <ld-api-version>' \
--data '[
"<string>"
]'import requests
url = "https://app.launchdarkly.com/api/v2/projects/{projectKey}/release-policies/order"
payload = ["<string>"]
headers = {
"LD-API-Version": "<ld-api-version>",
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'LD-API-Version': '<ld-api-version>',
Authorization: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify(['<string>'])
};
fetch('https://app.launchdarkly.com/api/v2/projects/{projectKey}/release-policies/order', 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}/release-policies/order",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.launchdarkly.com/api/v2/projects/{projectKey}/release-policies/order"
payload := strings.NewReader("[\n \"<string>\"\n]")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("LD-API-Version", "<ld-api-version>")
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.launchdarkly.com/api/v2/projects/{projectKey}/release-policies/order")
.header("LD-API-Version", "<ld-api-version>")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("[\n \"<string>\"\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.launchdarkly.com/api/v2/projects/{projectKey}/release-policies/order")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["LD-API-Version"] = '<ld-api-version>'
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "[\n \"<string>\"\n]"
response = http.request(request)
puts response.read_body[
{
"releaseMethod": "guarded-release",
"_access": {
"allowed": [
{
"reason": {
"role_name": "role_name",
"notActions": [
null,
null
],
"notResources": [
"notResources",
"notResources"
],
"effect": "allow",
"resources": [
"proj/*:env/*;qa_*:/flag/*"
],
"actions": [
"*"
]
},
"action": "action"
},
{
"reason": {
"role_name": "role_name",
"notActions": [
null,
null
],
"notResources": [
"notResources",
"notResources"
],
"effect": "allow",
"resources": [
"proj/*:env/*;qa_*:/flag/*"
],
"actions": [
"*"
]
},
"action": "action"
}
],
"denied": [
{
"reason": {
"role_name": "role_name",
"notActions": [
null,
null
],
"notResources": [
"notResources",
"notResources"
],
"effect": "allow",
"resources": [
"proj/*:env/*;qa_*:/flag/*"
],
"actions": [
"*"
]
},
"action": "action"
},
{
"reason": {
"role_name": "role_name",
"notActions": [
null,
null
],
"notResources": [
"notResources",
"notResources"
],
"effect": "allow",
"resources": [
"proj/*:env/*;qa_*:/flag/*"
],
"actions": [
"*"
]
},
"action": "action"
}
]
},
"scope": {
"environmentKeys": [
"production",
"staging"
],
"flagTagKeys": [
"frontend",
"backend"
],
"viewKeys": [
"feature-a",
"team-a"
]
},
"progressiveReleaseConfig": {
"rolloutContextKindKey": "user",
"stages": [
{
"allocation": 25000,
"durationMillis": 60000
},
{
"allocation": 25000,
"durationMillis": 60000
}
]
},
"name": "Production Release",
"rank": 1,
"_id": "550e8400-e29b-41d4-a716-446655440000",
"guardedReleaseConfig": {
"metricKeys": [
"http-errors",
"latency"
],
"rolloutContextKindKey": "user",
"metricGroupKeys": [
"frontend-metrics",
"backend-metrics"
],
"minSampleSize": 100,
"stages": [
{
"allocation": 25000,
"durationMillis": 60000
},
{
"allocation": 25000,
"durationMillis": 60000
}
],
"rollbackOnRegression": true
},
"key": "production-release"
}
]{
"code": "code",
"message": "message"
}{
"code": "code",
"message": "message"
}{
"code": "code",
"message": "message"
}{
"code": "code",
"message": "message"
}{
"code": "code",
"message": "message"
}Authorizations
Headers
Version of the endpoint.
Available options:
beta Path Parameters
The project key
Body
application/json
Array of release policy keys in the desired rank order (scoped policies only). These keys must include all of the scoped release policies for the project.
Response
Release policies updated successfully
The unique identifier of the release policy
Example:
"550e8400-e29b-41d4-a716-446655440000"
The rank/priority of the release policy
Example:
1
The release method for this policy
Available options:
guarded-release, immediate-release, progressive-release The name of the release policy
Maximum string length:
256Example:
"Production Release"
The human-readable key of the release policy
Example:
"production-release"
Show child attributes
Show child attributes
Example:
{
"allowed": [
{
"reason": {
"role_name": "role_name",
"notActions": [null, null],
"notResources": ["notResources", "notResources"],
"effect": "allow",
"resources": ["proj/*:env/*;qa_*:/flag/*"],
"actions": ["*"]
},
"action": "action"
},
{
"reason": {
"role_name": "role_name",
"notActions": [null, null],
"notResources": ["notResources", "notResources"],
"effect": "allow",
"resources": ["proj/*:env/*;qa_*:/flag/*"],
"actions": ["*"]
},
"action": "action"
}
],
"denied": [
{
"reason": {
"role_name": "role_name",
"notActions": [null, null],
"notResources": ["notResources", "notResources"],
"effect": "allow",
"resources": ["proj/*:env/*;qa_*:/flag/*"],
"actions": ["*"]
},
"action": "action"
},
{
"reason": {
"role_name": "role_name",
"notActions": [null, null],
"notResources": ["notResources", "notResources"],
"effect": "allow",
"resources": ["proj/*:env/*;qa_*:/flag/*"],
"actions": ["*"]
},
"action": "action"
}
]
}
Show child attributes
Show child attributes
Example:
{
"environmentKeys": ["production", "staging"],
"flagTagKeys": ["frontend", "backend"],
"viewKeys": ["feature-a", "team-a"]
}
Configuration for guarded releases
Show child attributes
Show child attributes
Example:
{
"metricKeys": ["http-errors", "latency"],
"rolloutContextKindKey": "user",
"metricGroupKeys": ["frontend-metrics", "backend-metrics"],
"minSampleSize": 100,
"stages": [
{
"allocation": 25000,
"durationMillis": 60000
},
{
"allocation": 25000,
"durationMillis": 60000
}
],
"rollbackOnRegression": true
}
Configuration for progressive releases
Show child attributes
Show child attributes
Example:
{
"rolloutContextKindKey": "user",
"stages": [
{
"allocation": 25000,
"durationMillis": 60000
},
{
"allocation": 25000,
"durationMillis": 60000
}
]
}