curl --request POST \
--url https://api.select.dev/v2/monitors \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-tenant-id: <x-tenant-id>' \
--data '
{
"name": "<string>",
"trigger_config": {
"skip_if_empty": true,
"type": "digest"
},
"message_config": {
"sections": [
{
"section_type": "title",
"enabled": true
}
],
"title": "<string>",
"templated_values": {}
},
"notification_frequency_config": {
"frequency_type": "on_trigger"
},
"destination_ids": [
"<string>"
],
"cron": "<string>",
"display_in_feed": true,
"team_id": "<string>",
"budget_id": "<string>",
"snowflake_account_id": "<string>",
"partition_config": {
"partition_columns": [
{
"title": "<string>"
}
]
}
}
'import requests
url = "https://api.select.dev/v2/monitors"
payload = {
"name": "<string>",
"trigger_config": {
"skip_if_empty": True,
"type": "digest"
},
"message_config": {
"sections": [
{
"section_type": "title",
"enabled": True
}
],
"title": "<string>",
"templated_values": {}
},
"notification_frequency_config": { "frequency_type": "on_trigger" },
"destination_ids": ["<string>"],
"cron": "<string>",
"display_in_feed": True,
"team_id": "<string>",
"budget_id": "<string>",
"snowflake_account_id": "<string>",
"partition_config": { "partition_columns": [{ "title": "<string>" }] }
}
headers = {
"x-tenant-id": "<x-tenant-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-tenant-id': '<x-tenant-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
trigger_config: {skip_if_empty: true, type: 'digest'},
message_config: {
sections: [{section_type: 'title', enabled: true}],
title: '<string>',
templated_values: {}
},
notification_frequency_config: {frequency_type: 'on_trigger'},
destination_ids: ['<string>'],
cron: '<string>',
display_in_feed: true,
team_id: '<string>',
budget_id: '<string>',
snowflake_account_id: '<string>',
partition_config: {partition_columns: [{title: '<string>'}]}
})
};
fetch('https://api.select.dev/v2/monitors', 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.select.dev/v2/monitors",
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>',
'trigger_config' => [
'skip_if_empty' => true,
'type' => 'digest'
],
'message_config' => [
'sections' => [
[
'section_type' => 'title',
'enabled' => true
]
],
'title' => '<string>',
'templated_values' => [
]
],
'notification_frequency_config' => [
'frequency_type' => 'on_trigger'
],
'destination_ids' => [
'<string>'
],
'cron' => '<string>',
'display_in_feed' => true,
'team_id' => '<string>',
'budget_id' => '<string>',
'snowflake_account_id' => '<string>',
'partition_config' => [
'partition_columns' => [
[
'title' => '<string>'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-tenant-id: <x-tenant-id>"
],
]);
$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.select.dev/v2/monitors"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"trigger_config\": {\n \"skip_if_empty\": true,\n \"type\": \"digest\"\n },\n \"message_config\": {\n \"sections\": [\n {\n \"section_type\": \"title\",\n \"enabled\": true\n }\n ],\n \"title\": \"<string>\",\n \"templated_values\": {}\n },\n \"notification_frequency_config\": {\n \"frequency_type\": \"on_trigger\"\n },\n \"destination_ids\": [\n \"<string>\"\n ],\n \"cron\": \"<string>\",\n \"display_in_feed\": true,\n \"team_id\": \"<string>\",\n \"budget_id\": \"<string>\",\n \"snowflake_account_id\": \"<string>\",\n \"partition_config\": {\n \"partition_columns\": [\n {\n \"title\": \"<string>\"\n }\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-tenant-id", "<x-tenant-id>")
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.select.dev/v2/monitors")
.header("x-tenant-id", "<x-tenant-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"trigger_config\": {\n \"skip_if_empty\": true,\n \"type\": \"digest\"\n },\n \"message_config\": {\n \"sections\": [\n {\n \"section_type\": \"title\",\n \"enabled\": true\n }\n ],\n \"title\": \"<string>\",\n \"templated_values\": {}\n },\n \"notification_frequency_config\": {\n \"frequency_type\": \"on_trigger\"\n },\n \"destination_ids\": [\n \"<string>\"\n ],\n \"cron\": \"<string>\",\n \"display_in_feed\": true,\n \"team_id\": \"<string>\",\n \"budget_id\": \"<string>\",\n \"snowflake_account_id\": \"<string>\",\n \"partition_config\": {\n \"partition_columns\": [\n {\n \"title\": \"<string>\"\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.select.dev/v2/monitors")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-tenant-id"] = '<x-tenant-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"trigger_config\": {\n \"skip_if_empty\": true,\n \"type\": \"digest\"\n },\n \"message_config\": {\n \"sections\": [\n {\n \"section_type\": \"title\",\n \"enabled\": true\n }\n ],\n \"title\": \"<string>\",\n \"templated_values\": {}\n },\n \"notification_frequency_config\": {\n \"frequency_type\": \"on_trigger\"\n },\n \"destination_ids\": [\n \"<string>\"\n ],\n \"cron\": \"<string>\",\n \"display_in_feed\": true,\n \"team_id\": \"<string>\",\n \"budget_id\": \"<string>\",\n \"snowflake_account_id\": \"<string>\",\n \"partition_config\": {\n \"partition_columns\": [\n {\n \"title\": \"<string>\"\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"data_source": "account_spend",
"state": "enabled",
"schedule": "hourly",
"display_in_feed": true,
"type": "digest",
"trigger_config": {
"skip_if_empty": true,
"type": "digest"
},
"message_config": {
"sections": [
{
"section_type": "title",
"enabled": true
}
],
"title": "<string>",
"templated_values": {}
},
"notification_frequency_config": {
"frequency_type": "on_trigger"
},
"destination_ids": [
"<string>"
],
"status": "new",
"latest_run_status": "new",
"create_time": "<string>",
"update_time": "<string>",
"etag": "<string>",
"cron": "<string>",
"team_id": "<string>",
"budget_id": "<string>",
"snowflake_account_id": "<string>",
"partition_config": {
"partition_columns": [
{
"title": "<string>"
}
]
},
"last_run_status": "new",
"latest_run_error_message": "<string>",
"latest_notification_send_time": "<string>",
"latest_run_trigger_status": "triggered",
"last_run_finish_time": "<string>",
"next_run_time": "<string>",
"dismiss_time": "<string>",
"dismissed_by": "<string>",
"dismissed_partitions": [
{
"partition_value": {},
"dismiss_time": "<string>",
"dismissed_by": "<string>"
}
],
"created_by": "<string>",
"updated_by": "<string>"
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}Create a monitor
Every query the monitor runs is checked against its query class, so a dimension, measure or filter the class does not have is rejected, naming the field, rather than failing the monitor’s scheduled runs. Requires monitors:write.
curl --request POST \
--url https://api.select.dev/v2/monitors \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-tenant-id: <x-tenant-id>' \
--data '
{
"name": "<string>",
"trigger_config": {
"skip_if_empty": true,
"type": "digest"
},
"message_config": {
"sections": [
{
"section_type": "title",
"enabled": true
}
],
"title": "<string>",
"templated_values": {}
},
"notification_frequency_config": {
"frequency_type": "on_trigger"
},
"destination_ids": [
"<string>"
],
"cron": "<string>",
"display_in_feed": true,
"team_id": "<string>",
"budget_id": "<string>",
"snowflake_account_id": "<string>",
"partition_config": {
"partition_columns": [
{
"title": "<string>"
}
]
}
}
'import requests
url = "https://api.select.dev/v2/monitors"
payload = {
"name": "<string>",
"trigger_config": {
"skip_if_empty": True,
"type": "digest"
},
"message_config": {
"sections": [
{
"section_type": "title",
"enabled": True
}
],
"title": "<string>",
"templated_values": {}
},
"notification_frequency_config": { "frequency_type": "on_trigger" },
"destination_ids": ["<string>"],
"cron": "<string>",
"display_in_feed": True,
"team_id": "<string>",
"budget_id": "<string>",
"snowflake_account_id": "<string>",
"partition_config": { "partition_columns": [{ "title": "<string>" }] }
}
headers = {
"x-tenant-id": "<x-tenant-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-tenant-id': '<x-tenant-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
trigger_config: {skip_if_empty: true, type: 'digest'},
message_config: {
sections: [{section_type: 'title', enabled: true}],
title: '<string>',
templated_values: {}
},
notification_frequency_config: {frequency_type: 'on_trigger'},
destination_ids: ['<string>'],
cron: '<string>',
display_in_feed: true,
team_id: '<string>',
budget_id: '<string>',
snowflake_account_id: '<string>',
partition_config: {partition_columns: [{title: '<string>'}]}
})
};
fetch('https://api.select.dev/v2/monitors', 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.select.dev/v2/monitors",
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>',
'trigger_config' => [
'skip_if_empty' => true,
'type' => 'digest'
],
'message_config' => [
'sections' => [
[
'section_type' => 'title',
'enabled' => true
]
],
'title' => '<string>',
'templated_values' => [
]
],
'notification_frequency_config' => [
'frequency_type' => 'on_trigger'
],
'destination_ids' => [
'<string>'
],
'cron' => '<string>',
'display_in_feed' => true,
'team_id' => '<string>',
'budget_id' => '<string>',
'snowflake_account_id' => '<string>',
'partition_config' => [
'partition_columns' => [
[
'title' => '<string>'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-tenant-id: <x-tenant-id>"
],
]);
$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.select.dev/v2/monitors"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"trigger_config\": {\n \"skip_if_empty\": true,\n \"type\": \"digest\"\n },\n \"message_config\": {\n \"sections\": [\n {\n \"section_type\": \"title\",\n \"enabled\": true\n }\n ],\n \"title\": \"<string>\",\n \"templated_values\": {}\n },\n \"notification_frequency_config\": {\n \"frequency_type\": \"on_trigger\"\n },\n \"destination_ids\": [\n \"<string>\"\n ],\n \"cron\": \"<string>\",\n \"display_in_feed\": true,\n \"team_id\": \"<string>\",\n \"budget_id\": \"<string>\",\n \"snowflake_account_id\": \"<string>\",\n \"partition_config\": {\n \"partition_columns\": [\n {\n \"title\": \"<string>\"\n }\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-tenant-id", "<x-tenant-id>")
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.select.dev/v2/monitors")
.header("x-tenant-id", "<x-tenant-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"trigger_config\": {\n \"skip_if_empty\": true,\n \"type\": \"digest\"\n },\n \"message_config\": {\n \"sections\": [\n {\n \"section_type\": \"title\",\n \"enabled\": true\n }\n ],\n \"title\": \"<string>\",\n \"templated_values\": {}\n },\n \"notification_frequency_config\": {\n \"frequency_type\": \"on_trigger\"\n },\n \"destination_ids\": [\n \"<string>\"\n ],\n \"cron\": \"<string>\",\n \"display_in_feed\": true,\n \"team_id\": \"<string>\",\n \"budget_id\": \"<string>\",\n \"snowflake_account_id\": \"<string>\",\n \"partition_config\": {\n \"partition_columns\": [\n {\n \"title\": \"<string>\"\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.select.dev/v2/monitors")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-tenant-id"] = '<x-tenant-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"trigger_config\": {\n \"skip_if_empty\": true,\n \"type\": \"digest\"\n },\n \"message_config\": {\n \"sections\": [\n {\n \"section_type\": \"title\",\n \"enabled\": true\n }\n ],\n \"title\": \"<string>\",\n \"templated_values\": {}\n },\n \"notification_frequency_config\": {\n \"frequency_type\": \"on_trigger\"\n },\n \"destination_ids\": [\n \"<string>\"\n ],\n \"cron\": \"<string>\",\n \"display_in_feed\": true,\n \"team_id\": \"<string>\",\n \"budget_id\": \"<string>\",\n \"snowflake_account_id\": \"<string>\",\n \"partition_config\": {\n \"partition_columns\": [\n {\n \"title\": \"<string>\"\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"data_source": "account_spend",
"state": "enabled",
"schedule": "hourly",
"display_in_feed": true,
"type": "digest",
"trigger_config": {
"skip_if_empty": true,
"type": "digest"
},
"message_config": {
"sections": [
{
"section_type": "title",
"enabled": true
}
],
"title": "<string>",
"templated_values": {}
},
"notification_frequency_config": {
"frequency_type": "on_trigger"
},
"destination_ids": [
"<string>"
],
"status": "new",
"latest_run_status": "new",
"create_time": "<string>",
"update_time": "<string>",
"etag": "<string>",
"cron": "<string>",
"team_id": "<string>",
"budget_id": "<string>",
"snowflake_account_id": "<string>",
"partition_config": {
"partition_columns": [
{
"title": "<string>"
}
]
},
"last_run_status": "new",
"latest_run_error_message": "<string>",
"latest_notification_send_time": "<string>",
"latest_run_trigger_status": "triggered",
"last_run_finish_time": "<string>",
"next_run_time": "<string>",
"dismiss_time": "<string>",
"dismissed_by": "<string>",
"dismissed_partitions": [
{
"partition_value": {},
"dismiss_time": "<string>",
"dismissed_by": "<string>"
}
],
"created_by": "<string>",
"updated_by": "<string>"
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}Body
A monitor to create, or the full replacement for an existing one.
The body carries every setting a read returns, except the ones the server
maintains. Filters naming a usage group or usage group set by name are stored
by reference, so a rename carries through, and a read returns them by their
current names. One that was deleted reads as a template resolved through
message_config.templated_values, and keeps failing the monitor's runs until
it is removed. Sending back either form, names or templates, is equivalent.
A paragraph with no body_template, and a chart or table with no title,
gets generated ones, which a read returns.
The data the monitor reads. custom runs the monitor's own SQL, and requires a custom_sql_results section carrying it in custom_sql_query, and a snowflake_account_id to run it against.
account_spend, organization_spend, warehouse, account_usage_group, organization_usage_group, workload, custom, insights, storage, select_org_spend, databricks_workload, databricks_query, databricks_served_endpoint, databricks_endpoint_request, bigquery_workload, bigquery_query, bigquery_projects, bigquery_reservation, bigquery_storage, budget Response
Successful Response
A scheduled check over the organization's data, and what it reports.
A monitor runs its trigger_config on schedule; when the trigger fires it
renders message_config and sends it, as often as
notification_frequency_config allows. partition_config splits one monitor
into an independent check per partition, each of which triggers and is
dismissed on its own.
The data the monitor reads. custom runs the monitor's own SQL.
account_spend, organization_spend, warehouse, account_usage_group, organization_usage_group, workload, custom, insights, storage, select_org_spend, databricks_workload, databricks_query, databricks_served_endpoint, databricks_endpoint_request, bigquery_workload, bigquery_query, bigquery_projects, bigquery_reservation, bigquery_storage, budget How the most recent run in the monitor's run history ended. This ignores state, so a disabled monitor still reports the run it last completed, which status would report as disabled. A monitor with no run history reports new while enabled and unknown otherwise.
new, success, failure, triggered, skipped, snoozed, unknown 
