curl --request PUT \
--url https://developer.synq.io/api/alerts/v2 \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"identifier": {
"fqn": "<string>"
},
"name": "<string>",
"trigger": {
"query": {
"parts": [
{
"entityIds": {
"entityIds": [
"<string>"
]
}
}
]
},
"resolverQl": "<string>",
"renderedResolverQl": "<string>"
},
"targets": [
{
"email": {
"recipientEmails": [
"jsmith@example.com"
]
}
}
],
"settings": {
"issue": {
"ongoing": {
"disabled": {}
},
"severities": [],
"notifyUpstream": true,
"allowSqlTestAuditLink": true,
"grouping": {
"noGrouping": {}
}
}
}
}
'import requests
url = "https://developer.synq.io/api/alerts/v2"
payload = {
"identifier": { "fqn": "<string>" },
"name": "<string>",
"trigger": {
"query": { "parts": [{ "entityIds": { "entityIds": ["<string>"] } }] },
"resolverQl": "<string>",
"renderedResolverQl": "<string>"
},
"targets": [{ "email": { "recipientEmails": ["jsmith@example.com"] } }],
"settings": { "issue": {
"ongoing": { "disabled": {} },
"severities": [],
"notifyUpstream": True,
"allowSqlTestAuditLink": True,
"grouping": { "noGrouping": {} }
} }
}
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({
identifier: {fqn: '<string>'},
name: '<string>',
trigger: {
query: {parts: [{entityIds: {entityIds: ['<string>']}}]},
resolverQl: '<string>',
renderedResolverQl: '<string>'
},
targets: [{email: {recipientEmails: ['jsmith@example.com']}}],
settings: {
issue: {
ongoing: {disabled: {}},
severities: [],
notifyUpstream: true,
allowSqlTestAuditLink: true,
grouping: {noGrouping: {}}
}
}
})
};
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([
'identifier' => [
'fqn' => '<string>'
],
'name' => '<string>',
'trigger' => [
'query' => [
'parts' => [
[
'entityIds' => [
'entityIds' => [
'<string>'
]
]
]
]
],
'resolverQl' => '<string>',
'renderedResolverQl' => '<string>'
],
'targets' => [
[
'email' => [
'recipientEmails' => [
'jsmith@example.com'
]
]
]
],
'settings' => [
'issue' => [
'ongoing' => [
'disabled' => [
]
],
'severities' => [
],
'notifyUpstream' => true,
'allowSqlTestAuditLink' => true,
'grouping' => [
'noGrouping' => [
]
]
]
]
]),
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 \"identifier\": {\n \"fqn\": \"<string>\"\n },\n \"name\": \"<string>\",\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 \"targets\": [\n {\n \"email\": {\n \"recipientEmails\": [\n \"jsmith@example.com\"\n ]\n }\n }\n ],\n \"settings\": {\n \"issue\": {\n \"ongoing\": {\n \"disabled\": {}\n },\n \"severities\": [],\n \"notifyUpstream\": true,\n \"allowSqlTestAuditLink\": true,\n \"grouping\": {\n \"noGrouping\": {}\n }\n }\n }\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 \"identifier\": {\n \"fqn\": \"<string>\"\n },\n \"name\": \"<string>\",\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 \"targets\": [\n {\n \"email\": {\n \"recipientEmails\": [\n \"jsmith@example.com\"\n ]\n }\n }\n ],\n \"settings\": {\n \"issue\": {\n \"ongoing\": {\n \"disabled\": {}\n },\n \"severities\": [],\n \"notifyUpstream\": true,\n \"allowSqlTestAuditLink\": true,\n \"grouping\": {\n \"noGrouping\": {}\n }\n }\n }\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 \"identifier\": {\n \"fqn\": \"<string>\"\n },\n \"name\": \"<string>\",\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 \"targets\": [\n {\n \"email\": {\n \"recipientEmails\": [\n \"jsmith@example.com\"\n ]\n }\n }\n ],\n \"settings\": {\n \"issue\": {\n \"ongoing\": {\n \"disabled\": {}\n },\n \"severities\": [],\n \"notifyUpstream\": true,\n \"allowSqlTestAuditLink\": true,\n \"grouping\": {\n \"noGrouping\": {}\n }\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"alert": {
"trigger": {
"query": {
"parts": [
{
"entityIds": {
"entityIds": [
"<string>"
]
}
}
],
"operand": "QUERY_OPERAND_UNSPECIFIED"
},
"resolverQl": "<string>",
"renderedResolverQl": "<string>"
},
"settings": {
"issue": {
"ongoing": {
"disabled": {}
},
"severities": [
"SEVERITY_UNSPECIFIED"
],
"notifyUpstream": true,
"allowSqlTestAuditLink": true,
"grouping": {
"noGrouping": {}
}
}
},
"createdAt": "2023-01-15T01:30:15.01Z",
"id": "<string>",
"name": "<string>",
"fqn": "<string>",
"targets": [
{
"email": {
"recipientEmails": [
"jsmith@example.com"
]
}
}
],
"owner": {
"ownerPath": "<string>",
"ownershipId": "<string>"
},
"isDisabled": true
}
}Update
Update an existing alert configuration. The config can be identified by either ID or FQN.
curl --request PUT \
--url https://developer.synq.io/api/alerts/v2 \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"identifier": {
"fqn": "<string>"
},
"name": "<string>",
"trigger": {
"query": {
"parts": [
{
"entityIds": {
"entityIds": [
"<string>"
]
}
}
]
},
"resolverQl": "<string>",
"renderedResolverQl": "<string>"
},
"targets": [
{
"email": {
"recipientEmails": [
"jsmith@example.com"
]
}
}
],
"settings": {
"issue": {
"ongoing": {
"disabled": {}
},
"severities": [],
"notifyUpstream": true,
"allowSqlTestAuditLink": true,
"grouping": {
"noGrouping": {}
}
}
}
}
'import requests
url = "https://developer.synq.io/api/alerts/v2"
payload = {
"identifier": { "fqn": "<string>" },
"name": "<string>",
"trigger": {
"query": { "parts": [{ "entityIds": { "entityIds": ["<string>"] } }] },
"resolverQl": "<string>",
"renderedResolverQl": "<string>"
},
"targets": [{ "email": { "recipientEmails": ["jsmith@example.com"] } }],
"settings": { "issue": {
"ongoing": { "disabled": {} },
"severities": [],
"notifyUpstream": True,
"allowSqlTestAuditLink": True,
"grouping": { "noGrouping": {} }
} }
}
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({
identifier: {fqn: '<string>'},
name: '<string>',
trigger: {
query: {parts: [{entityIds: {entityIds: ['<string>']}}]},
resolverQl: '<string>',
renderedResolverQl: '<string>'
},
targets: [{email: {recipientEmails: ['jsmith@example.com']}}],
settings: {
issue: {
ongoing: {disabled: {}},
severities: [],
notifyUpstream: true,
allowSqlTestAuditLink: true,
grouping: {noGrouping: {}}
}
}
})
};
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([
'identifier' => [
'fqn' => '<string>'
],
'name' => '<string>',
'trigger' => [
'query' => [
'parts' => [
[
'entityIds' => [
'entityIds' => [
'<string>'
]
]
]
]
],
'resolverQl' => '<string>',
'renderedResolverQl' => '<string>'
],
'targets' => [
[
'email' => [
'recipientEmails' => [
'jsmith@example.com'
]
]
]
],
'settings' => [
'issue' => [
'ongoing' => [
'disabled' => [
]
],
'severities' => [
],
'notifyUpstream' => true,
'allowSqlTestAuditLink' => true,
'grouping' => [
'noGrouping' => [
]
]
]
]
]),
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 \"identifier\": {\n \"fqn\": \"<string>\"\n },\n \"name\": \"<string>\",\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 \"targets\": [\n {\n \"email\": {\n \"recipientEmails\": [\n \"jsmith@example.com\"\n ]\n }\n }\n ],\n \"settings\": {\n \"issue\": {\n \"ongoing\": {\n \"disabled\": {}\n },\n \"severities\": [],\n \"notifyUpstream\": true,\n \"allowSqlTestAuditLink\": true,\n \"grouping\": {\n \"noGrouping\": {}\n }\n }\n }\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 \"identifier\": {\n \"fqn\": \"<string>\"\n },\n \"name\": \"<string>\",\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 \"targets\": [\n {\n \"email\": {\n \"recipientEmails\": [\n \"jsmith@example.com\"\n ]\n }\n }\n ],\n \"settings\": {\n \"issue\": {\n \"ongoing\": {\n \"disabled\": {}\n },\n \"severities\": [],\n \"notifyUpstream\": true,\n \"allowSqlTestAuditLink\": true,\n \"grouping\": {\n \"noGrouping\": {}\n }\n }\n }\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 \"identifier\": {\n \"fqn\": \"<string>\"\n },\n \"name\": \"<string>\",\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 \"targets\": [\n {\n \"email\": {\n \"recipientEmails\": [\n \"jsmith@example.com\"\n ]\n }\n }\n ],\n \"settings\": {\n \"issue\": {\n \"ongoing\": {\n \"disabled\": {}\n },\n \"severities\": [],\n \"notifyUpstream\": true,\n \"allowSqlTestAuditLink\": true,\n \"grouping\": {\n \"noGrouping\": {}\n }\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"alert": {
"trigger": {
"query": {
"parts": [
{
"entityIds": {
"entityIds": [
"<string>"
]
}
}
],
"operand": "QUERY_OPERAND_UNSPECIFIED"
},
"resolverQl": "<string>",
"renderedResolverQl": "<string>"
},
"settings": {
"issue": {
"ongoing": {
"disabled": {}
},
"severities": [
"SEVERITY_UNSPECIFIED"
],
"notifyUpstream": true,
"allowSqlTestAuditLink": true,
"grouping": {
"noGrouping": {}
}
}
},
"createdAt": "2023-01-15T01:30:15.01Z",
"id": "<string>",
"name": "<string>",
"fqn": "<string>",
"targets": [
{
"email": {
"recipientEmails": [
"jsmith@example.com"
]
}
}
],
"owner": {
"ownerPath": "<string>",
"ownershipId": "<string>"
},
"isDisabled": true
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
UpdateRequest updates an existing alert configuration. The config can be identified by either ID or FQN. update_request.webhook_incompatible_with_grouped_alerts // Webhook targets are not compatible with grouped alerts. Use the no_grouping strategy when sending alerts to webhook targets. update_request.webhook_incompatible_with_ongoing_alerts // Webhook targets are not compatible with the schedule ongoing strategy. Use the disabled or stream ongoing strategy when sending alerts to webhook targets. update_request.webhook_incompatible_with_schema_change_alerts // Webhook targets are not supported on schema change alerts. Use email, Slack, or Microsoft Teams targets.
Identifier for the config to update.
- fqn
- id
Show child attributes
Show child attributes
Human-readable name for the alert configuration.
1 - 255Selects the entities that can trigger this alert. Leave unset to keep the existing trigger.
Show child attributes
Show child attributes
Targets where alerts will be sent. Leave empty to keep existing targets.
AlertingTarget represents a destination where alert notifications will be sent. Each target type has its own specific configuration requirements.
- email
- ms_teams
- owner
- slack
- webhook
Show child attributes
Show child attributes
Additional settings for the specific alert type.
- issue
- schema_change
Show child attributes
Show child attributes
Response
Success
UpdateResponse returns the updated alert configuration.
The alert configuration that was updated.
Show child attributes
Show child attributes