Bulk update alerts
curl --request POST \
--url https://api.astronomer.io/labs/v1/organizations/{organizationId}/update-alerts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"alerts": [
{
"id": "<string>",
"name": "<string>",
"notificationChannelIds": [
"<string>"
],
"rules": {
"patternMatches": [
{
"values": [
"<string>"
]
}
],
"properties": {
"dagDurationSeconds": 302430
}
}
}
]
}
'import requests
url = "https://api.astronomer.io/labs/v1/organizations/{organizationId}/update-alerts"
payload = { "alerts": [
{
"id": "<string>",
"name": "<string>",
"notificationChannelIds": ["<string>"],
"rules": {
"patternMatches": [{ "values": ["<string>"] }],
"properties": { "dagDurationSeconds": 302430 }
}
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
alerts: [
{
id: '<string>',
name: '<string>',
notificationChannelIds: ['<string>'],
rules: {
patternMatches: [{values: ['<string>']}],
properties: {dagDurationSeconds: 302430}
}
}
]
})
};
fetch('https://api.astronomer.io/labs/v1/organizations/{organizationId}/update-alerts', 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://api.astronomer.io/labs/v1/organizations/{organizationId}/update-alerts",
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([
'alerts' => [
[
'id' => '<string>',
'name' => '<string>',
'notificationChannelIds' => [
'<string>'
],
'rules' => [
'patternMatches' => [
[
'values' => [
'<string>'
]
]
],
'properties' => [
'dagDurationSeconds' => 302430
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api.astronomer.io/labs/v1/organizations/{organizationId}/update-alerts"
payload := strings.NewReader("{\n \"alerts\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"notificationChannelIds\": [\n \"<string>\"\n ],\n \"rules\": {\n \"patternMatches\": [\n {\n \"values\": [\n \"<string>\"\n ]\n }\n ],\n \"properties\": {\n \"dagDurationSeconds\": 302430\n }\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.astronomer.io/labs/v1/organizations/{organizationId}/update-alerts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"alerts\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"notificationChannelIds\": [\n \"<string>\"\n ],\n \"rules\": {\n \"patternMatches\": [\n {\n \"values\": [\n \"<string>\"\n ]\n }\n ],\n \"properties\": {\n \"dagDurationSeconds\": 302430\n }\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.astronomer.io/labs/v1/organizations/{organizationId}/update-alerts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"alerts\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"notificationChannelIds\": [\n \"<string>\"\n ],\n \"rules\": {\n \"patternMatches\": [\n {\n \"values\": [\n \"<string>\"\n ]\n }\n ],\n \"properties\": {\n \"dagDurationSeconds\": 302430\n }\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"alerts": [
{
"createdAt": "2022-11-22T04:37:12Z",
"createdBy": {
"id": "clm8qv74h000008mlf08scq7k",
"apiTokenName": "my-token",
"avatarUrl": "https://avatar.url",
"fullName": "Jane Doe",
"subjectType": "USER",
"username": "user1@company.com"
},
"entityId": "<string>",
"entityType": "DEPLOYMENT",
"id": "<string>",
"name": "<string>",
"organizationId": "<string>",
"rules": {
"properties": "<unknown>",
"patternMatches": [
{
"entityType": "DAG_ID TASK_ID",
"operatorType": "IS IS_NOT INCLUDES EXCLUDES",
"values": [
"<string>"
]
}
]
},
"updatedAt": "2022-11-22T04:37:12Z",
"updatedBy": {
"id": "clm8qv74h000008mlf08scq7k",
"apiTokenName": "my-token",
"avatarUrl": "https://avatar.url",
"fullName": "Jane Doe",
"subjectType": "USER",
"username": "user1@company.com"
},
"deploymentId": "<string>",
"entityName": "<string>",
"notificationChannels": [
{
"createdAt": "2022-11-22T04:37:12Z",
"definition": "<unknown>",
"entityId": "<string>",
"id": "<string>",
"name": "<string>",
"organizationId": "<string>",
"updatedAt": "2022-11-22T04:37:12Z",
"deploymentId": "<string>",
"workspaceId": "<string>"
}
],
"workspaceId": "<string>"
}
]
}{
"message": "<string>",
"requestId": "<string>",
"statusCode": 500,
"fieldErrors": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>"
}
]
}{
"message": "<string>",
"requestId": "<string>",
"statusCode": 500,
"fieldErrors": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>"
}
]
}{
"message": "<string>",
"requestId": "<string>",
"statusCode": 500,
"fieldErrors": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>"
}
]
}{
"message": "<string>",
"requestId": "<string>",
"statusCode": 500,
"fieldErrors": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>"
}
]
}{
"message": "<string>",
"requestId": "<string>",
"statusCode": 500,
"fieldErrors": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>"
}
]
}Alerts
Bulk update alerts
Update up to 30 alerts in a single request.
POST
/
organizations
/
{organizationId}
/
update-alerts
Bulk update alerts
curl --request POST \
--url https://api.astronomer.io/labs/v1/organizations/{organizationId}/update-alerts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"alerts": [
{
"id": "<string>",
"name": "<string>",
"notificationChannelIds": [
"<string>"
],
"rules": {
"patternMatches": [
{
"values": [
"<string>"
]
}
],
"properties": {
"dagDurationSeconds": 302430
}
}
}
]
}
'import requests
url = "https://api.astronomer.io/labs/v1/organizations/{organizationId}/update-alerts"
payload = { "alerts": [
{
"id": "<string>",
"name": "<string>",
"notificationChannelIds": ["<string>"],
"rules": {
"patternMatches": [{ "values": ["<string>"] }],
"properties": { "dagDurationSeconds": 302430 }
}
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
alerts: [
{
id: '<string>',
name: '<string>',
notificationChannelIds: ['<string>'],
rules: {
patternMatches: [{values: ['<string>']}],
properties: {dagDurationSeconds: 302430}
}
}
]
})
};
fetch('https://api.astronomer.io/labs/v1/organizations/{organizationId}/update-alerts', 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://api.astronomer.io/labs/v1/organizations/{organizationId}/update-alerts",
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([
'alerts' => [
[
'id' => '<string>',
'name' => '<string>',
'notificationChannelIds' => [
'<string>'
],
'rules' => [
'patternMatches' => [
[
'values' => [
'<string>'
]
]
],
'properties' => [
'dagDurationSeconds' => 302430
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api.astronomer.io/labs/v1/organizations/{organizationId}/update-alerts"
payload := strings.NewReader("{\n \"alerts\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"notificationChannelIds\": [\n \"<string>\"\n ],\n \"rules\": {\n \"patternMatches\": [\n {\n \"values\": [\n \"<string>\"\n ]\n }\n ],\n \"properties\": {\n \"dagDurationSeconds\": 302430\n }\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.astronomer.io/labs/v1/organizations/{organizationId}/update-alerts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"alerts\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"notificationChannelIds\": [\n \"<string>\"\n ],\n \"rules\": {\n \"patternMatches\": [\n {\n \"values\": [\n \"<string>\"\n ]\n }\n ],\n \"properties\": {\n \"dagDurationSeconds\": 302430\n }\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.astronomer.io/labs/v1/organizations/{organizationId}/update-alerts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"alerts\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"notificationChannelIds\": [\n \"<string>\"\n ],\n \"rules\": {\n \"patternMatches\": [\n {\n \"values\": [\n \"<string>\"\n ]\n }\n ],\n \"properties\": {\n \"dagDurationSeconds\": 302430\n }\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"alerts": [
{
"createdAt": "2022-11-22T04:37:12Z",
"createdBy": {
"id": "clm8qv74h000008mlf08scq7k",
"apiTokenName": "my-token",
"avatarUrl": "https://avatar.url",
"fullName": "Jane Doe",
"subjectType": "USER",
"username": "user1@company.com"
},
"entityId": "<string>",
"entityType": "DEPLOYMENT",
"id": "<string>",
"name": "<string>",
"organizationId": "<string>",
"rules": {
"properties": "<unknown>",
"patternMatches": [
{
"entityType": "DAG_ID TASK_ID",
"operatorType": "IS IS_NOT INCLUDES EXCLUDES",
"values": [
"<string>"
]
}
]
},
"updatedAt": "2022-11-22T04:37:12Z",
"updatedBy": {
"id": "clm8qv74h000008mlf08scq7k",
"apiTokenName": "my-token",
"avatarUrl": "https://avatar.url",
"fullName": "Jane Doe",
"subjectType": "USER",
"username": "user1@company.com"
},
"deploymentId": "<string>",
"entityName": "<string>",
"notificationChannels": [
{
"createdAt": "2022-11-22T04:37:12Z",
"definition": "<unknown>",
"entityId": "<string>",
"id": "<string>",
"name": "<string>",
"organizationId": "<string>",
"updatedAt": "2022-11-22T04:37:12Z",
"deploymentId": "<string>",
"workspaceId": "<string>"
}
],
"workspaceId": "<string>"
}
]
}{
"message": "<string>",
"requestId": "<string>",
"statusCode": 500,
"fieldErrors": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>"
}
]
}{
"message": "<string>",
"requestId": "<string>",
"statusCode": 500,
"fieldErrors": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>"
}
]
}{
"message": "<string>",
"requestId": "<string>",
"statusCode": 500,
"fieldErrors": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>"
}
]
}{
"message": "<string>",
"requestId": "<string>",
"statusCode": 500,
"fieldErrors": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>"
}
]
}{
"message": "<string>",
"requestId": "<string>",
"statusCode": 500,
"fieldErrors": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The ID of the Organization to which the alerts belong to.
Body
application/json
The request body for updating multiple alerts.
The alerts to update. At most 30 per request.
Required array length:
1 - 30 elements- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
Show child attributes
Show child attributes
Response
OK
The alerts that were created or updated.
Show child attributes
Show child attributes
Was this page helpful?
⌘I