Synthetics
Create a synthetic check
Creates a check that requests a URL on a schedule and checks the response. After failuresToAlert failed runs in a row it posts to its Slack channel, and posts the recovery in the same thread. Defaults: GET, every 300 seconds, a 10 second timeout, 1 retry, alert after 1 failure, follow redirects, enabled.
POST
/
synthetic-checks
Create a synthetic check
curl --request POST \
--url https://superlog.sh/api/v1/synthetic-checks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"url": "<string>",
"assertions": [
{
"key": "<string>",
"value": "<string>"
}
],
"body": "<string>",
"enabled": true,
"failuresToAlert": 5,
"followRedirects": true,
"headers": [
{
"name": "<string>",
"value": "<string>",
"secret": true
}
],
"intervalSeconds": 123,
"retries": 1,
"slack": {
"channelId": "<string>",
"integrationAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"timeoutMs": 15500
}
'import requests
url = "https://superlog.sh/api/v1/synthetic-checks"
payload = {
"name": "<string>",
"url": "<string>",
"assertions": [
{
"key": "<string>",
"value": "<string>"
}
],
"body": "<string>",
"enabled": True,
"failuresToAlert": 5,
"followRedirects": True,
"headers": [
{
"name": "<string>",
"value": "<string>",
"secret": True
}
],
"intervalSeconds": 123,
"retries": 1,
"slack": {
"channelId": "<string>",
"integrationAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"timeoutMs": 15500
}
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({
name: '<string>',
url: '<string>',
assertions: [{key: '<string>', value: '<string>'}],
body: JSON.stringify('<string>'),
enabled: true,
failuresToAlert: 5,
followRedirects: true,
headers: [{name: '<string>', value: '<string>', secret: true}],
intervalSeconds: 123,
retries: 1,
slack: {
channelId: '<string>',
integrationAccountId: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
},
timeoutMs: 15500
})
};
fetch('https://superlog.sh/api/v1/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://superlog.sh/api/v1/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([
'name' => '<string>',
'url' => '<string>',
'assertions' => [
[
'key' => '<string>',
'value' => '<string>'
]
],
'body' => '<string>',
'enabled' => true,
'failuresToAlert' => 5,
'followRedirects' => true,
'headers' => [
[
'name' => '<string>',
'value' => '<string>',
'secret' => true
]
],
'intervalSeconds' => 123,
'retries' => 1,
'slack' => [
'channelId' => '<string>',
'integrationAccountId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'timeoutMs' => 15500
]),
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://superlog.sh/api/v1/synthetic-checks"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"assertions\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"body\": \"<string>\",\n \"enabled\": true,\n \"failuresToAlert\": 5,\n \"followRedirects\": true,\n \"headers\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\",\n \"secret\": true\n }\n ],\n \"intervalSeconds\": 123,\n \"retries\": 1,\n \"slack\": {\n \"channelId\": \"<string>\",\n \"integrationAccountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"timeoutMs\": 15500\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://superlog.sh/api/v1/synthetic-checks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"assertions\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"body\": \"<string>\",\n \"enabled\": true,\n \"failuresToAlert\": 5,\n \"followRedirects\": true,\n \"headers\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\",\n \"secret\": true\n }\n ],\n \"intervalSeconds\": 123,\n \"retries\": 1,\n \"slack\": {\n \"channelId\": \"<string>\",\n \"integrationAccountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"timeoutMs\": 15500\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://superlog.sh/api/v1/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 \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"assertions\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"body\": \"<string>\",\n \"enabled\": true,\n \"failuresToAlert\": 5,\n \"followRedirects\": true,\n \"headers\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\",\n \"secret\": true\n }\n ],\n \"intervalSeconds\": 123,\n \"retries\": 1,\n \"slack\": {\n \"channelId\": \"<string>\",\n \"integrationAccountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"timeoutMs\": 15500\n}"
response = http.request(request)
puts response.read_body{
"check": {
"assertions": [
{
"kind": "status_code",
"op": "eq",
"severity": "critical",
"value": "<string>",
"key": "<string>"
}
],
"body": "<string>",
"createdAt": "<string>",
"enabled": true,
"failuresToAlert": 123,
"followRedirects": true,
"headers": [
{
"name": "<string>",
"secret": true,
"value": "<string>"
}
],
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"intervalSeconds": 123,
"lastRunAt": "<string>",
"lastStatus": "passed",
"method": "GET",
"name": "<string>",
"retries": 123,
"slack": {
"channelId": "<string>",
"integrationAccountId": "<string>"
},
"statusSince": "<string>",
"timeoutMs": 123,
"updatedAt": "<string>",
"url": "<string>",
"webUrl": "<string>"
}
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"message": "<string>",
"path": [
"<string>"
]
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"message": "<string>",
"path": [
"<string>"
]
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"message": "<string>",
"path": [
"<string>"
]
}
]
}Authorizations
Body
application/json
⌘I
Create a synthetic check
curl --request POST \
--url https://superlog.sh/api/v1/synthetic-checks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"url": "<string>",
"assertions": [
{
"key": "<string>",
"value": "<string>"
}
],
"body": "<string>",
"enabled": true,
"failuresToAlert": 5,
"followRedirects": true,
"headers": [
{
"name": "<string>",
"value": "<string>",
"secret": true
}
],
"intervalSeconds": 123,
"retries": 1,
"slack": {
"channelId": "<string>",
"integrationAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"timeoutMs": 15500
}
'import requests
url = "https://superlog.sh/api/v1/synthetic-checks"
payload = {
"name": "<string>",
"url": "<string>",
"assertions": [
{
"key": "<string>",
"value": "<string>"
}
],
"body": "<string>",
"enabled": True,
"failuresToAlert": 5,
"followRedirects": True,
"headers": [
{
"name": "<string>",
"value": "<string>",
"secret": True
}
],
"intervalSeconds": 123,
"retries": 1,
"slack": {
"channelId": "<string>",
"integrationAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"timeoutMs": 15500
}
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({
name: '<string>',
url: '<string>',
assertions: [{key: '<string>', value: '<string>'}],
body: JSON.stringify('<string>'),
enabled: true,
failuresToAlert: 5,
followRedirects: true,
headers: [{name: '<string>', value: '<string>', secret: true}],
intervalSeconds: 123,
retries: 1,
slack: {
channelId: '<string>',
integrationAccountId: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
},
timeoutMs: 15500
})
};
fetch('https://superlog.sh/api/v1/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://superlog.sh/api/v1/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([
'name' => '<string>',
'url' => '<string>',
'assertions' => [
[
'key' => '<string>',
'value' => '<string>'
]
],
'body' => '<string>',
'enabled' => true,
'failuresToAlert' => 5,
'followRedirects' => true,
'headers' => [
[
'name' => '<string>',
'value' => '<string>',
'secret' => true
]
],
'intervalSeconds' => 123,
'retries' => 1,
'slack' => [
'channelId' => '<string>',
'integrationAccountId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'timeoutMs' => 15500
]),
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://superlog.sh/api/v1/synthetic-checks"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"assertions\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"body\": \"<string>\",\n \"enabled\": true,\n \"failuresToAlert\": 5,\n \"followRedirects\": true,\n \"headers\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\",\n \"secret\": true\n }\n ],\n \"intervalSeconds\": 123,\n \"retries\": 1,\n \"slack\": {\n \"channelId\": \"<string>\",\n \"integrationAccountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"timeoutMs\": 15500\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://superlog.sh/api/v1/synthetic-checks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"assertions\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"body\": \"<string>\",\n \"enabled\": true,\n \"failuresToAlert\": 5,\n \"followRedirects\": true,\n \"headers\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\",\n \"secret\": true\n }\n ],\n \"intervalSeconds\": 123,\n \"retries\": 1,\n \"slack\": {\n \"channelId\": \"<string>\",\n \"integrationAccountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"timeoutMs\": 15500\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://superlog.sh/api/v1/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 \"name\": \"<string>\",\n \"url\": \"<string>\",\n \"assertions\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"body\": \"<string>\",\n \"enabled\": true,\n \"failuresToAlert\": 5,\n \"followRedirects\": true,\n \"headers\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\",\n \"secret\": true\n }\n ],\n \"intervalSeconds\": 123,\n \"retries\": 1,\n \"slack\": {\n \"channelId\": \"<string>\",\n \"integrationAccountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"timeoutMs\": 15500\n}"
response = http.request(request)
puts response.read_body{
"check": {
"assertions": [
{
"kind": "status_code",
"op": "eq",
"severity": "critical",
"value": "<string>",
"key": "<string>"
}
],
"body": "<string>",
"createdAt": "<string>",
"enabled": true,
"failuresToAlert": 123,
"followRedirects": true,
"headers": [
{
"name": "<string>",
"secret": true,
"value": "<string>"
}
],
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"intervalSeconds": 123,
"lastRunAt": "<string>",
"lastStatus": "passed",
"method": "GET",
"name": "<string>",
"retries": 123,
"slack": {
"channelId": "<string>",
"integrationAccountId": "<string>"
},
"statusSince": "<string>",
"timeoutMs": 123,
"updatedAt": "<string>",
"url": "<string>",
"webUrl": "<string>"
}
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"message": "<string>",
"path": [
"<string>"
]
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"message": "<string>",
"path": [
"<string>"
]
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"message": "<string>",
"path": [
"<string>"
]
}
]
}