curl --request POST \
--url https://api.select.dev/v2/monitors/actions/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-tenant-id: <x-tenant-id>' \
--data '
{
"monitor": {
"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>"
}
]
}
},
"partition_value": {},
"format": "raw",
"theme": "light"
}
'import requests
url = "https://api.select.dev/v2/monitors/actions/preview"
payload = {
"monitor": {
"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>" }] }
},
"partition_value": {},
"format": "raw",
"theme": "light"
}
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({
monitor: {
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>'}]}
},
partition_value: {},
format: 'raw',
theme: 'light'
})
};
fetch('https://api.select.dev/v2/monitors/actions/preview', 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/actions/preview",
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([
'monitor' => [
'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>'
]
]
]
],
'partition_value' => [
],
'format' => 'raw',
'theme' => 'light'
]),
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/actions/preview"
payload := strings.NewReader("{\n \"monitor\": {\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 },\n \"partition_value\": {},\n \"format\": \"raw\",\n \"theme\": \"light\"\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/actions/preview")
.header("x-tenant-id", "<x-tenant-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"monitor\": {\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 },\n \"partition_value\": {},\n \"format\": \"raw\",\n \"theme\": \"light\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.select.dev/v2/monitors/actions/preview")
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 \"monitor\": {\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 },\n \"partition_value\": {},\n \"format\": \"raw\",\n \"theme\": \"light\"\n}"
response = http.request(request)
puts response.read_body{
"metadata": {
"snowflake_account_uuid": "<string>",
"snowflake_account_name": "<string>",
"currency": "<string>",
"trigger_config": {
"skip_if_empty": true,
"type": "digest"
},
"usage_group_sets": [
{}
],
"select_org_name": "<string>",
"snowflake_accounts": [
{}
],
"team_name": "<string>",
"trigger_details": {
"upper_bound": 123,
"lower_bound": 123,
"type": "condition"
},
"dbt_meta_keys": [
"<string>"
],
"dbt_top_level_keys": [
"<string>"
],
"custom_workload_meta_keys": [
"<string>"
],
"tag_keys": {},
"triggered_partition_row": {}
},
"sections": [
{
"config": {
"enabled": true,
"section_type": "TITLE"
},
"formatted_title": "<string>"
}
],
"format": "raw"
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}Preview an unsaved monitor's message
Renders the message a monitor would send against current data, whether or not its trigger would fire, and sends nothing. The body carries the monitor in the shape create takes, and it is not saved. A message template that fails to render is rejected, naming the template. Requires monitors:read.
curl --request POST \
--url https://api.select.dev/v2/monitors/actions/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-tenant-id: <x-tenant-id>' \
--data '
{
"monitor": {
"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>"
}
]
}
},
"partition_value": {},
"format": "raw",
"theme": "light"
}
'import requests
url = "https://api.select.dev/v2/monitors/actions/preview"
payload = {
"monitor": {
"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>" }] }
},
"partition_value": {},
"format": "raw",
"theme": "light"
}
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({
monitor: {
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>'}]}
},
partition_value: {},
format: 'raw',
theme: 'light'
})
};
fetch('https://api.select.dev/v2/monitors/actions/preview', 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/actions/preview",
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([
'monitor' => [
'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>'
]
]
]
],
'partition_value' => [
],
'format' => 'raw',
'theme' => 'light'
]),
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/actions/preview"
payload := strings.NewReader("{\n \"monitor\": {\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 },\n \"partition_value\": {},\n \"format\": \"raw\",\n \"theme\": \"light\"\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/actions/preview")
.header("x-tenant-id", "<x-tenant-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"monitor\": {\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 },\n \"partition_value\": {},\n \"format\": \"raw\",\n \"theme\": \"light\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.select.dev/v2/monitors/actions/preview")
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 \"monitor\": {\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 },\n \"partition_value\": {},\n \"format\": \"raw\",\n \"theme\": \"light\"\n}"
response = http.request(request)
puts response.read_body{
"metadata": {
"snowflake_account_uuid": "<string>",
"snowflake_account_name": "<string>",
"currency": "<string>",
"trigger_config": {
"skip_if_empty": true,
"type": "digest"
},
"usage_group_sets": [
{}
],
"select_org_name": "<string>",
"snowflake_accounts": [
{}
],
"team_name": "<string>",
"trigger_details": {
"upper_bound": 123,
"lower_bound": 123,
"type": "condition"
},
"dbt_meta_keys": [
"<string>"
],
"dbt_top_level_keys": [
"<string>"
],
"custom_workload_meta_keys": [
"<string>"
],
"tag_keys": {},
"triggered_partition_row": {}
},
"sections": [
{
"config": {
"enabled": true,
"section_type": "TITLE"
},
"formatted_title": "<string>"
}
],
"format": "raw"
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}Authorizations
Organization API key (sl_…).
Headers
The organization ID the request is scoped to.
Body
Renders the message a monitor would send, before the monitor is saved.
The monitor to render, in the shape create takes. It is not saved.
Show child attributes
Show child attributes
On a partitioned monitor, the partition to render the message for, as the partition_value a run reports for it: its values keyed by the dimension each partition column reads, e.g. {"usage_type": "compute"}. Null renders the monitor as a whole.
Show child attributes
Show child attributes
raw returns the rendered message: its metadata and each rendered section. email returns the HTML body of the email the monitor sends.
raw, email Whether charts are drawn for a light or a dark background.
light, dark Response
Successful Response
- MonitorRawPreview
- MonitorEmailPreview
The message a monitor would send, before a destination formats it.
What the message is about, and the organization settings it renders with.
Show child attributes
Show child attributes
Formatted title section with rendered title.
Final title after applying partition formatting if applicable.
- FormattedTitleSection
- FormattedParagraphSection
- FormattedChartSection
- FormattedTableSection
- FormattedCustomSQLResultsSection
Show child attributes
Show child attributes
"raw"
