Create a synthetic check
curl --request POST \
--url https://sreagent.app/api/v1/config/synthetic_checks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"check_type": "<string>",
"name": "<string>",
"target": "<string>",
"alert_on_failure": true,
"alert_severity": "<string>",
"assertions": {},
"config": {},
"down_quorum": 123,
"enabled": true,
"failure_threshold": 123,
"interval_seconds": 123,
"locations": [
"<string>"
],
"service": "<string>",
"timeout_ms": 123
}
'import requests
url = "https://sreagent.app/api/v1/config/synthetic_checks"
payload = {
"check_type": "<string>",
"name": "<string>",
"target": "<string>",
"alert_on_failure": True,
"alert_severity": "<string>",
"assertions": {},
"config": {},
"down_quorum": 123,
"enabled": True,
"failure_threshold": 123,
"interval_seconds": 123,
"locations": ["<string>"],
"service": "<string>",
"timeout_ms": 123
}
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({
check_type: '<string>',
name: '<string>',
target: '<string>',
alert_on_failure: true,
alert_severity: '<string>',
assertions: {},
config: {},
down_quorum: 123,
enabled: true,
failure_threshold: 123,
interval_seconds: 123,
locations: ['<string>'],
service: '<string>',
timeout_ms: 123
})
};
fetch('https://sreagent.app/api/v1/config/synthetic_checks', 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://sreagent.app/api/v1/config/synthetic_checks",
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([
'check_type' => '<string>',
'name' => '<string>',
'target' => '<string>',
'alert_on_failure' => true,
'alert_severity' => '<string>',
'assertions' => [
],
'config' => [
],
'down_quorum' => 123,
'enabled' => true,
'failure_threshold' => 123,
'interval_seconds' => 123,
'locations' => [
'<string>'
],
'service' => '<string>',
'timeout_ms' => 123
]),
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://sreagent.app/api/v1/config/synthetic_checks"
payload := strings.NewReader("{\n \"check_type\": \"<string>\",\n \"name\": \"<string>\",\n \"target\": \"<string>\",\n \"alert_on_failure\": true,\n \"alert_severity\": \"<string>\",\n \"assertions\": {},\n \"config\": {},\n \"down_quorum\": 123,\n \"enabled\": true,\n \"failure_threshold\": 123,\n \"interval_seconds\": 123,\n \"locations\": [\n \"<string>\"\n ],\n \"service\": \"<string>\",\n \"timeout_ms\": 123\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://sreagent.app/api/v1/config/synthetic_checks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"check_type\": \"<string>\",\n \"name\": \"<string>\",\n \"target\": \"<string>\",\n \"alert_on_failure\": true,\n \"alert_severity\": \"<string>\",\n \"assertions\": {},\n \"config\": {},\n \"down_quorum\": 123,\n \"enabled\": true,\n \"failure_threshold\": 123,\n \"interval_seconds\": 123,\n \"locations\": [\n \"<string>\"\n ],\n \"service\": \"<string>\",\n \"timeout_ms\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sreagent.app/api/v1/config/synthetic_checks")
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 \"check_type\": \"<string>\",\n \"name\": \"<string>\",\n \"target\": \"<string>\",\n \"alert_on_failure\": true,\n \"alert_severity\": \"<string>\",\n \"assertions\": {},\n \"config\": {},\n \"down_quorum\": 123,\n \"enabled\": true,\n \"failure_threshold\": 123,\n \"interval_seconds\": 123,\n \"locations\": [\n \"<string>\"\n ],\n \"service\": \"<string>\",\n \"timeout_ms\": 123\n}"
response = http.request(request)
puts response.read_body{
"error": "<string>",
"message": "<string>"
}synthetic_checks
Create a synthetic check
Create a synthetic check that probes a target on an interval and alerts on failure. check_type is one of http, tcp, dns. `target` is an http(s):// URL for http, and a hostname for tcp and dns. `config` is per-type: tcp requires {"port": 443}; dns requires {"record_type": "a"} (a, aaaa, cname, mx, txt, ns) and accepts {"nameserver": "1.1.1.1"}; http accepts method, body, headers, follow_redirects and tls_verify. `assertions` decide pass/fail beyond reachability: http takes expected_status, body_match and max_latency_ms; dns takes min_records and expected_values. Set `service` only to compose the check with that service's deployments (it then gates deploys and runs as post-deploy verification); leave it unset for an independent monitor.
POST
/
synthetic_checks
Create a synthetic check
curl --request POST \
--url https://sreagent.app/api/v1/config/synthetic_checks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"check_type": "<string>",
"name": "<string>",
"target": "<string>",
"alert_on_failure": true,
"alert_severity": "<string>",
"assertions": {},
"config": {},
"down_quorum": 123,
"enabled": true,
"failure_threshold": 123,
"interval_seconds": 123,
"locations": [
"<string>"
],
"service": "<string>",
"timeout_ms": 123
}
'import requests
url = "https://sreagent.app/api/v1/config/synthetic_checks"
payload = {
"check_type": "<string>",
"name": "<string>",
"target": "<string>",
"alert_on_failure": True,
"alert_severity": "<string>",
"assertions": {},
"config": {},
"down_quorum": 123,
"enabled": True,
"failure_threshold": 123,
"interval_seconds": 123,
"locations": ["<string>"],
"service": "<string>",
"timeout_ms": 123
}
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({
check_type: '<string>',
name: '<string>',
target: '<string>',
alert_on_failure: true,
alert_severity: '<string>',
assertions: {},
config: {},
down_quorum: 123,
enabled: true,
failure_threshold: 123,
interval_seconds: 123,
locations: ['<string>'],
service: '<string>',
timeout_ms: 123
})
};
fetch('https://sreagent.app/api/v1/config/synthetic_checks', 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://sreagent.app/api/v1/config/synthetic_checks",
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([
'check_type' => '<string>',
'name' => '<string>',
'target' => '<string>',
'alert_on_failure' => true,
'alert_severity' => '<string>',
'assertions' => [
],
'config' => [
],
'down_quorum' => 123,
'enabled' => true,
'failure_threshold' => 123,
'interval_seconds' => 123,
'locations' => [
'<string>'
],
'service' => '<string>',
'timeout_ms' => 123
]),
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://sreagent.app/api/v1/config/synthetic_checks"
payload := strings.NewReader("{\n \"check_type\": \"<string>\",\n \"name\": \"<string>\",\n \"target\": \"<string>\",\n \"alert_on_failure\": true,\n \"alert_severity\": \"<string>\",\n \"assertions\": {},\n \"config\": {},\n \"down_quorum\": 123,\n \"enabled\": true,\n \"failure_threshold\": 123,\n \"interval_seconds\": 123,\n \"locations\": [\n \"<string>\"\n ],\n \"service\": \"<string>\",\n \"timeout_ms\": 123\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://sreagent.app/api/v1/config/synthetic_checks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"check_type\": \"<string>\",\n \"name\": \"<string>\",\n \"target\": \"<string>\",\n \"alert_on_failure\": true,\n \"alert_severity\": \"<string>\",\n \"assertions\": {},\n \"config\": {},\n \"down_quorum\": 123,\n \"enabled\": true,\n \"failure_threshold\": 123,\n \"interval_seconds\": 123,\n \"locations\": [\n \"<string>\"\n ],\n \"service\": \"<string>\",\n \"timeout_ms\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sreagent.app/api/v1/config/synthetic_checks")
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 \"check_type\": \"<string>\",\n \"name\": \"<string>\",\n \"target\": \"<string>\",\n \"alert_on_failure\": true,\n \"alert_severity\": \"<string>\",\n \"assertions\": {},\n \"config\": {},\n \"down_quorum\": 123,\n \"enabled\": true,\n \"failure_threshold\": 123,\n \"interval_seconds\": 123,\n \"locations\": [\n \"<string>\"\n ],\n \"service\": \"<string>\",\n \"timeout_ms\": 123\n}"
response = http.request(request)
puts response.read_body{
"error": "<string>",
"message": "<string>"
}Authorizations
An sre_ak_* API key holding the api:admin scope (or api:config_read, which every write refuses with read_only_key).
Body
application/json
http, tcp, dns
critical | high | medium | low | info (default high)
Reporting locations that must fail before the verdict is down. Omit for unanimous; cannot exceed the number of locations.
Consecutive failures before alerting (default 3).
How often to probe. Minimum 60.
Vantage points to probe from; defaults to ["central"].
Per-probe timeout, max 30000. Defaults per type when omitted.
Response
Created.

