curl --request POST \
--url https://api.select.dev/v2/actions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-tenant-id: <x-tenant-id>' \
--data '
{
"title": "<string>",
"comment": "<string>",
"user_email": "<string>",
"actioned_time": "2023-11-07T05:31:56Z",
"end_date": "2023-12-25",
"srn": "<string>",
"insight_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"savings_amount": 123,
"savings_rate_percent": 123,
"resource_metadata": {
"resource_type": "<string>",
"identifying_metadata": {},
"account_metadata": {}
},
"team_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://api.select.dev/v2/actions"
payload = {
"title": "<string>",
"comment": "<string>",
"user_email": "<string>",
"actioned_time": "2023-11-07T05:31:56Z",
"end_date": "2023-12-25",
"srn": "<string>",
"insight_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"savings_amount": 123,
"savings_rate_percent": 123,
"resource_metadata": {
"resource_type": "<string>",
"identifying_metadata": {},
"account_metadata": {}
},
"team_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
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({
title: '<string>',
comment: '<string>',
user_email: '<string>',
actioned_time: '2023-11-07T05:31:56Z',
end_date: '2023-12-25',
srn: '<string>',
insight_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
savings_amount: 123,
savings_rate_percent: 123,
resource_metadata: {resource_type: '<string>', identifying_metadata: {}, account_metadata: {}},
team_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://api.select.dev/v2/actions', 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/actions",
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([
'title' => '<string>',
'comment' => '<string>',
'user_email' => '<string>',
'actioned_time' => '2023-11-07T05:31:56Z',
'end_date' => '2023-12-25',
'srn' => '<string>',
'insight_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'savings_amount' => 123,
'savings_rate_percent' => 123,
'resource_metadata' => [
'resource_type' => '<string>',
'identifying_metadata' => [
],
'account_metadata' => [
]
],
'team_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
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/actions"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"comment\": \"<string>\",\n \"user_email\": \"<string>\",\n \"actioned_time\": \"2023-11-07T05:31:56Z\",\n \"end_date\": \"2023-12-25\",\n \"srn\": \"<string>\",\n \"insight_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"savings_amount\": 123,\n \"savings_rate_percent\": 123,\n \"resource_metadata\": {\n \"resource_type\": \"<string>\",\n \"identifying_metadata\": {},\n \"account_metadata\": {}\n },\n \"team_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\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/actions")
.header("x-tenant-id", "<x-tenant-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"comment\": \"<string>\",\n \"user_email\": \"<string>\",\n \"actioned_time\": \"2023-11-07T05:31:56Z\",\n \"end_date\": \"2023-12-25\",\n \"srn\": \"<string>\",\n \"insight_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"savings_amount\": 123,\n \"savings_rate_percent\": 123,\n \"resource_metadata\": {\n \"resource_type\": \"<string>\",\n \"identifying_metadata\": {},\n \"account_metadata\": {}\n },\n \"team_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.select.dev/v2/actions")
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 \"title\": \"<string>\",\n \"comment\": \"<string>\",\n \"user_email\": \"<string>\",\n \"actioned_time\": \"2023-11-07T05:31:56Z\",\n \"end_date\": \"2023-12-25\",\n \"srn\": \"<string>\",\n \"insight_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"savings_amount\": 123,\n \"savings_rate_percent\": 123,\n \"resource_metadata\": {\n \"resource_type\": \"<string>\",\n \"identifying_metadata\": {},\n \"account_metadata\": {}\n },\n \"team_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"title": "<string>",
"srn": "<string>",
"user_email": "<string>",
"actioned_time": "<string>",
"created_by": "<string>",
"srn_resource_type": "<string>",
"create_time": "<string>",
"update_time": "<string>",
"etag": "<string>",
"comment": "<string>",
"end_date": "2023-12-25",
"insight_id": "<string>",
"insight_type": "<string>",
"savings_type": "calculated",
"savings_amount": 123,
"savings_rate_percent": 123,
"savings_override_percent": 123,
"current_daily_savings": 123,
"current_annualized_savings": 123,
"current_realized_savings": 123,
"savings_status": "pending",
"savings_calculation_metadata": {
"avg_daily_before": 123,
"avg_daily_after": 123,
"savings_per_day": 123,
"after_period_start": "<string>",
"after_period_end": "<string>",
"before_period_start": "<string>",
"before_period_end": "<string>",
"days_in_period": 123,
"sum_spend_before": 123,
"sum_spend_after": 123,
"calculated_at": "<string>",
"savings_rate_percent": 123,
"was_capped": false,
"eligibility": {
"eligible": true,
"reasons": [
"<string>"
],
"insufficient_spend": false,
"bytes_diff_pct": 123,
"query_diff_pct": 123,
"config_changes": 123,
"multi_cluster": true,
"prior_savings": true
},
"override": {
"applied_percent": 123,
"original_reasons": [
"<string>"
]
}
},
"savings_materialized_through": "2023-12-25",
"select_feature": "smart_suspend",
"resource_metadata": {
"resource_type": "<string>",
"identifying_metadata": {},
"account_metadata": {}
},
"team_id": "<string>",
"updated_by": "<string>"
}{
"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": [
{}
]
}Create an action
Record an action, and the savings the change it describes goes on to make.
An action resolving an “enable Automated Savings” insight joins the action already open for that feature on the same resource, if there is one, rather than adding a second one measuring the same change. The response is that action, carrying the insight.
curl --request POST \
--url https://api.select.dev/v2/actions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-tenant-id: <x-tenant-id>' \
--data '
{
"title": "<string>",
"comment": "<string>",
"user_email": "<string>",
"actioned_time": "2023-11-07T05:31:56Z",
"end_date": "2023-12-25",
"srn": "<string>",
"insight_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"savings_amount": 123,
"savings_rate_percent": 123,
"resource_metadata": {
"resource_type": "<string>",
"identifying_metadata": {},
"account_metadata": {}
},
"team_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://api.select.dev/v2/actions"
payload = {
"title": "<string>",
"comment": "<string>",
"user_email": "<string>",
"actioned_time": "2023-11-07T05:31:56Z",
"end_date": "2023-12-25",
"srn": "<string>",
"insight_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"savings_amount": 123,
"savings_rate_percent": 123,
"resource_metadata": {
"resource_type": "<string>",
"identifying_metadata": {},
"account_metadata": {}
},
"team_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
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({
title: '<string>',
comment: '<string>',
user_email: '<string>',
actioned_time: '2023-11-07T05:31:56Z',
end_date: '2023-12-25',
srn: '<string>',
insight_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
savings_amount: 123,
savings_rate_percent: 123,
resource_metadata: {resource_type: '<string>', identifying_metadata: {}, account_metadata: {}},
team_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://api.select.dev/v2/actions', 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/actions",
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([
'title' => '<string>',
'comment' => '<string>',
'user_email' => '<string>',
'actioned_time' => '2023-11-07T05:31:56Z',
'end_date' => '2023-12-25',
'srn' => '<string>',
'insight_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'savings_amount' => 123,
'savings_rate_percent' => 123,
'resource_metadata' => [
'resource_type' => '<string>',
'identifying_metadata' => [
],
'account_metadata' => [
]
],
'team_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
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/actions"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"comment\": \"<string>\",\n \"user_email\": \"<string>\",\n \"actioned_time\": \"2023-11-07T05:31:56Z\",\n \"end_date\": \"2023-12-25\",\n \"srn\": \"<string>\",\n \"insight_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"savings_amount\": 123,\n \"savings_rate_percent\": 123,\n \"resource_metadata\": {\n \"resource_type\": \"<string>\",\n \"identifying_metadata\": {},\n \"account_metadata\": {}\n },\n \"team_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\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/actions")
.header("x-tenant-id", "<x-tenant-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"comment\": \"<string>\",\n \"user_email\": \"<string>\",\n \"actioned_time\": \"2023-11-07T05:31:56Z\",\n \"end_date\": \"2023-12-25\",\n \"srn\": \"<string>\",\n \"insight_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"savings_amount\": 123,\n \"savings_rate_percent\": 123,\n \"resource_metadata\": {\n \"resource_type\": \"<string>\",\n \"identifying_metadata\": {},\n \"account_metadata\": {}\n },\n \"team_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.select.dev/v2/actions")
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 \"title\": \"<string>\",\n \"comment\": \"<string>\",\n \"user_email\": \"<string>\",\n \"actioned_time\": \"2023-11-07T05:31:56Z\",\n \"end_date\": \"2023-12-25\",\n \"srn\": \"<string>\",\n \"insight_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"savings_amount\": 123,\n \"savings_rate_percent\": 123,\n \"resource_metadata\": {\n \"resource_type\": \"<string>\",\n \"identifying_metadata\": {},\n \"account_metadata\": {}\n },\n \"team_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"title": "<string>",
"srn": "<string>",
"user_email": "<string>",
"actioned_time": "<string>",
"created_by": "<string>",
"srn_resource_type": "<string>",
"create_time": "<string>",
"update_time": "<string>",
"etag": "<string>",
"comment": "<string>",
"end_date": "2023-12-25",
"insight_id": "<string>",
"insight_type": "<string>",
"savings_type": "calculated",
"savings_amount": 123,
"savings_rate_percent": 123,
"savings_override_percent": 123,
"current_daily_savings": 123,
"current_annualized_savings": 123,
"current_realized_savings": 123,
"savings_status": "pending",
"savings_calculation_metadata": {
"avg_daily_before": 123,
"avg_daily_after": 123,
"savings_per_day": 123,
"after_period_start": "<string>",
"after_period_end": "<string>",
"before_period_start": "<string>",
"before_period_end": "<string>",
"days_in_period": 123,
"sum_spend_before": 123,
"sum_spend_after": 123,
"calculated_at": "<string>",
"savings_rate_percent": 123,
"was_capped": false,
"eligibility": {
"eligible": true,
"reasons": [
"<string>"
],
"insufficient_spend": false,
"bytes_diff_pct": 123,
"query_diff_pct": 123,
"config_changes": 123,
"multi_cluster": true,
"prior_savings": true
},
"override": {
"applied_percent": 123,
"original_reasons": [
"<string>"
]
}
},
"savings_materialized_through": "2023-12-25",
"select_feature": "smart_suspend",
"resource_metadata": {
"resource_type": "<string>",
"identifying_metadata": {},
"account_metadata": {}
},
"team_id": "<string>",
"updated_by": "<string>"
}{
"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
Create a cost-saving action.
Name the resource the action applies to with exactly one of srn or
insight_id. If you have the resource's identifying details but not its
SRN, resolve one first with POST /v2/srn/actions/resolve. An action on an
insight must name it with insight_id.
user_email defaults to the calling user. actioned_time defaults to now;
set it to backdate the action. An API key has no user identity, so a
key-authenticated caller must set user_email.
200manual, calculated, calculated_smart_suspend Email of the person who took this action. Defaults to the calling user. Required for an API key, which has no user identity. Cannot be null.
1When the action was taken, as an RFC 3339 timestamp. Defaults to now. Set it to backdate the action; savings are then measured from that day. Converted to UTC; a timestamp with no offset is read as UTC. Cannot be null.
The canonical SELECT Resource Name (SRN) of the resource this action applies to. Resolve one from a resource's identifying details with POST /v2/srn/actions/resolve. An empty string scopes the action to the whole organization. Insight SRNs are rejected — name an insight with insight_id instead.
2048smart_suspend, apc_automated_savings, dbx_warehouse_automated_savings, jcss_automated_savings Show child attributes
Show child attributes
Response
Successful Response
A cost-saving action taken on a Snowflake resource, with its measured savings.
Opaque strong ETag.
calculated, manual pending, calculated, error, unsupported Show child attributes
Show child attributes
smart_suspend, apc_automated_savings, dbx_warehouse_automated_savings, jcss_automated_savings Show child attributes
Show child attributes

