curl --request POST \
--url https://api.checklyhq.com/v1/checks/dns \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"request": {
"query": "<string>",
"nameServer": "<string>",
"port": 123,
"assertions": [],
"protocol": "UDP"
},
"activated": true,
"muted": false,
"doubleCheck": true,
"shouldFail": false,
"locations": [],
"tags": [],
"alertSettings": {
"escalationType": "RUN_BASED",
"runBasedEscalation": {
"failedRunThreshold": 1
},
"reminders": {
"amount": 0,
"interval": 5
},
"parallelRunFailureThreshold": {
"enabled": false,
"percentage": 10
}
},
"useGlobalAlertSettings": true,
"groupId": null,
"groupOrder": null,
"runtimeId": null,
"alertChannelSubscriptions": [
{
"alertChannelId": 123,
"activated": true
}
],
"retryStrategy": {
"baseBackoffSeconds": 60,
"sameRegion": true,
"maxRetries": 5.5,
"maxDurationSeconds": 300,
"onlyOn": [
"NETWORK_ERROR"
]
},
"triggerIncident": {
"serviceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"notifySubscribers": true
},
"runParallel": false,
"description": null,
"checkType": "DNS",
"frequency": 10,
"frequencyOffset": 2,
"heartbeat": {},
"script": "<string>",
"scriptPath": "<string>",
"sslCheckDomain": "<string>",
"environmentVariables": [
{
"key": "<string>",
"value": "<string>",
"locked": false,
"secret": false
}
],
"setupSnippetId": null,
"tearDownSnippetId": null,
"localSetupScript": null,
"localTearDownScript": null,
"degradedResponseTime": 500,
"maxResponseTime": 1000,
"privateLocations": [
"<string>"
]
}
'import requests
url = "https://api.checklyhq.com/v1/checks/dns"
payload = {
"name": "<string>",
"request": {
"query": "<string>",
"nameServer": "<string>",
"port": 123,
"assertions": [],
"protocol": "UDP"
},
"activated": True,
"muted": False,
"doubleCheck": True,
"shouldFail": False,
"locations": [],
"tags": [],
"alertSettings": {
"escalationType": "RUN_BASED",
"runBasedEscalation": { "failedRunThreshold": 1 },
"reminders": {
"amount": 0,
"interval": 5
},
"parallelRunFailureThreshold": {
"enabled": False,
"percentage": 10
}
},
"useGlobalAlertSettings": True,
"groupId": None,
"groupOrder": None,
"runtimeId": None,
"alertChannelSubscriptions": [
{
"alertChannelId": 123,
"activated": True
}
],
"retryStrategy": {
"baseBackoffSeconds": 60,
"sameRegion": True,
"maxRetries": 5.5,
"maxDurationSeconds": 300,
"onlyOn": ["NETWORK_ERROR"]
},
"triggerIncident": {
"serviceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"notifySubscribers": True
},
"runParallel": False,
"description": None,
"checkType": "DNS",
"frequency": 10,
"frequencyOffset": 2,
"heartbeat": {},
"script": "<string>",
"scriptPath": "<string>",
"sslCheckDomain": "<string>",
"environmentVariables": [
{
"key": "<string>",
"value": "<string>",
"locked": False,
"secret": False
}
],
"setupSnippetId": None,
"tearDownSnippetId": None,
"localSetupScript": None,
"localTearDownScript": None,
"degradedResponseTime": 500,
"maxResponseTime": 1000,
"privateLocations": ["<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({
name: '<string>',
request: {
query: '<string>',
nameServer: '<string>',
port: 123,
assertions: [],
protocol: 'UDP'
},
activated: true,
muted: false,
doubleCheck: true,
shouldFail: false,
locations: [],
tags: [],
alertSettings: {
escalationType: 'RUN_BASED',
runBasedEscalation: {failedRunThreshold: 1},
reminders: {amount: 0, interval: 5},
parallelRunFailureThreshold: {enabled: false, percentage: 10}
},
useGlobalAlertSettings: true,
groupId: null,
groupOrder: null,
runtimeId: null,
alertChannelSubscriptions: [{alertChannelId: 123, activated: true}],
retryStrategy: {
baseBackoffSeconds: 60,
sameRegion: true,
maxRetries: 5.5,
maxDurationSeconds: 300,
onlyOn: ['NETWORK_ERROR']
},
triggerIncident: {
serviceId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: '<string>',
description: '<string>',
notifySubscribers: true
},
runParallel: false,
description: null,
checkType: 'DNS',
frequency: 10,
frequencyOffset: 2,
heartbeat: {},
script: '<string>',
scriptPath: '<string>',
sslCheckDomain: '<string>',
environmentVariables: [{key: '<string>', value: '<string>', locked: false, secret: false}],
setupSnippetId: null,
tearDownSnippetId: null,
localSetupScript: null,
localTearDownScript: null,
degradedResponseTime: 500,
maxResponseTime: 1000,
privateLocations: ['<string>']
})
};
fetch('https://api.checklyhq.com/v1/checks/dns', 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://api.checklyhq.com/v1/checks/dns",
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>',
'request' => [
'query' => '<string>',
'nameServer' => '<string>',
'port' => 123,
'assertions' => [
],
'protocol' => 'UDP'
],
'activated' => true,
'muted' => false,
'doubleCheck' => true,
'shouldFail' => false,
'locations' => [
],
'tags' => [
],
'alertSettings' => [
'escalationType' => 'RUN_BASED',
'runBasedEscalation' => [
'failedRunThreshold' => 1
],
'reminders' => [
'amount' => 0,
'interval' => 5
],
'parallelRunFailureThreshold' => [
'enabled' => false,
'percentage' => 10
]
],
'useGlobalAlertSettings' => true,
'groupId' => null,
'groupOrder' => null,
'runtimeId' => null,
'alertChannelSubscriptions' => [
[
'alertChannelId' => 123,
'activated' => true
]
],
'retryStrategy' => [
'baseBackoffSeconds' => 60,
'sameRegion' => true,
'maxRetries' => 5.5,
'maxDurationSeconds' => 300,
'onlyOn' => [
'NETWORK_ERROR'
]
],
'triggerIncident' => [
'serviceId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => '<string>',
'description' => '<string>',
'notifySubscribers' => true
],
'runParallel' => false,
'description' => null,
'checkType' => 'DNS',
'frequency' => 10,
'frequencyOffset' => 2,
'heartbeat' => [
],
'script' => '<string>',
'scriptPath' => '<string>',
'sslCheckDomain' => '<string>',
'environmentVariables' => [
[
'key' => '<string>',
'value' => '<string>',
'locked' => false,
'secret' => false
]
],
'setupSnippetId' => null,
'tearDownSnippetId' => null,
'localSetupScript' => null,
'localTearDownScript' => null,
'degradedResponseTime' => 500,
'maxResponseTime' => 1000,
'privateLocations' => [
'<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://api.checklyhq.com/v1/checks/dns"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"request\": {\n \"query\": \"<string>\",\n \"nameServer\": \"<string>\",\n \"port\": 123,\n \"assertions\": [],\n \"protocol\": \"UDP\"\n },\n \"activated\": true,\n \"muted\": false,\n \"doubleCheck\": true,\n \"shouldFail\": false,\n \"locations\": [],\n \"tags\": [],\n \"alertSettings\": {\n \"escalationType\": \"RUN_BASED\",\n \"runBasedEscalation\": {\n \"failedRunThreshold\": 1\n },\n \"reminders\": {\n \"amount\": 0,\n \"interval\": 5\n },\n \"parallelRunFailureThreshold\": {\n \"enabled\": false,\n \"percentage\": 10\n }\n },\n \"useGlobalAlertSettings\": true,\n \"groupId\": null,\n \"groupOrder\": null,\n \"runtimeId\": null,\n \"alertChannelSubscriptions\": [\n {\n \"alertChannelId\": 123,\n \"activated\": true\n }\n ],\n \"retryStrategy\": {\n \"baseBackoffSeconds\": 60,\n \"sameRegion\": true,\n \"maxRetries\": 5.5,\n \"maxDurationSeconds\": 300,\n \"onlyOn\": [\n \"NETWORK_ERROR\"\n ]\n },\n \"triggerIncident\": {\n \"serviceId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"notifySubscribers\": true\n },\n \"runParallel\": false,\n \"description\": null,\n \"checkType\": \"DNS\",\n \"frequency\": 10,\n \"frequencyOffset\": 2,\n \"heartbeat\": {},\n \"script\": \"<string>\",\n \"scriptPath\": \"<string>\",\n \"sslCheckDomain\": \"<string>\",\n \"environmentVariables\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\",\n \"locked\": false,\n \"secret\": false\n }\n ],\n \"setupSnippetId\": null,\n \"tearDownSnippetId\": null,\n \"localSetupScript\": null,\n \"localTearDownScript\": null,\n \"degradedResponseTime\": 500,\n \"maxResponseTime\": 1000,\n \"privateLocations\": [\n \"<string>\"\n ]\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://api.checklyhq.com/v1/checks/dns")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"request\": {\n \"query\": \"<string>\",\n \"nameServer\": \"<string>\",\n \"port\": 123,\n \"assertions\": [],\n \"protocol\": \"UDP\"\n },\n \"activated\": true,\n \"muted\": false,\n \"doubleCheck\": true,\n \"shouldFail\": false,\n \"locations\": [],\n \"tags\": [],\n \"alertSettings\": {\n \"escalationType\": \"RUN_BASED\",\n \"runBasedEscalation\": {\n \"failedRunThreshold\": 1\n },\n \"reminders\": {\n \"amount\": 0,\n \"interval\": 5\n },\n \"parallelRunFailureThreshold\": {\n \"enabled\": false,\n \"percentage\": 10\n }\n },\n \"useGlobalAlertSettings\": true,\n \"groupId\": null,\n \"groupOrder\": null,\n \"runtimeId\": null,\n \"alertChannelSubscriptions\": [\n {\n \"alertChannelId\": 123,\n \"activated\": true\n }\n ],\n \"retryStrategy\": {\n \"baseBackoffSeconds\": 60,\n \"sameRegion\": true,\n \"maxRetries\": 5.5,\n \"maxDurationSeconds\": 300,\n \"onlyOn\": [\n \"NETWORK_ERROR\"\n ]\n },\n \"triggerIncident\": {\n \"serviceId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"notifySubscribers\": true\n },\n \"runParallel\": false,\n \"description\": null,\n \"checkType\": \"DNS\",\n \"frequency\": 10,\n \"frequencyOffset\": 2,\n \"heartbeat\": {},\n \"script\": \"<string>\",\n \"scriptPath\": \"<string>\",\n \"sslCheckDomain\": \"<string>\",\n \"environmentVariables\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\",\n \"locked\": false,\n \"secret\": false\n }\n ],\n \"setupSnippetId\": null,\n \"tearDownSnippetId\": null,\n \"localSetupScript\": null,\n \"localTearDownScript\": null,\n \"degradedResponseTime\": 500,\n \"maxResponseTime\": 1000,\n \"privateLocations\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.checklyhq.com/v1/checks/dns")
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 \"request\": {\n \"query\": \"<string>\",\n \"nameServer\": \"<string>\",\n \"port\": 123,\n \"assertions\": [],\n \"protocol\": \"UDP\"\n },\n \"activated\": true,\n \"muted\": false,\n \"doubleCheck\": true,\n \"shouldFail\": false,\n \"locations\": [],\n \"tags\": [],\n \"alertSettings\": {\n \"escalationType\": \"RUN_BASED\",\n \"runBasedEscalation\": {\n \"failedRunThreshold\": 1\n },\n \"reminders\": {\n \"amount\": 0,\n \"interval\": 5\n },\n \"parallelRunFailureThreshold\": {\n \"enabled\": false,\n \"percentage\": 10\n }\n },\n \"useGlobalAlertSettings\": true,\n \"groupId\": null,\n \"groupOrder\": null,\n \"runtimeId\": null,\n \"alertChannelSubscriptions\": [\n {\n \"alertChannelId\": 123,\n \"activated\": true\n }\n ],\n \"retryStrategy\": {\n \"baseBackoffSeconds\": 60,\n \"sameRegion\": true,\n \"maxRetries\": 5.5,\n \"maxDurationSeconds\": 300,\n \"onlyOn\": [\n \"NETWORK_ERROR\"\n ]\n },\n \"triggerIncident\": {\n \"serviceId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"notifySubscribers\": true\n },\n \"runParallel\": false,\n \"description\": null,\n \"checkType\": \"DNS\",\n \"frequency\": 10,\n \"frequencyOffset\": 2,\n \"heartbeat\": {},\n \"script\": \"<string>\",\n \"scriptPath\": \"<string>\",\n \"sslCheckDomain\": \"<string>\",\n \"environmentVariables\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\",\n \"locked\": false,\n \"secret\": false\n }\n ],\n \"setupSnippetId\": null,\n \"tearDownSnippetId\": null,\n \"localSetupScript\": null,\n \"localTearDownScript\": null,\n \"degradedResponseTime\": 500,\n \"maxResponseTime\": 1000,\n \"privateLocations\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"name": "<string>",
"activated": true,
"muted": false,
"doubleCheck": true,
"shouldFail": false,
"locations": [],
"tags": [],
"alertSettings": {
"escalationType": "RUN_BASED",
"runBasedEscalation": {
"failedRunThreshold": 1
},
"reminders": {
"amount": 0,
"interval": 5
},
"parallelRunFailureThreshold": {
"enabled": false,
"percentage": 10
}
},
"useGlobalAlertSettings": true,
"groupId": null,
"groupOrder": null,
"runtimeId": null,
"alertChannelSubscriptions": [
{
"alertChannelId": 123,
"activated": true
}
],
"retryStrategy": {
"baseBackoffSeconds": 60,
"sameRegion": true,
"maxRetries": 5.5,
"maxDurationSeconds": 300,
"onlyOn": [
"NETWORK_ERROR"
]
},
"triggerIncident": {
"serviceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"notifySubscribers": true
},
"runParallel": false,
"description": null,
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"alertChannels": {
"email": [
{
"address": ""
}
],
"webhook": [
{
"name": "",
"url": "",
"method": "POST",
"headers": [],
"queryParameters": []
}
],
"slack": [
{
"url": ""
}
],
"sms": [
{
"name": "<string>",
"number": ""
}
]
},
"privateLocations": [
"<string>"
],
"frequency": 10,
"frequencyOffset": 2,
"degradedResponseTime": 123,
"maxResponseTime": 123,
"checkType": "DNS",
"request": {
"query": "<string>",
"nameServer": "<string>",
"port": 123,
"assertions": [],
"protocol": "UDP"
}
}{
"statusCode": 123,
"error": "<string>",
"message": "<string>"
}{
"statusCode": 123,
"error": "<string>",
"message": "<string>"
}{
"statusCode": 123,
"error": "<string>",
"message": "<string>"
}{
"statusCode": 123,
"error": "<string>",
"message": "<string>"
}{
"statusCode": 123,
"error": "<string>",
"message": "<string>"
}Create an DNS monitor
Creates a new DNS monitor. Will return a 402 when you are over the limit of your plan.
When using the globalAlertSetting, the alertSetting can be null
curl --request POST \
--url https://api.checklyhq.com/v1/checks/dns \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"request": {
"query": "<string>",
"nameServer": "<string>",
"port": 123,
"assertions": [],
"protocol": "UDP"
},
"activated": true,
"muted": false,
"doubleCheck": true,
"shouldFail": false,
"locations": [],
"tags": [],
"alertSettings": {
"escalationType": "RUN_BASED",
"runBasedEscalation": {
"failedRunThreshold": 1
},
"reminders": {
"amount": 0,
"interval": 5
},
"parallelRunFailureThreshold": {
"enabled": false,
"percentage": 10
}
},
"useGlobalAlertSettings": true,
"groupId": null,
"groupOrder": null,
"runtimeId": null,
"alertChannelSubscriptions": [
{
"alertChannelId": 123,
"activated": true
}
],
"retryStrategy": {
"baseBackoffSeconds": 60,
"sameRegion": true,
"maxRetries": 5.5,
"maxDurationSeconds": 300,
"onlyOn": [
"NETWORK_ERROR"
]
},
"triggerIncident": {
"serviceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"notifySubscribers": true
},
"runParallel": false,
"description": null,
"checkType": "DNS",
"frequency": 10,
"frequencyOffset": 2,
"heartbeat": {},
"script": "<string>",
"scriptPath": "<string>",
"sslCheckDomain": "<string>",
"environmentVariables": [
{
"key": "<string>",
"value": "<string>",
"locked": false,
"secret": false
}
],
"setupSnippetId": null,
"tearDownSnippetId": null,
"localSetupScript": null,
"localTearDownScript": null,
"degradedResponseTime": 500,
"maxResponseTime": 1000,
"privateLocations": [
"<string>"
]
}
'import requests
url = "https://api.checklyhq.com/v1/checks/dns"
payload = {
"name": "<string>",
"request": {
"query": "<string>",
"nameServer": "<string>",
"port": 123,
"assertions": [],
"protocol": "UDP"
},
"activated": True,
"muted": False,
"doubleCheck": True,
"shouldFail": False,
"locations": [],
"tags": [],
"alertSettings": {
"escalationType": "RUN_BASED",
"runBasedEscalation": { "failedRunThreshold": 1 },
"reminders": {
"amount": 0,
"interval": 5
},
"parallelRunFailureThreshold": {
"enabled": False,
"percentage": 10
}
},
"useGlobalAlertSettings": True,
"groupId": None,
"groupOrder": None,
"runtimeId": None,
"alertChannelSubscriptions": [
{
"alertChannelId": 123,
"activated": True
}
],
"retryStrategy": {
"baseBackoffSeconds": 60,
"sameRegion": True,
"maxRetries": 5.5,
"maxDurationSeconds": 300,
"onlyOn": ["NETWORK_ERROR"]
},
"triggerIncident": {
"serviceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"notifySubscribers": True
},
"runParallel": False,
"description": None,
"checkType": "DNS",
"frequency": 10,
"frequencyOffset": 2,
"heartbeat": {},
"script": "<string>",
"scriptPath": "<string>",
"sslCheckDomain": "<string>",
"environmentVariables": [
{
"key": "<string>",
"value": "<string>",
"locked": False,
"secret": False
}
],
"setupSnippetId": None,
"tearDownSnippetId": None,
"localSetupScript": None,
"localTearDownScript": None,
"degradedResponseTime": 500,
"maxResponseTime": 1000,
"privateLocations": ["<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({
name: '<string>',
request: {
query: '<string>',
nameServer: '<string>',
port: 123,
assertions: [],
protocol: 'UDP'
},
activated: true,
muted: false,
doubleCheck: true,
shouldFail: false,
locations: [],
tags: [],
alertSettings: {
escalationType: 'RUN_BASED',
runBasedEscalation: {failedRunThreshold: 1},
reminders: {amount: 0, interval: 5},
parallelRunFailureThreshold: {enabled: false, percentage: 10}
},
useGlobalAlertSettings: true,
groupId: null,
groupOrder: null,
runtimeId: null,
alertChannelSubscriptions: [{alertChannelId: 123, activated: true}],
retryStrategy: {
baseBackoffSeconds: 60,
sameRegion: true,
maxRetries: 5.5,
maxDurationSeconds: 300,
onlyOn: ['NETWORK_ERROR']
},
triggerIncident: {
serviceId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: '<string>',
description: '<string>',
notifySubscribers: true
},
runParallel: false,
description: null,
checkType: 'DNS',
frequency: 10,
frequencyOffset: 2,
heartbeat: {},
script: '<string>',
scriptPath: '<string>',
sslCheckDomain: '<string>',
environmentVariables: [{key: '<string>', value: '<string>', locked: false, secret: false}],
setupSnippetId: null,
tearDownSnippetId: null,
localSetupScript: null,
localTearDownScript: null,
degradedResponseTime: 500,
maxResponseTime: 1000,
privateLocations: ['<string>']
})
};
fetch('https://api.checklyhq.com/v1/checks/dns', 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://api.checklyhq.com/v1/checks/dns",
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>',
'request' => [
'query' => '<string>',
'nameServer' => '<string>',
'port' => 123,
'assertions' => [
],
'protocol' => 'UDP'
],
'activated' => true,
'muted' => false,
'doubleCheck' => true,
'shouldFail' => false,
'locations' => [
],
'tags' => [
],
'alertSettings' => [
'escalationType' => 'RUN_BASED',
'runBasedEscalation' => [
'failedRunThreshold' => 1
],
'reminders' => [
'amount' => 0,
'interval' => 5
],
'parallelRunFailureThreshold' => [
'enabled' => false,
'percentage' => 10
]
],
'useGlobalAlertSettings' => true,
'groupId' => null,
'groupOrder' => null,
'runtimeId' => null,
'alertChannelSubscriptions' => [
[
'alertChannelId' => 123,
'activated' => true
]
],
'retryStrategy' => [
'baseBackoffSeconds' => 60,
'sameRegion' => true,
'maxRetries' => 5.5,
'maxDurationSeconds' => 300,
'onlyOn' => [
'NETWORK_ERROR'
]
],
'triggerIncident' => [
'serviceId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => '<string>',
'description' => '<string>',
'notifySubscribers' => true
],
'runParallel' => false,
'description' => null,
'checkType' => 'DNS',
'frequency' => 10,
'frequencyOffset' => 2,
'heartbeat' => [
],
'script' => '<string>',
'scriptPath' => '<string>',
'sslCheckDomain' => '<string>',
'environmentVariables' => [
[
'key' => '<string>',
'value' => '<string>',
'locked' => false,
'secret' => false
]
],
'setupSnippetId' => null,
'tearDownSnippetId' => null,
'localSetupScript' => null,
'localTearDownScript' => null,
'degradedResponseTime' => 500,
'maxResponseTime' => 1000,
'privateLocations' => [
'<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://api.checklyhq.com/v1/checks/dns"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"request\": {\n \"query\": \"<string>\",\n \"nameServer\": \"<string>\",\n \"port\": 123,\n \"assertions\": [],\n \"protocol\": \"UDP\"\n },\n \"activated\": true,\n \"muted\": false,\n \"doubleCheck\": true,\n \"shouldFail\": false,\n \"locations\": [],\n \"tags\": [],\n \"alertSettings\": {\n \"escalationType\": \"RUN_BASED\",\n \"runBasedEscalation\": {\n \"failedRunThreshold\": 1\n },\n \"reminders\": {\n \"amount\": 0,\n \"interval\": 5\n },\n \"parallelRunFailureThreshold\": {\n \"enabled\": false,\n \"percentage\": 10\n }\n },\n \"useGlobalAlertSettings\": true,\n \"groupId\": null,\n \"groupOrder\": null,\n \"runtimeId\": null,\n \"alertChannelSubscriptions\": [\n {\n \"alertChannelId\": 123,\n \"activated\": true\n }\n ],\n \"retryStrategy\": {\n \"baseBackoffSeconds\": 60,\n \"sameRegion\": true,\n \"maxRetries\": 5.5,\n \"maxDurationSeconds\": 300,\n \"onlyOn\": [\n \"NETWORK_ERROR\"\n ]\n },\n \"triggerIncident\": {\n \"serviceId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"notifySubscribers\": true\n },\n \"runParallel\": false,\n \"description\": null,\n \"checkType\": \"DNS\",\n \"frequency\": 10,\n \"frequencyOffset\": 2,\n \"heartbeat\": {},\n \"script\": \"<string>\",\n \"scriptPath\": \"<string>\",\n \"sslCheckDomain\": \"<string>\",\n \"environmentVariables\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\",\n \"locked\": false,\n \"secret\": false\n }\n ],\n \"setupSnippetId\": null,\n \"tearDownSnippetId\": null,\n \"localSetupScript\": null,\n \"localTearDownScript\": null,\n \"degradedResponseTime\": 500,\n \"maxResponseTime\": 1000,\n \"privateLocations\": [\n \"<string>\"\n ]\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://api.checklyhq.com/v1/checks/dns")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"request\": {\n \"query\": \"<string>\",\n \"nameServer\": \"<string>\",\n \"port\": 123,\n \"assertions\": [],\n \"protocol\": \"UDP\"\n },\n \"activated\": true,\n \"muted\": false,\n \"doubleCheck\": true,\n \"shouldFail\": false,\n \"locations\": [],\n \"tags\": [],\n \"alertSettings\": {\n \"escalationType\": \"RUN_BASED\",\n \"runBasedEscalation\": {\n \"failedRunThreshold\": 1\n },\n \"reminders\": {\n \"amount\": 0,\n \"interval\": 5\n },\n \"parallelRunFailureThreshold\": {\n \"enabled\": false,\n \"percentage\": 10\n }\n },\n \"useGlobalAlertSettings\": true,\n \"groupId\": null,\n \"groupOrder\": null,\n \"runtimeId\": null,\n \"alertChannelSubscriptions\": [\n {\n \"alertChannelId\": 123,\n \"activated\": true\n }\n ],\n \"retryStrategy\": {\n \"baseBackoffSeconds\": 60,\n \"sameRegion\": true,\n \"maxRetries\": 5.5,\n \"maxDurationSeconds\": 300,\n \"onlyOn\": [\n \"NETWORK_ERROR\"\n ]\n },\n \"triggerIncident\": {\n \"serviceId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"notifySubscribers\": true\n },\n \"runParallel\": false,\n \"description\": null,\n \"checkType\": \"DNS\",\n \"frequency\": 10,\n \"frequencyOffset\": 2,\n \"heartbeat\": {},\n \"script\": \"<string>\",\n \"scriptPath\": \"<string>\",\n \"sslCheckDomain\": \"<string>\",\n \"environmentVariables\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\",\n \"locked\": false,\n \"secret\": false\n }\n ],\n \"setupSnippetId\": null,\n \"tearDownSnippetId\": null,\n \"localSetupScript\": null,\n \"localTearDownScript\": null,\n \"degradedResponseTime\": 500,\n \"maxResponseTime\": 1000,\n \"privateLocations\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.checklyhq.com/v1/checks/dns")
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 \"request\": {\n \"query\": \"<string>\",\n \"nameServer\": \"<string>\",\n \"port\": 123,\n \"assertions\": [],\n \"protocol\": \"UDP\"\n },\n \"activated\": true,\n \"muted\": false,\n \"doubleCheck\": true,\n \"shouldFail\": false,\n \"locations\": [],\n \"tags\": [],\n \"alertSettings\": {\n \"escalationType\": \"RUN_BASED\",\n \"runBasedEscalation\": {\n \"failedRunThreshold\": 1\n },\n \"reminders\": {\n \"amount\": 0,\n \"interval\": 5\n },\n \"parallelRunFailureThreshold\": {\n \"enabled\": false,\n \"percentage\": 10\n }\n },\n \"useGlobalAlertSettings\": true,\n \"groupId\": null,\n \"groupOrder\": null,\n \"runtimeId\": null,\n \"alertChannelSubscriptions\": [\n {\n \"alertChannelId\": 123,\n \"activated\": true\n }\n ],\n \"retryStrategy\": {\n \"baseBackoffSeconds\": 60,\n \"sameRegion\": true,\n \"maxRetries\": 5.5,\n \"maxDurationSeconds\": 300,\n \"onlyOn\": [\n \"NETWORK_ERROR\"\n ]\n },\n \"triggerIncident\": {\n \"serviceId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"notifySubscribers\": true\n },\n \"runParallel\": false,\n \"description\": null,\n \"checkType\": \"DNS\",\n \"frequency\": 10,\n \"frequencyOffset\": 2,\n \"heartbeat\": {},\n \"script\": \"<string>\",\n \"scriptPath\": \"<string>\",\n \"sslCheckDomain\": \"<string>\",\n \"environmentVariables\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\",\n \"locked\": false,\n \"secret\": false\n }\n ],\n \"setupSnippetId\": null,\n \"tearDownSnippetId\": null,\n \"localSetupScript\": null,\n \"localTearDownScript\": null,\n \"degradedResponseTime\": 500,\n \"maxResponseTime\": 1000,\n \"privateLocations\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"name": "<string>",
"activated": true,
"muted": false,
"doubleCheck": true,
"shouldFail": false,
"locations": [],
"tags": [],
"alertSettings": {
"escalationType": "RUN_BASED",
"runBasedEscalation": {
"failedRunThreshold": 1
},
"reminders": {
"amount": 0,
"interval": 5
},
"parallelRunFailureThreshold": {
"enabled": false,
"percentage": 10
}
},
"useGlobalAlertSettings": true,
"groupId": null,
"groupOrder": null,
"runtimeId": null,
"alertChannelSubscriptions": [
{
"alertChannelId": 123,
"activated": true
}
],
"retryStrategy": {
"baseBackoffSeconds": 60,
"sameRegion": true,
"maxRetries": 5.5,
"maxDurationSeconds": 300,
"onlyOn": [
"NETWORK_ERROR"
]
},
"triggerIncident": {
"serviceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"notifySubscribers": true
},
"runParallel": false,
"description": null,
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"alertChannels": {
"email": [
{
"address": ""
}
],
"webhook": [
{
"name": "",
"url": "",
"method": "POST",
"headers": [],
"queryParameters": []
}
],
"slack": [
{
"url": ""
}
],
"sms": [
{
"name": "<string>",
"number": ""
}
]
},
"privateLocations": [
"<string>"
],
"frequency": 10,
"frequencyOffset": 2,
"degradedResponseTime": 123,
"maxResponseTime": 123,
"checkType": "DNS",
"request": {
"query": "<string>",
"nameServer": "<string>",
"port": 123,
"assertions": [],
"protocol": "UDP"
}
}{
"statusCode": 123,
"error": "<string>",
"message": "<string>"
}{
"statusCode": 123,
"error": "<string>",
"message": "<string>"
}{
"statusCode": 123,
"error": "<string>",
"message": "<string>"
}{
"statusCode": 123,
"error": "<string>",
"message": "<string>"
}{
"statusCode": 123,
"error": "<string>",
"message": "<string>"
}Authorizations
The Checkly Public API uses API keys to authenticate requests. You can get the API Key here. Your API key is like a password: keep it secure!
Authentication to the API is performed using the Bearer auth method in the Authorization header and using the account ID.
For example, set Authorization header while using cURL: curl -H "Authorization: Bearer [apiKey]" "X-Checkly-Account: [accountId]"
Headers
Your Checkly account ID, you can find it at https://app.checklyhq.com/settings/account/general
Query Parameters
Determines whether a new check will automatically be added as a subscriber to all existing alert channels when it gets created.
Body
1Show child attributes
Show child attributes
us-east-1, us-east-2, us-west-1, us-west-2, ca-central-1, sa-east-1, eu-west-1, eu-central-1, eu-west-2, eu-west-3, eu-north-1, eu-south-1, me-south-1, ap-southeast-1, ap-northeast-1, ap-east-1, ap-southeast-2, ap-southeast-3, ap-northeast-2, ap-northeast-3, ap-south-1, af-south-1 1Show child attributes
Show child attributes
x >= 02026.04, 2025.04, 2024.09, 2024.02, 2023.09, 2023.02, 2022.10, null Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
500DNS 0, 1, 2, 5, 10, 15, 30, 60, 120, 180, 360, 720, 1440 x >= 1Show child attributes
Show child attributes
1100Show child attributes
Show child attributes
0 <= x <= 50000 <= x <= 50001Response
Created
1us-east-1, us-east-2, us-west-1, us-west-2, ca-central-1, sa-east-1, eu-west-1, eu-central-1, eu-west-2, eu-west-3, eu-north-1, eu-south-1, me-south-1, ap-southeast-1, ap-northeast-1, ap-east-1, ap-southeast-2, ap-southeast-3, ap-northeast-2, ap-northeast-3, ap-south-1, af-south-1 1Show child attributes
Show child attributes
x >= 02026.04, 2025.04, 2024.09, 2024.02, 2023.09, 2023.02, 2022.10, null Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
500Show child attributes
Show child attributes
10, 1, 2, 5, 10, 15, 30, 60, 120, 180, 360, 720, 1440 x >= 1DNS Show child attributes
Show child attributes
Was this page helpful?