curl --request POST \
--url https://api.astronomer.io/platform/v1beta1/organizations/{organizationId}/alerts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"entityId": "<string>",
"entityType": "DEPLOYMENT",
"name": "<string>",
"notificationChannelIds": [
"<string>"
],
"rules": {
"patternMatches": [
{
"values": [
"<string>"
]
}
],
"properties": {
"dagDurationSeconds": 302430,
"deploymentId": "<string>"
}
}
}
'import requests
url = "https://api.astronomer.io/platform/v1beta1/organizations/{organizationId}/alerts"
payload = {
"entityId": "<string>",
"entityType": "DEPLOYMENT",
"name": "<string>",
"notificationChannelIds": ["<string>"],
"rules": {
"patternMatches": [{ "values": ["<string>"] }],
"properties": {
"dagDurationSeconds": 302430,
"deploymentId": "<string>"
}
}
}
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({
entityId: '<string>',
entityType: 'DEPLOYMENT',
name: '<string>',
notificationChannelIds: ['<string>'],
rules: {
patternMatches: [{values: ['<string>']}],
properties: {dagDurationSeconds: 302430, deploymentId: '<string>'}
}
})
};
fetch('https://api.astronomer.io/platform/v1beta1/organizations/{organizationId}/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/platform/v1beta1/organizations/{organizationId}/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([
'entityId' => '<string>',
'entityType' => 'DEPLOYMENT',
'name' => '<string>',
'notificationChannelIds' => [
'<string>'
],
'rules' => [
'patternMatches' => [
[
'values' => [
'<string>'
]
]
],
'properties' => [
'dagDurationSeconds' => 302430,
'deploymentId' => '<string>'
]
]
]),
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/platform/v1beta1/organizations/{organizationId}/alerts"
payload := strings.NewReader("{\n \"entityId\": \"<string>\",\n \"entityType\": \"DEPLOYMENT\",\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 \"deploymentId\": \"<string>\"\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/platform/v1beta1/organizations/{organizationId}/alerts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"entityId\": \"<string>\",\n \"entityType\": \"DEPLOYMENT\",\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 \"deploymentId\": \"<string>\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.astronomer.io/platform/v1beta1/organizations/{organizationId}/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 \"entityId\": \"<string>\",\n \"entityType\": \"DEPLOYMENT\",\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 \"deploymentId\": \"<string>\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"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>"
]
}
]
},
"severity": "INFO",
"type": "DAG_SUCCESS",
"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>",
"entityType": "ORGANIZATION",
"id": "<string>",
"name": "<string>",
"organizationId": "<string>",
"type": "SLACK",
"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>"
}
]
}Create an alert
Create an alert.
curl --request POST \
--url https://api.astronomer.io/platform/v1beta1/organizations/{organizationId}/alerts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"entityId": "<string>",
"entityType": "DEPLOYMENT",
"name": "<string>",
"notificationChannelIds": [
"<string>"
],
"rules": {
"patternMatches": [
{
"values": [
"<string>"
]
}
],
"properties": {
"dagDurationSeconds": 302430,
"deploymentId": "<string>"
}
}
}
'import requests
url = "https://api.astronomer.io/platform/v1beta1/organizations/{organizationId}/alerts"
payload = {
"entityId": "<string>",
"entityType": "DEPLOYMENT",
"name": "<string>",
"notificationChannelIds": ["<string>"],
"rules": {
"patternMatches": [{ "values": ["<string>"] }],
"properties": {
"dagDurationSeconds": 302430,
"deploymentId": "<string>"
}
}
}
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({
entityId: '<string>',
entityType: 'DEPLOYMENT',
name: '<string>',
notificationChannelIds: ['<string>'],
rules: {
patternMatches: [{values: ['<string>']}],
properties: {dagDurationSeconds: 302430, deploymentId: '<string>'}
}
})
};
fetch('https://api.astronomer.io/platform/v1beta1/organizations/{organizationId}/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/platform/v1beta1/organizations/{organizationId}/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([
'entityId' => '<string>',
'entityType' => 'DEPLOYMENT',
'name' => '<string>',
'notificationChannelIds' => [
'<string>'
],
'rules' => [
'patternMatches' => [
[
'values' => [
'<string>'
]
]
],
'properties' => [
'dagDurationSeconds' => 302430,
'deploymentId' => '<string>'
]
]
]),
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/platform/v1beta1/organizations/{organizationId}/alerts"
payload := strings.NewReader("{\n \"entityId\": \"<string>\",\n \"entityType\": \"DEPLOYMENT\",\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 \"deploymentId\": \"<string>\"\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/platform/v1beta1/organizations/{organizationId}/alerts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"entityId\": \"<string>\",\n \"entityType\": \"DEPLOYMENT\",\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 \"deploymentId\": \"<string>\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.astronomer.io/platform/v1beta1/organizations/{organizationId}/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 \"entityId\": \"<string>\",\n \"entityType\": \"DEPLOYMENT\",\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 \"deploymentId\": \"<string>\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"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>"
]
}
]
},
"severity": "INFO",
"type": "DAG_SUCCESS",
"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>",
"entityType": "ORGANIZATION",
"id": "<string>",
"name": "<string>",
"organizationId": "<string>",
"type": "SLACK",
"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 alert will belong to.
Body
The request body for creating a new alert.
- DAG_DURATION
- DAG_FAILURE
- DAG_SUCCESS
- DAG_TIMELINESS
- TASK_DURATION
- TASK_FAILURE
The entity ID the alert is associated with.
The ID of the Deployment to which the alert is scoped.
DEPLOYMENT The alert's name.
1 - 500The notification channels to send alerts to.
1Show child attributes
Show child attributes
The alert's severity.
INFO, WARNING, CRITICAL The alert's type.
DAG_SUCCESS, DAG_FAILURE, DAG_DURATION, DAG_TIMELINESS, TASK_DURATION, TASK_FAILURE Response
OK
The time when the alert was created in UTC, formatted as YYYY-MM-DDTHH:MM:SSZ.
"2022-11-22T04:37:12Z"
Show child attributes
Show child attributes
The ID of the entity the alert is associated with.
The type of entity the alert is associated with.
DEPLOYMENT The alert's ID.
The alert's name.
The ID of the organization the alert is associated with.
Show child attributes
Show child attributes
The alert's severity.
INFO, WARNING, CRITICAL The alert's type.
DAG_SUCCESS, DAG_FAILURE, DAG_DURATION, DAG_TIMELINESS, TASK_DURATION, TASK_FAILURE, DATA_PRODUCT_SLA, DATA_PRODUCT_PROACTIVE_FAILURE, DATA_PRODUCT_PROACTIVE_SLA, AIRFLOW_DB_STORAGE_UNUSUALLY_HIGH, DEPRECATED_RUNTIME_VERSION, JOB_SCHEDULING_DISABLED, WORKER_QUEUE_AT_CAPACITY The time when the alert was last updated in UTC, formatted as YYYY-MM-DDTHH:MM:SSZ.
"2022-11-22T04:37:12Z"
Show child attributes
Show child attributes
The ID of the deployment the alert is associated with.
The name of the entity the alert is associated with.
The notification channels to send alerts to.
Show child attributes
Show child attributes
The ID of the workspace the alert is associated with.
Was this page helpful?