UpdateSettings
curl --request POST \
--url https://developer.synq.io/api/alerts/v2/settings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"identifier": {
"fqn": "<string>"
},
"incidentLifecycle": {
"states": []
},
"trigger": {
"query": {
"parts": [
{
"entityIds": {
"entityIds": [
"<string>"
]
}
}
]
},
"resolverQl": "<string>",
"renderedResolverQl": "<string>"
},
"etag": "<string>"
}
'import requests
url = "https://developer.synq.io/api/alerts/v2/settings"
payload = {
"identifier": { "fqn": "<string>" },
"incidentLifecycle": { "states": [] },
"trigger": {
"query": { "parts": [{ "entityIds": { "entityIds": ["<string>"] } }] },
"resolverQl": "<string>",
"renderedResolverQl": "<string>"
},
"etag": "<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({
identifier: {fqn: '<string>'},
incidentLifecycle: {states: []},
trigger: {
query: {parts: [{entityIds: {entityIds: ['<string>']}}]},
resolverQl: '<string>',
renderedResolverQl: '<string>'
},
etag: '<string>'
})
};
fetch('https://developer.synq.io/api/alerts/v2/settings', 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/settings",
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([
'identifier' => [
'fqn' => '<string>'
],
'incidentLifecycle' => [
'states' => [
]
],
'trigger' => [
'query' => [
'parts' => [
[
'entityIds' => [
'entityIds' => [
'<string>'
]
]
]
]
],
'resolverQl' => '<string>',
'renderedResolverQl' => '<string>'
],
'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/settings"
payload := strings.NewReader("{\n \"identifier\": {\n \"fqn\": \"<string>\"\n },\n \"incidentLifecycle\": {\n \"states\": []\n },\n \"trigger\": {\n \"query\": {\n \"parts\": [\n {\n \"entityIds\": {\n \"entityIds\": [\n \"<string>\"\n ]\n }\n }\n ]\n },\n \"resolverQl\": \"<string>\",\n \"renderedResolverQl\": \"<string>\"\n },\n \"etag\": \"<string>\"\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://developer.synq.io/api/alerts/v2/settings")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"identifier\": {\n \"fqn\": \"<string>\"\n },\n \"incidentLifecycle\": {\n \"states\": []\n },\n \"trigger\": {\n \"query\": {\n \"parts\": [\n {\n \"entityIds\": {\n \"entityIds\": [\n \"<string>\"\n ]\n }\n }\n ]\n },\n \"resolverQl\": \"<string>\",\n \"renderedResolverQl\": \"<string>\"\n },\n \"etag\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://developer.synq.io/api/alerts/v2/settings")
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 \"identifier\": {\n \"fqn\": \"<string>\"\n },\n \"incidentLifecycle\": {\n \"states\": []\n },\n \"trigger\": {\n \"query\": {\n \"parts\": [\n {\n \"entityIds\": {\n \"entityIds\": [\n \"<string>\"\n ]\n }\n }\n ]\n },\n \"resolverQl\": \"<string>\",\n \"renderedResolverQl\": \"<string>\"\n },\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>"
},
"configNamespace": "<string>",
"etag": "<string>"
}
}synq.alerts.services.v2.AlertsService
UpdateSettings
Update the trigger and/or the kind-specific settings of an alert. The config can be identified by either ID or FQN.
POST
/
api
/
alerts
/
v2
/
settings
UpdateSettings
curl --request POST \
--url https://developer.synq.io/api/alerts/v2/settings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"identifier": {
"fqn": "<string>"
},
"incidentLifecycle": {
"states": []
},
"trigger": {
"query": {
"parts": [
{
"entityIds": {
"entityIds": [
"<string>"
]
}
}
]
},
"resolverQl": "<string>",
"renderedResolverQl": "<string>"
},
"etag": "<string>"
}
'import requests
url = "https://developer.synq.io/api/alerts/v2/settings"
payload = {
"identifier": { "fqn": "<string>" },
"incidentLifecycle": { "states": [] },
"trigger": {
"query": { "parts": [{ "entityIds": { "entityIds": ["<string>"] } }] },
"resolverQl": "<string>",
"renderedResolverQl": "<string>"
},
"etag": "<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({
identifier: {fqn: '<string>'},
incidentLifecycle: {states: []},
trigger: {
query: {parts: [{entityIds: {entityIds: ['<string>']}}]},
resolverQl: '<string>',
renderedResolverQl: '<string>'
},
etag: '<string>'
})
};
fetch('https://developer.synq.io/api/alerts/v2/settings', 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/settings",
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([
'identifier' => [
'fqn' => '<string>'
],
'incidentLifecycle' => [
'states' => [
]
],
'trigger' => [
'query' => [
'parts' => [
[
'entityIds' => [
'entityIds' => [
'<string>'
]
]
]
]
],
'resolverQl' => '<string>',
'renderedResolverQl' => '<string>'
],
'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/settings"
payload := strings.NewReader("{\n \"identifier\": {\n \"fqn\": \"<string>\"\n },\n \"incidentLifecycle\": {\n \"states\": []\n },\n \"trigger\": {\n \"query\": {\n \"parts\": [\n {\n \"entityIds\": {\n \"entityIds\": [\n \"<string>\"\n ]\n }\n }\n ]\n },\n \"resolverQl\": \"<string>\",\n \"renderedResolverQl\": \"<string>\"\n },\n \"etag\": \"<string>\"\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://developer.synq.io/api/alerts/v2/settings")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"identifier\": {\n \"fqn\": \"<string>\"\n },\n \"incidentLifecycle\": {\n \"states\": []\n },\n \"trigger\": {\n \"query\": {\n \"parts\": [\n {\n \"entityIds\": {\n \"entityIds\": [\n \"<string>\"\n ]\n }\n }\n ]\n },\n \"resolverQl\": \"<string>\",\n \"renderedResolverQl\": \"<string>\"\n },\n \"etag\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://developer.synq.io/api/alerts/v2/settings")
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 \"identifier\": {\n \"fqn\": \"<string>\"\n },\n \"incidentLifecycle\": {\n \"states\": []\n },\n \"trigger\": {\n \"query\": {\n \"parts\": [\n {\n \"entityIds\": {\n \"entityIds\": [\n \"<string>\"\n ]\n }\n }\n ]\n },\n \"resolverQl\": \"<string>\",\n \"renderedResolverQl\": \"<string>\"\n },\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>"
},
"configNamespace": "<string>",
"etag": "<string>"
}
}Authorizations
Body
application/json
- UpdateSettingsRequest
- UpdateSettingsRequest
- UpdateSettingsRequest
UpdateSettingsRequest updates an alert's trigger and/or its kind-specific settings. At least one of the two must be provided; whichever is omitted is left unchanged (neither can be cleared). The provided settings must match the alert's existing kind — switching an alert from one kind to another is not permitted. update_settings.at_least_one_facet // At least one of trigger or settings must be set. update_settings.trigger_requires_entity // A trigger applies to entity alerts only and cannot be set together with incident lifecycle settings.