Monitors
Create a Schema Change Monitor
POST
/
api
/
v1
/
monitors
/
create
/
schema
Create a Schema Change Monitor
curl --request POST \
--url https://app.datafold.com/api/v1/monitors/create/schema \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"connection_id": 123,
"name": "<string>",
"schedule": {
"interval": {
"every": "<string>",
"type": "hourly"
}
},
"description": "<string>",
"enabled": true,
"notifications": [
{
"recipients": [
"<string>"
],
"features": [],
"type": "email"
}
],
"owner": "<string>",
"table": "<string>",
"tags": [
"<string>"
]
}
'import requests
url = "https://app.datafold.com/api/v1/monitors/create/schema"
payload = {
"connection_id": 123,
"name": "<string>",
"schedule": { "interval": {
"every": "<string>",
"type": "hourly"
} },
"description": "<string>",
"enabled": True,
"notifications": [
{
"recipients": ["<string>"],
"features": [],
"type": "email"
}
],
"owner": "<string>",
"table": "<string>",
"tags": ["<string>"]
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
connection_id: 123,
name: '<string>',
schedule: {interval: {every: '<string>', type: 'hourly'}},
description: '<string>',
enabled: true,
notifications: [{recipients: ['<string>'], features: [], type: 'email'}],
owner: '<string>',
table: '<string>',
tags: ['<string>']
})
};
fetch('https://app.datafold.com/api/v1/monitors/create/schema', 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://app.datafold.com/api/v1/monitors/create/schema",
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([
'connection_id' => 123,
'name' => '<string>',
'schedule' => [
'interval' => [
'every' => '<string>',
'type' => 'hourly'
]
],
'description' => '<string>',
'enabled' => true,
'notifications' => [
[
'recipients' => [
'<string>'
],
'features' => [
],
'type' => 'email'
]
],
'owner' => '<string>',
'table' => '<string>',
'tags' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://app.datafold.com/api/v1/monitors/create/schema"
payload := strings.NewReader("{\n \"connection_id\": 123,\n \"name\": \"<string>\",\n \"schedule\": {\n \"interval\": {\n \"every\": \"<string>\",\n \"type\": \"hourly\"\n }\n },\n \"description\": \"<string>\",\n \"enabled\": true,\n \"notifications\": [\n {\n \"recipients\": [\n \"<string>\"\n ],\n \"features\": [],\n \"type\": \"email\"\n }\n ],\n \"owner\": \"<string>\",\n \"table\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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://app.datafold.com/api/v1/monitors/create/schema")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"connection_id\": 123,\n \"name\": \"<string>\",\n \"schedule\": {\n \"interval\": {\n \"every\": \"<string>\",\n \"type\": \"hourly\"\n }\n },\n \"description\": \"<string>\",\n \"enabled\": true,\n \"notifications\": [\n {\n \"recipients\": [\n \"<string>\"\n ],\n \"features\": [],\n \"type\": \"email\"\n }\n ],\n \"owner\": \"<string>\",\n \"table\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.datafold.com/api/v1/monitors/create/schema")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"connection_id\": 123,\n \"name\": \"<string>\",\n \"schedule\": {\n \"interval\": {\n \"every\": \"<string>\",\n \"type\": \"hourly\"\n }\n },\n \"description\": \"<string>\",\n \"enabled\": true,\n \"notifications\": [\n {\n \"recipients\": [\n \"<string>\"\n ],\n \"features\": [],\n \"type\": \"email\"\n }\n ],\n \"owner\": \"<string>\",\n \"table\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": 123
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}Authorizations
Use the 'Authorization' header with the format 'Key '
Body
application/json
The identifier for the data source configuration.
The name of the monitor.
The schedule at which the monitor runs.
- Interval
- Cron
- None
Show child attributes
Show child attributes
The description of the monitor.
Indicates whether the monitor is enabled.
notifications
(Email · object | PagerDuty · object | Webhook · object | Slack · object | Teams · object)[]
Notification configuration for the monitor.
- Email
- PagerDuty
- Webhook
- Slack
- Teams
Show child attributes
Show child attributes
Email of the monitor owner.
The name of the table.
Tags associated with the monitor.
Response
Successful Response
Unique identifier for the monitor.
⌘I
Create a Schema Change Monitor
curl --request POST \
--url https://app.datafold.com/api/v1/monitors/create/schema \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"connection_id": 123,
"name": "<string>",
"schedule": {
"interval": {
"every": "<string>",
"type": "hourly"
}
},
"description": "<string>",
"enabled": true,
"notifications": [
{
"recipients": [
"<string>"
],
"features": [],
"type": "email"
}
],
"owner": "<string>",
"table": "<string>",
"tags": [
"<string>"
]
}
'import requests
url = "https://app.datafold.com/api/v1/monitors/create/schema"
payload = {
"connection_id": 123,
"name": "<string>",
"schedule": { "interval": {
"every": "<string>",
"type": "hourly"
} },
"description": "<string>",
"enabled": True,
"notifications": [
{
"recipients": ["<string>"],
"features": [],
"type": "email"
}
],
"owner": "<string>",
"table": "<string>",
"tags": ["<string>"]
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
connection_id: 123,
name: '<string>',
schedule: {interval: {every: '<string>', type: 'hourly'}},
description: '<string>',
enabled: true,
notifications: [{recipients: ['<string>'], features: [], type: 'email'}],
owner: '<string>',
table: '<string>',
tags: ['<string>']
})
};
fetch('https://app.datafold.com/api/v1/monitors/create/schema', 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://app.datafold.com/api/v1/monitors/create/schema",
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([
'connection_id' => 123,
'name' => '<string>',
'schedule' => [
'interval' => [
'every' => '<string>',
'type' => 'hourly'
]
],
'description' => '<string>',
'enabled' => true,
'notifications' => [
[
'recipients' => [
'<string>'
],
'features' => [
],
'type' => 'email'
]
],
'owner' => '<string>',
'table' => '<string>',
'tags' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://app.datafold.com/api/v1/monitors/create/schema"
payload := strings.NewReader("{\n \"connection_id\": 123,\n \"name\": \"<string>\",\n \"schedule\": {\n \"interval\": {\n \"every\": \"<string>\",\n \"type\": \"hourly\"\n }\n },\n \"description\": \"<string>\",\n \"enabled\": true,\n \"notifications\": [\n {\n \"recipients\": [\n \"<string>\"\n ],\n \"features\": [],\n \"type\": \"email\"\n }\n ],\n \"owner\": \"<string>\",\n \"table\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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://app.datafold.com/api/v1/monitors/create/schema")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"connection_id\": 123,\n \"name\": \"<string>\",\n \"schedule\": {\n \"interval\": {\n \"every\": \"<string>\",\n \"type\": \"hourly\"\n }\n },\n \"description\": \"<string>\",\n \"enabled\": true,\n \"notifications\": [\n {\n \"recipients\": [\n \"<string>\"\n ],\n \"features\": [],\n \"type\": \"email\"\n }\n ],\n \"owner\": \"<string>\",\n \"table\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.datafold.com/api/v1/monitors/create/schema")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"connection_id\": 123,\n \"name\": \"<string>\",\n \"schedule\": {\n \"interval\": {\n \"every\": \"<string>\",\n \"type\": \"hourly\"\n }\n },\n \"description\": \"<string>\",\n \"enabled\": true,\n \"notifications\": [\n {\n \"recipients\": [\n \"<string>\"\n ],\n \"features\": [],\n \"type\": \"email\"\n }\n ],\n \"owner\": \"<string>\",\n \"table\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": 123
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}