curl --request PUT \
--url https://developer.synq.io/api/alerts/v2 \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"incidentLifecycle": {
"settings": {
"states": []
},
"targets": [
{
"email": {
"recipientEmails": [
"jsmith@example.com"
]
}
}
]
},
"name": "<string>",
"fqn": "<string>",
"template": {
"plain": "<string>",
"title": "<string>"
},
"configId": "<string>",
"isDisabled": true,
"etag": "<string>"
}
'import requests
url = "https://developer.synq.io/api/alerts/v2"
payload = {
"incidentLifecycle": {
"settings": { "states": [] },
"targets": [{ "email": { "recipientEmails": ["jsmith@example.com"] } }]
},
"name": "<string>",
"fqn": "<string>",
"template": {
"plain": "<string>",
"title": "<string>"
},
"configId": "<string>",
"isDisabled": True,
"etag": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
incidentLifecycle: {
settings: {states: []},
targets: [{email: {recipientEmails: ['jsmith@example.com']}}]
},
name: '<string>',
fqn: '<string>',
template: {plain: '<string>', title: '<string>'},
configId: '<string>',
isDisabled: true,
etag: '<string>'
})
};
fetch('https://developer.synq.io/api/alerts/v2', 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://developer.synq.io/api/alerts/v2",
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([
'incidentLifecycle' => [
'settings' => [
'states' => [
]
],
'targets' => [
[
'email' => [
'recipientEmails' => [
'jsmith@example.com'
]
]
]
]
],
'name' => '<string>',
'fqn' => '<string>',
'template' => [
'plain' => '<string>',
'title' => '<string>'
],
'configId' => '<string>',
'isDisabled' => true,
'etag' => '<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://developer.synq.io/api/alerts/v2"
payload := strings.NewReader("{\n \"incidentLifecycle\": {\n \"settings\": {\n \"states\": []\n },\n \"targets\": [\n {\n \"email\": {\n \"recipientEmails\": [\n \"jsmith@example.com\"\n ]\n }\n }\n ]\n },\n \"name\": \"<string>\",\n \"fqn\": \"<string>\",\n \"template\": {\n \"plain\": \"<string>\",\n \"title\": \"<string>\"\n },\n \"configId\": \"<string>\",\n \"isDisabled\": true,\n \"etag\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://developer.synq.io/api/alerts/v2")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"incidentLifecycle\": {\n \"settings\": {\n \"states\": []\n },\n \"targets\": [\n {\n \"email\": {\n \"recipientEmails\": [\n \"jsmith@example.com\"\n ]\n }\n }\n ]\n },\n \"name\": \"<string>\",\n \"fqn\": \"<string>\",\n \"template\": {\n \"plain\": \"<string>\",\n \"title\": \"<string>\"\n },\n \"configId\": \"<string>\",\n \"isDisabled\": true,\n \"etag\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://developer.synq.io/api/alerts/v2")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"incidentLifecycle\": {\n \"settings\": {\n \"states\": []\n },\n \"targets\": [\n {\n \"email\": {\n \"recipientEmails\": [\n \"jsmith@example.com\"\n ]\n }\n }\n ]\n },\n \"name\": \"<string>\",\n \"fqn\": \"<string>\",\n \"template\": {\n \"plain\": \"<string>\",\n \"title\": \"<string>\"\n },\n \"configId\": \"<string>\",\n \"isDisabled\": true,\n \"etag\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"alert": {
"createdAt": "2023-01-15T01:30:15.01Z",
"incidentLifecycle": {
"settings": {
"states": [
"STATE_UNSPECIFIED"
]
},
"targets": [
{
"email": {
"recipientEmails": [
"jsmith@example.com"
]
}
}
]
},
"id": "<string>",
"name": "<string>",
"fqn": "<string>",
"isDisabled": true,
"template": {
"plain": "<string>",
"title": "<string>"
},
"configId": "<string>",
"etag": "<string>"
},
"created": true
}Upsert
Creates the alert when no alert holds fqn, otherwise replaces the stored
alert with the state given here in a single write. Use it to make a stored
alert match a declared state, e.g. when deploying alerts from configuration
as code. See UpsertRequest for which fields cannot change.
curl --request PUT \
--url https://developer.synq.io/api/alerts/v2 \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"incidentLifecycle": {
"settings": {
"states": []
},
"targets": [
{
"email": {
"recipientEmails": [
"jsmith@example.com"
]
}
}
]
},
"name": "<string>",
"fqn": "<string>",
"template": {
"plain": "<string>",
"title": "<string>"
},
"configId": "<string>",
"isDisabled": true,
"etag": "<string>"
}
'import requests
url = "https://developer.synq.io/api/alerts/v2"
payload = {
"incidentLifecycle": {
"settings": { "states": [] },
"targets": [{ "email": { "recipientEmails": ["jsmith@example.com"] } }]
},
"name": "<string>",
"fqn": "<string>",
"template": {
"plain": "<string>",
"title": "<string>"
},
"configId": "<string>",
"isDisabled": True,
"etag": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
incidentLifecycle: {
settings: {states: []},
targets: [{email: {recipientEmails: ['jsmith@example.com']}}]
},
name: '<string>',
fqn: '<string>',
template: {plain: '<string>', title: '<string>'},
configId: '<string>',
isDisabled: true,
etag: '<string>'
})
};
fetch('https://developer.synq.io/api/alerts/v2', 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://developer.synq.io/api/alerts/v2",
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([
'incidentLifecycle' => [
'settings' => [
'states' => [
]
],
'targets' => [
[
'email' => [
'recipientEmails' => [
'jsmith@example.com'
]
]
]
]
],
'name' => '<string>',
'fqn' => '<string>',
'template' => [
'plain' => '<string>',
'title' => '<string>'
],
'configId' => '<string>',
'isDisabled' => true,
'etag' => '<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://developer.synq.io/api/alerts/v2"
payload := strings.NewReader("{\n \"incidentLifecycle\": {\n \"settings\": {\n \"states\": []\n },\n \"targets\": [\n {\n \"email\": {\n \"recipientEmails\": [\n \"jsmith@example.com\"\n ]\n }\n }\n ]\n },\n \"name\": \"<string>\",\n \"fqn\": \"<string>\",\n \"template\": {\n \"plain\": \"<string>\",\n \"title\": \"<string>\"\n },\n \"configId\": \"<string>\",\n \"isDisabled\": true,\n \"etag\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://developer.synq.io/api/alerts/v2")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"incidentLifecycle\": {\n \"settings\": {\n \"states\": []\n },\n \"targets\": [\n {\n \"email\": {\n \"recipientEmails\": [\n \"jsmith@example.com\"\n ]\n }\n }\n ]\n },\n \"name\": \"<string>\",\n \"fqn\": \"<string>\",\n \"template\": {\n \"plain\": \"<string>\",\n \"title\": \"<string>\"\n },\n \"configId\": \"<string>\",\n \"isDisabled\": true,\n \"etag\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://developer.synq.io/api/alerts/v2")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"incidentLifecycle\": {\n \"settings\": {\n \"states\": []\n },\n \"targets\": [\n {\n \"email\": {\n \"recipientEmails\": [\n \"jsmith@example.com\"\n ]\n }\n }\n ]\n },\n \"name\": \"<string>\",\n \"fqn\": \"<string>\",\n \"template\": {\n \"plain\": \"<string>\",\n \"title\": \"<string>\"\n },\n \"configId\": \"<string>\",\n \"isDisabled\": true,\n \"etag\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"alert": {
"createdAt": "2023-01-15T01:30:15.01Z",
"incidentLifecycle": {
"settings": {
"states": [
"STATE_UNSPECIFIED"
]
},
"targets": [
{
"email": {
"recipientEmails": [
"jsmith@example.com"
]
}
}
]
},
"id": "<string>",
"name": "<string>",
"fqn": "<string>",
"isDisabled": true,
"template": {
"plain": "<string>",
"title": "<string>"
},
"configId": "<string>",
"etag": "<string>"
},
"created": true
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
- UpsertRequest
- UpsertRequest
- UpsertRequest
UpsertRequest states the complete alert held under fqn. Nothing is merged
with the stored alert: every field is written as sent, so an omitted
template clears it and the targets replace the stored ones. The only
exception is is_disabled, described on the field.
The alert kind, the owner inside it, and config_id are fixed when an alert
is created. When an alert already holds fqn and any of them differs from the
stored value, the request fails with FAILED_PRECONDITION and nothing is
written; to change one, delete the alert and upsert it again.
The trigger is stored as sent, as with Create. A query read back from the
API carries parts it cannot express as unsupported, so to write a stored
selection back unchanged send the rendered_resolver_ql you read as
resolver_ql.
Incident-owner alerts cannot be upserted — manage them with ToggleIncidentOwnerAlert.
An incident lifecycle alert.
Show child attributes
Show child attributes
Human-readable name for the alert configuration.
1 - 255Fully qualified name identifying the alert. An alert holding it is replaced; otherwise a new alert is created with it.
1 - 500Custom template for the rendered alert message. Omit to use the default rendering, clearing any stored template. Currently applied only to issue alerts; accepted and ignored for other kinds.
- template
- template
Show child attributes
Show child attributes
Config ID that owns this alert when deployed from configuration as code
(see Alert.config_id); omit it for an alert authored directly. Cannot be
combined with owner.ownership_id. For an existing alert it must equal the
stored value, where omitted and the empty string are different values.
Whether the alert is paused. When omitted, a new alert is created enabled and an existing alert keeps its current state, so a deploy that does not manage pausing never re-enables an alert someone paused in the app. Set it to make the deploy own the paused state.
Optional optimistic-concurrency guard: the write fails with ABORTED if the alert
holding fqn was modified since this etag was read, or no longer exists.