List scheduled changes for a segment
curl --request GET \
--url https://app.launchdarkly.com/api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/scheduled-changes \
--header 'Authorization: <api-key>'import requests
url = "https://app.launchdarkly.com/api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/scheduled-changes"
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/segments/{projectKey}/{environmentKey}/{segmentKey}/scheduled-changes', 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/segments/{projectKey}/{environmentKey}/{segmentKey}/scheduled-changes",
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/segments/{projectKey}/{environmentKey}/{segmentKey}/scheduled-changes"
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/segments/{projectKey}/{environmentKey}/{segmentKey}/scheduled-changes")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.launchdarkly.com/api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/scheduled-changes")
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{
"_links": {
"key": {
"href": "href",
"type": "type"
}
},
"items": [
{
"instructions": [
null,
null
],
"_maintainerId": "_maintainerId",
"_links": {
"key": {
"href": "href",
"type": "type"
}
},
"_maintainerServiceTokenId": "_maintainerServiceTokenId",
"executionDate": 6,
"comment": "comment",
"_id": "_id",
"_creationDate": 0,
"status": "pending"
},
{
"instructions": [
null,
null
],
"_maintainerId": "_maintainerId",
"_links": {
"key": {
"href": "href",
"type": "type"
}
},
"_maintainerServiceTokenId": "_maintainerServiceTokenId",
"executionDate": 6,
"comment": "comment",
"_id": "_id",
"_creationDate": 0,
"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 scheduled changes for a segment
Get every scheduled change for a segment that has not been applied yet, plus any that failed to apply, soonest first. Use the status of each change to tell them apart.
The caller must be allowed to view the segment’s project.
GET
/
api
/
v2
/
segments
/
{projectKey}
/
{environmentKey}
/
{segmentKey}
/
scheduled-changes
List scheduled changes for a segment
curl --request GET \
--url https://app.launchdarkly.com/api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/scheduled-changes \
--header 'Authorization: <api-key>'import requests
url = "https://app.launchdarkly.com/api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/scheduled-changes"
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/segments/{projectKey}/{environmentKey}/{segmentKey}/scheduled-changes', 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/segments/{projectKey}/{environmentKey}/{segmentKey}/scheduled-changes",
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/segments/{projectKey}/{environmentKey}/{segmentKey}/scheduled-changes"
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/segments/{projectKey}/{environmentKey}/{segmentKey}/scheduled-changes")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.launchdarkly.com/api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/scheduled-changes")
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{
"_links": {
"key": {
"href": "href",
"type": "type"
}
},
"items": [
{
"instructions": [
null,
null
],
"_maintainerId": "_maintainerId",
"_links": {
"key": {
"href": "href",
"type": "type"
}
},
"_maintainerServiceTokenId": "_maintainerServiceTokenId",
"executionDate": 6,
"comment": "comment",
"_id": "_id",
"_creationDate": 0,
"status": "pending"
},
{
"instructions": [
null,
null
],
"_maintainerId": "_maintainerId",
"_links": {
"key": {
"href": "href",
"type": "type"
}
},
"_maintainerServiceTokenId": "_maintainerServiceTokenId",
"executionDate": 6,
"comment": "comment",
"_id": "_id",
"_creationDate": 0,
"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"
}