Update phase status for release
curl --request PUT \
--url https://app.launchdarkly.com/api/v2/projects/{projectKey}/flags/{flagKey}/release/phases/{phaseId} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"status": "Started",
"audiences": [
{
"audienceId": "<string>",
"releaseGuardianConfiguration": {
"monitoringWindowMilliseconds": 60000,
"rolloutWeight": 50,
"rollbackOnRegression": true,
"randomizationUnit": "user"
},
"notifyMemberIds": [
"1234a56b7c89d012345e678f"
],
"notifyTeamKeys": [
"example-reviewer-team"
]
}
]
}
'import requests
url = "https://app.launchdarkly.com/api/v2/projects/{projectKey}/flags/{flagKey}/release/phases/{phaseId}"
payload = {
"status": "Started",
"audiences": [
{
"audienceId": "<string>",
"releaseGuardianConfiguration": {
"monitoringWindowMilliseconds": 60000,
"rolloutWeight": 50,
"rollbackOnRegression": True,
"randomizationUnit": "user"
},
"notifyMemberIds": ["1234a56b7c89d012345e678f"],
"notifyTeamKeys": ["example-reviewer-team"]
}
]
}
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({
status: 'Started',
audiences: [
{
audienceId: '<string>',
releaseGuardianConfiguration: {
monitoringWindowMilliseconds: 60000,
rolloutWeight: 50,
rollbackOnRegression: true,
randomizationUnit: 'user'
},
notifyMemberIds: ['1234a56b7c89d012345e678f'],
notifyTeamKeys: ['example-reviewer-team']
}
]
})
};
fetch('https://app.launchdarkly.com/api/v2/projects/{projectKey}/flags/{flagKey}/release/phases/{phaseId}', 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/phases/{phaseId}",
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([
'status' => 'Started',
'audiences' => [
[
'audienceId' => '<string>',
'releaseGuardianConfiguration' => [
'monitoringWindowMilliseconds' => 60000,
'rolloutWeight' => 50,
'rollbackOnRegression' => true,
'randomizationUnit' => 'user'
],
'notifyMemberIds' => [
'1234a56b7c89d012345e678f'
],
'notifyTeamKeys' => [
'example-reviewer-team'
]
]
]
]),
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/phases/{phaseId}"
payload := strings.NewReader("{\n \"status\": \"Started\",\n \"audiences\": [\n {\n \"audienceId\": \"<string>\",\n \"releaseGuardianConfiguration\": {\n \"monitoringWindowMilliseconds\": 60000,\n \"rolloutWeight\": 50,\n \"rollbackOnRegression\": true,\n \"randomizationUnit\": \"user\"\n },\n \"notifyMemberIds\": [\n \"1234a56b7c89d012345e678f\"\n ],\n \"notifyTeamKeys\": [\n \"example-reviewer-team\"\n ]\n }\n ]\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/phases/{phaseId}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"status\": \"Started\",\n \"audiences\": [\n {\n \"audienceId\": \"<string>\",\n \"releaseGuardianConfiguration\": {\n \"monitoringWindowMilliseconds\": 60000,\n \"rolloutWeight\": 50,\n \"rollbackOnRegression\": true,\n \"randomizationUnit\": \"user\"\n },\n \"notifyMemberIds\": [\n \"1234a56b7c89d012345e678f\"\n ],\n \"notifyTeamKeys\": [\n \"example-reviewer-team\"\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.launchdarkly.com/api/v2/projects/{projectKey}/flags/{flagKey}/release/phases/{phaseId}")
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 \"status\": \"Started\",\n \"audiences\": [\n {\n \"audienceId\": \"<string>\",\n \"releaseGuardianConfiguration\": {\n \"monitoringWindowMilliseconds\": 60000,\n \"rolloutWeight\": 50,\n \"rollbackOnRegression\": true,\n \"randomizationUnit\": \"user\"\n },\n \"notifyMemberIds\": [\n \"1234a56b7c89d012345e678f\"\n ],\n \"notifyTeamKeys\": [\n \"example-reviewer-team\"\n ]\n }\n ]\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."
}Update phase status for release
Updates the execution status of a phase of a release
PUT
/
api
/
v2
/
projects
/
{projectKey}
/
flags
/
{flagKey}
/
release
/
phases
/
{phaseId}
Update phase status for release
curl --request PUT \
--url https://app.launchdarkly.com/api/v2/projects/{projectKey}/flags/{flagKey}/release/phases/{phaseId} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"status": "Started",
"audiences": [
{
"audienceId": "<string>",
"releaseGuardianConfiguration": {
"monitoringWindowMilliseconds": 60000,
"rolloutWeight": 50,
"rollbackOnRegression": true,
"randomizationUnit": "user"
},
"notifyMemberIds": [
"1234a56b7c89d012345e678f"
],
"notifyTeamKeys": [
"example-reviewer-team"
]
}
]
}
'import requests
url = "https://app.launchdarkly.com/api/v2/projects/{projectKey}/flags/{flagKey}/release/phases/{phaseId}"
payload = {
"status": "Started",
"audiences": [
{
"audienceId": "<string>",
"releaseGuardianConfiguration": {
"monitoringWindowMilliseconds": 60000,
"rolloutWeight": 50,
"rollbackOnRegression": True,
"randomizationUnit": "user"
},
"notifyMemberIds": ["1234a56b7c89d012345e678f"],
"notifyTeamKeys": ["example-reviewer-team"]
}
]
}
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({
status: 'Started',
audiences: [
{
audienceId: '<string>',
releaseGuardianConfiguration: {
monitoringWindowMilliseconds: 60000,
rolloutWeight: 50,
rollbackOnRegression: true,
randomizationUnit: 'user'
},
notifyMemberIds: ['1234a56b7c89d012345e678f'],
notifyTeamKeys: ['example-reviewer-team']
}
]
})
};
fetch('https://app.launchdarkly.com/api/v2/projects/{projectKey}/flags/{flagKey}/release/phases/{phaseId}', 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/phases/{phaseId}",
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([
'status' => 'Started',
'audiences' => [
[
'audienceId' => '<string>',
'releaseGuardianConfiguration' => [
'monitoringWindowMilliseconds' => 60000,
'rolloutWeight' => 50,
'rollbackOnRegression' => true,
'randomizationUnit' => 'user'
],
'notifyMemberIds' => [
'1234a56b7c89d012345e678f'
],
'notifyTeamKeys' => [
'example-reviewer-team'
]
]
]
]),
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/phases/{phaseId}"
payload := strings.NewReader("{\n \"status\": \"Started\",\n \"audiences\": [\n {\n \"audienceId\": \"<string>\",\n \"releaseGuardianConfiguration\": {\n \"monitoringWindowMilliseconds\": 60000,\n \"rolloutWeight\": 50,\n \"rollbackOnRegression\": true,\n \"randomizationUnit\": \"user\"\n },\n \"notifyMemberIds\": [\n \"1234a56b7c89d012345e678f\"\n ],\n \"notifyTeamKeys\": [\n \"example-reviewer-team\"\n ]\n }\n ]\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/phases/{phaseId}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"status\": \"Started\",\n \"audiences\": [\n {\n \"audienceId\": \"<string>\",\n \"releaseGuardianConfiguration\": {\n \"monitoringWindowMilliseconds\": 60000,\n \"rolloutWeight\": 50,\n \"rollbackOnRegression\": true,\n \"randomizationUnit\": \"user\"\n },\n \"notifyMemberIds\": [\n \"1234a56b7c89d012345e678f\"\n ],\n \"notifyTeamKeys\": [\n \"example-reviewer-team\"\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.launchdarkly.com/api/v2/projects/{projectKey}/flags/{flagKey}/release/phases/{phaseId}")
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 \"status\": \"Started\",\n \"audiences\": [\n {\n \"audienceId\": \"<string>\",\n \"releaseGuardianConfiguration\": {\n \"monitoringWindowMilliseconds\": 60000,\n \"rolloutWeight\": 50,\n \"rollbackOnRegression\": true,\n \"randomizationUnit\": \"user\"\n },\n \"notifyMemberIds\": [\n \"1234a56b7c89d012345e678f\"\n ],\n \"notifyTeamKeys\": [\n \"example-reviewer-team\"\n ]\n }\n ]\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
The phase ID
Body
application/json
Response
Action succeeded
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"