curl --request POST \
--url https://app.launchdarkly.com/api/v2/announcements \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"severity": "warning",
"startTime": 1731439812,
"isDismissible": true,
"endTime": 1731439880,
"title": "System Maintenance Notice",
"message": "**Important Update:**\n\nPlease be aware of the upcoming maintenance scheduled for *October 31st, 2024*. The system will be unavailable from **12:00 AM** to **4:00 AM**."
}
'import requests
url = "https://app.launchdarkly.com/api/v2/announcements"
payload = {
"severity": "warning",
"startTime": 1731439812,
"isDismissible": True,
"endTime": 1731439880,
"title": "System Maintenance Notice",
"message": "**Important Update:**
Please be aware of the upcoming maintenance scheduled for *October 31st, 2024*. The system will be unavailable from **12:00 AM** to **4:00 AM**."
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
severity: 'warning',
startTime: 1731439812,
isDismissible: true,
endTime: 1731439880,
title: 'System Maintenance Notice',
message: '**Important Update:**\n\nPlease be aware of the upcoming maintenance scheduled for *October 31st, 2024*. The system will be unavailable from **12:00 AM** to **4:00 AM**.'
})
};
fetch('https://app.launchdarkly.com/api/v2/announcements', 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/announcements",
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([
'severity' => 'warning',
'startTime' => 1731439812,
'isDismissible' => true,
'endTime' => 1731439880,
'title' => 'System Maintenance Notice',
'message' => '**Important Update:**
Please be aware of the upcoming maintenance scheduled for *October 31st, 2024*. The system will be unavailable from **12:00 AM** to **4:00 AM**.'
]),
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/announcements"
payload := strings.NewReader("{\n \"severity\": \"warning\",\n \"startTime\": 1731439812,\n \"isDismissible\": true,\n \"endTime\": 1731439880,\n \"title\": \"System Maintenance Notice\",\n \"message\": \"**Important Update:**\\n\\nPlease be aware of the upcoming maintenance scheduled for *October 31st, 2024*. The system will be unavailable from **12:00 AM** to **4:00 AM**.\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://app.launchdarkly.com/api/v2/announcements")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"severity\": \"warning\",\n \"startTime\": 1731439812,\n \"isDismissible\": true,\n \"endTime\": 1731439880,\n \"title\": \"System Maintenance Notice\",\n \"message\": \"**Important Update:**\\n\\nPlease be aware of the upcoming maintenance scheduled for *October 31st, 2024*. The system will be unavailable from **12:00 AM** to **4:00 AM**.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.launchdarkly.com/api/v2/announcements")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"severity\": \"warning\",\n \"startTime\": 1731439812,\n \"isDismissible\": true,\n \"endTime\": 1731439880,\n \"title\": \"System Maintenance Notice\",\n \"message\": \"**Important Update:**\\n\\nPlease be aware of the upcoming maintenance scheduled for *October 31st, 2024*. The system will be unavailable from **12:00 AM** to **4:00 AM**.\"\n}"
response = http.request(request)
puts response.read_body{
"severity": "info",
"_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"
}
]
},
"_links": {
"parent": {
"href": "href",
"type": "type"
}
},
"startTime": 1731439812,
"_id": "1234567890",
"isDismissible": true,
"endTime": 1731439880,
"title": "System Maintenance Notice",
"message": "**Important Update:**\n\nPlease be aware of the upcoming maintenance scheduled for *October 31st, 2024*. The system will be unavailable from **12:00 AM** to **4:00 AM**.",
"_status": "active"
}{
"code": "code",
"message": "message"
}{
"code": "code",
"message": "message"
}{
"code": "code",
"message": "message"
}{
"code": "code",
"message": "message"
}{
"code": "code",
"message": "message"
}Create an announcement
Create an announcement
curl --request POST \
--url https://app.launchdarkly.com/api/v2/announcements \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"severity": "warning",
"startTime": 1731439812,
"isDismissible": true,
"endTime": 1731439880,
"title": "System Maintenance Notice",
"message": "**Important Update:**\n\nPlease be aware of the upcoming maintenance scheduled for *October 31st, 2024*. The system will be unavailable from **12:00 AM** to **4:00 AM**."
}
'import requests
url = "https://app.launchdarkly.com/api/v2/announcements"
payload = {
"severity": "warning",
"startTime": 1731439812,
"isDismissible": True,
"endTime": 1731439880,
"title": "System Maintenance Notice",
"message": "**Important Update:**
Please be aware of the upcoming maintenance scheduled for *October 31st, 2024*. The system will be unavailable from **12:00 AM** to **4:00 AM**."
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
severity: 'warning',
startTime: 1731439812,
isDismissible: true,
endTime: 1731439880,
title: 'System Maintenance Notice',
message: '**Important Update:**\n\nPlease be aware of the upcoming maintenance scheduled for *October 31st, 2024*. The system will be unavailable from **12:00 AM** to **4:00 AM**.'
})
};
fetch('https://app.launchdarkly.com/api/v2/announcements', 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/announcements",
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([
'severity' => 'warning',
'startTime' => 1731439812,
'isDismissible' => true,
'endTime' => 1731439880,
'title' => 'System Maintenance Notice',
'message' => '**Important Update:**
Please be aware of the upcoming maintenance scheduled for *October 31st, 2024*. The system will be unavailable from **12:00 AM** to **4:00 AM**.'
]),
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/announcements"
payload := strings.NewReader("{\n \"severity\": \"warning\",\n \"startTime\": 1731439812,\n \"isDismissible\": true,\n \"endTime\": 1731439880,\n \"title\": \"System Maintenance Notice\",\n \"message\": \"**Important Update:**\\n\\nPlease be aware of the upcoming maintenance scheduled for *October 31st, 2024*. The system will be unavailable from **12:00 AM** to **4:00 AM**.\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://app.launchdarkly.com/api/v2/announcements")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"severity\": \"warning\",\n \"startTime\": 1731439812,\n \"isDismissible\": true,\n \"endTime\": 1731439880,\n \"title\": \"System Maintenance Notice\",\n \"message\": \"**Important Update:**\\n\\nPlease be aware of the upcoming maintenance scheduled for *October 31st, 2024*. The system will be unavailable from **12:00 AM** to **4:00 AM**.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.launchdarkly.com/api/v2/announcements")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"severity\": \"warning\",\n \"startTime\": 1731439812,\n \"isDismissible\": true,\n \"endTime\": 1731439880,\n \"title\": \"System Maintenance Notice\",\n \"message\": \"**Important Update:**\\n\\nPlease be aware of the upcoming maintenance scheduled for *October 31st, 2024*. The system will be unavailable from **12:00 AM** to **4:00 AM**.\"\n}"
response = http.request(request)
puts response.read_body{
"severity": "info",
"_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"
}
]
},
"_links": {
"parent": {
"href": "href",
"type": "type"
}
},
"startTime": 1731439812,
"_id": "1234567890",
"isDismissible": true,
"endTime": 1731439880,
"title": "System Maintenance Notice",
"message": "**Important Update:**\n\nPlease be aware of the upcoming maintenance scheduled for *October 31st, 2024*. The system will be unavailable from **12:00 AM** to **4:00 AM**.",
"_status": "active"
}{
"code": "code",
"message": "message"
}{
"code": "code",
"message": "message"
}{
"code": "code",
"message": "message"
}{
"code": "code",
"message": "message"
}{
"code": "code",
"message": "message"
}Authorizations
Body
Announcement request body
Create announcement request body
true if the announcement is dismissible
true
The title of the announcement
"System Maintenance Notice"
The message of the announcement
"**Important Update:**\n\nPlease be aware of the upcoming maintenance scheduled for *October 31st, 2024*. The system will be unavailable from **12:00 AM** to **4:00 AM**."
The start time of the announcement. This is a Unix timestamp in milliseconds.
1731439812
The severity of the announcement
info, warning, critical "warning"
The end time of the announcement. This is a Unix timestamp in milliseconds.
1731439880
Response
Created announcement
Announcement response
The ID of the announcement
"1234567890"
true if the announcement is dismissible
true
The title of the announcement
"System Maintenance Notice"
The message of the announcement
"**Important Update:**\n\nPlease be aware of the upcoming maintenance scheduled for *October 31st, 2024*. The system will be unavailable from **12:00 AM** to **4:00 AM**."
The start time of the announcement. This is a Unix timestamp in milliseconds.
1731439812
The severity of the announcement
info, warning, critical The status of the announcement
active, inactive, scheduled Show child attributes
Show child attributes
{ "parent": { "href": "href", "type": "type" } }
The end time of the announcement. This is a Unix timestamp in milliseconds.
1731439880
Show child attributes
Show child attributes
{ "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" } ] }