Create a new release for flag
curl --request PUT \
--url https://app.launchdarkly.com/api/v2/projects/{projectKey}/flags/{flagKey}/release \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"releasePipelineKey": "<string>",
"releaseVariationId": "<string>"
}
'import requests
url = "https://app.launchdarkly.com/api/v2/projects/{projectKey}/flags/{flagKey}/release"
payload = {
"releasePipelineKey": "<string>",
"releaseVariationId": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({releasePipelineKey: '<string>', releaseVariationId: '<string>'})
};
fetch('https://app.launchdarkly.com/api/v2/projects/{projectKey}/flags/{flagKey}/release', 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}/release",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'releasePipelineKey' => '<string>',
'releaseVariationId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$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}/flags/{flagKey}/release"
payload := strings.NewReader("{\n \"releasePipelineKey\": \"<string>\",\n \"releaseVariationId\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
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.put("https://app.launchdarkly.com/api/v2/projects/{projectKey}/flags/{flagKey}/release")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"releasePipelineKey\": \"<string>\",\n \"releaseVariationId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.launchdarkly.com/api/v2/projects/{projectKey}/flags/{flagKey}/release")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"releasePipelineKey\": \"<string>\",\n \"releaseVariationId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"name": "Example release pipeline",
"releasePipelineKey": "example-release-pipeline",
"releasePipelineDescription": "Our release pipeline for typical testing and deployment",
"phases": [
{
"_id": "1234a56b7c89d012345e678f",
"_name": "Phase 1 - Testing",
"complete": true,
"_creationDate": "1684262711507",
"_audiences": [
{
"_id": "1234a56b7c89d012345e678g",
"name": "Phase 1 - Testing",
"_links": {},
"environment": {
"_links": {
"self": {
"href": "/api/v2/projects/my-project/environments/my-environment",
"type": "application/json"
}
},
"key": "environment-key-123abc",
"name": "My Environment",
"color": "F5A623"
},
"configuration": {
"releaseStrategy": "monitoredRelease",
"requireApproval": true,
"notifyMemberIds": [
"1234a56b7c89d012345e678f"
],
"notifyTeamKeys": [
"example-reviewer-team"
],
"releaseGuardianConfiguration": {
"monitoringWindowMilliseconds": 60000,
"rolloutWeight": 50,
"rollbackOnRegression": true,
"randomizationUnit": "user"
}
},
"segmentKeys": [
"segment-key-123abc"
],
"status": "active",
"_ruleIds": [
"<string>"
]
}
],
"_completionDate": "1684262711509",
"_completedBy": {
"member": {
"_links": {
"self": {
"href": "/api/v2/members/569f183514f4432160000007",
"type": "application/json"
}
},
"_id": "569f183514f4432160000007",
"role": "admin",
"email": "ariel@acme.com",
"firstName": "Ariel",
"lastName": "Flores"
},
"token": {
"_links": {},
"_id": "<string>",
"name": "DevOps token",
"ending": "2345",
"serviceToken": false
}
},
"status": "Started",
"started": true,
"_startedDate": 123,
"configuration": {}
}
],
"_version": 1,
"_links": {},
"_releaseVariationId": "<string>",
"_canceledAt": "1684262711507"
}{
"code": "invalid_request",
"message": "Invalid request body"
}{
"code": "unauthorized",
"message": "Invalid access token"
}{
"code": "not_found",
"message": "Invalid resource identifier"
}{
"code": "rate_limited",
"message": "You've exceeded the API rate limit. Try again later."
}Create a new release for flag
Creates a release by adding a flag to a release pipeline
PUT
/
api
/
v2
/
projects
/
{projectKey}
/
flags
/
{flagKey}
/
release
Create a new release for flag
curl --request PUT \
--url https://app.launchdarkly.com/api/v2/projects/{projectKey}/flags/{flagKey}/release \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"releasePipelineKey": "<string>",
"releaseVariationId": "<string>"
}
'import requests
url = "https://app.launchdarkly.com/api/v2/projects/{projectKey}/flags/{flagKey}/release"
payload = {
"releasePipelineKey": "<string>",
"releaseVariationId": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({releasePipelineKey: '<string>', releaseVariationId: '<string>'})
};
fetch('https://app.launchdarkly.com/api/v2/projects/{projectKey}/flags/{flagKey}/release', 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}/release",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'releasePipelineKey' => '<string>',
'releaseVariationId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$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}/flags/{flagKey}/release"
payload := strings.NewReader("{\n \"releasePipelineKey\": \"<string>\",\n \"releaseVariationId\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
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.put("https://app.launchdarkly.com/api/v2/projects/{projectKey}/flags/{flagKey}/release")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"releasePipelineKey\": \"<string>\",\n \"releaseVariationId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.launchdarkly.com/api/v2/projects/{projectKey}/flags/{flagKey}/release")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"releasePipelineKey\": \"<string>\",\n \"releaseVariationId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"name": "Example release pipeline",
"releasePipelineKey": "example-release-pipeline",
"releasePipelineDescription": "Our release pipeline for typical testing and deployment",
"phases": [
{
"_id": "1234a56b7c89d012345e678f",
"_name": "Phase 1 - Testing",
"complete": true,
"_creationDate": "1684262711507",
"_audiences": [
{
"_id": "1234a56b7c89d012345e678g",
"name": "Phase 1 - Testing",
"_links": {},
"environment": {
"_links": {
"self": {
"href": "/api/v2/projects/my-project/environments/my-environment",
"type": "application/json"
}
},
"key": "environment-key-123abc",
"name": "My Environment",
"color": "F5A623"
},
"configuration": {
"releaseStrategy": "monitoredRelease",
"requireApproval": true,
"notifyMemberIds": [
"1234a56b7c89d012345e678f"
],
"notifyTeamKeys": [
"example-reviewer-team"
],
"releaseGuardianConfiguration": {
"monitoringWindowMilliseconds": 60000,
"rolloutWeight": 50,
"rollbackOnRegression": true,
"randomizationUnit": "user"
}
},
"segmentKeys": [
"segment-key-123abc"
],
"status": "active",
"_ruleIds": [
"<string>"
]
}
],
"_completionDate": "1684262711509",
"_completedBy": {
"member": {
"_links": {
"self": {
"href": "/api/v2/members/569f183514f4432160000007",
"type": "application/json"
}
},
"_id": "569f183514f4432160000007",
"role": "admin",
"email": "ariel@acme.com",
"firstName": "Ariel",
"lastName": "Flores"
},
"token": {
"_links": {},
"_id": "<string>",
"name": "DevOps token",
"ending": "2345",
"serviceToken": false
}
},
"status": "Started",
"started": true,
"_startedDate": 123,
"configuration": {}
}
],
"_version": 1,
"_links": {},
"_releaseVariationId": "<string>",
"_canceledAt": "1684262711507"
}{
"code": "invalid_request",
"message": "Invalid request body"
}{
"code": "unauthorized",
"message": "Invalid access token"
}{
"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 flag key
Body
application/json
Response
Release response
The release pipeline name
Example:
"Example release pipeline"
The release pipeline key
Example:
"example-release-pipeline"
The release pipeline description
Example:
"Our release pipeline for typical testing and deployment"
An ordered list of the release pipeline phases
Show child attributes
Show child attributes
The release version
Example:
1
The location and content type of related resources
Show child attributes
Show child attributes
The chosen release variation ID to use across all phases of a release
Timestamp of when the release was canceled
Example:
"1684262711507"