curl --request PATCH \
--url https://api.select.dev/v2/actions/{action_id} \
--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",
"savings_amount": 123,
"savings_rate_percent": 123,
"savings_override_percent": 50,
"resource_metadata": {
"resource_type": "<string>",
"identifying_metadata": {},
"account_metadata": {}
},
"team_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"insight_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"srn": "<string>"
}
'import requests
url = "https://api.select.dev/v2/actions/{action_id}"
payload = {
"title": "<string>",
"comment": "<string>",
"user_email": "<string>",
"actioned_time": "2023-11-07T05:31:56Z",
"end_date": "2023-12-25",
"savings_amount": 123,
"savings_rate_percent": 123,
"savings_override_percent": 50,
"resource_metadata": {
"resource_type": "<string>",
"identifying_metadata": {},
"account_metadata": {}
},
"team_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"insight_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"srn": "<string>"
}
headers = {
"x-tenant-id": "<x-tenant-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
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',
savings_amount: 123,
savings_rate_percent: 123,
savings_override_percent: 50,
resource_metadata: {resource_type: '<string>', identifying_metadata: {}, account_metadata: {}},
team_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
insight_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
srn: '<string>'
})
};
fetch('https://api.select.dev/v2/actions/{action_id}', 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/{action_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'title' => '<string>',
'comment' => '<string>',
'user_email' => '<string>',
'actioned_time' => '2023-11-07T05:31:56Z',
'end_date' => '2023-12-25',
'savings_amount' => 123,
'savings_rate_percent' => 123,
'savings_override_percent' => 50,
'resource_metadata' => [
'resource_type' => '<string>',
'identifying_metadata' => [
],
'account_metadata' => [
]
],
'team_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'insight_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'srn' => '<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/actions/{action_id}"
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 \"savings_amount\": 123,\n \"savings_rate_percent\": 123,\n \"savings_override_percent\": 50,\n \"resource_metadata\": {\n \"resource_type\": \"<string>\",\n \"identifying_metadata\": {},\n \"account_metadata\": {}\n },\n \"team_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"insight_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"srn\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.select.dev/v2/actions/{action_id}")
.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 \"savings_amount\": 123,\n \"savings_rate_percent\": 123,\n \"savings_override_percent\": 50,\n \"resource_metadata\": {\n \"resource_type\": \"<string>\",\n \"identifying_metadata\": {},\n \"account_metadata\": {}\n },\n \"team_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"insight_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"srn\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.select.dev/v2/actions/{action_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.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 \"savings_amount\": 123,\n \"savings_rate_percent\": 123,\n \"savings_override_percent\": 50,\n \"resource_metadata\": {\n \"resource_type\": \"<string>\",\n \"identifying_metadata\": {},\n \"account_metadata\": {}\n },\n \"team_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"insight_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"srn\": \"<string>\"\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": [
{}
]
}{
"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": [
{}
]
}Update an action
curl --request PATCH \
--url https://api.select.dev/v2/actions/{action_id} \
--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",
"savings_amount": 123,
"savings_rate_percent": 123,
"savings_override_percent": 50,
"resource_metadata": {
"resource_type": "<string>",
"identifying_metadata": {},
"account_metadata": {}
},
"team_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"insight_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"srn": "<string>"
}
'import requests
url = "https://api.select.dev/v2/actions/{action_id}"
payload = {
"title": "<string>",
"comment": "<string>",
"user_email": "<string>",
"actioned_time": "2023-11-07T05:31:56Z",
"end_date": "2023-12-25",
"savings_amount": 123,
"savings_rate_percent": 123,
"savings_override_percent": 50,
"resource_metadata": {
"resource_type": "<string>",
"identifying_metadata": {},
"account_metadata": {}
},
"team_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"insight_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"srn": "<string>"
}
headers = {
"x-tenant-id": "<x-tenant-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
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',
savings_amount: 123,
savings_rate_percent: 123,
savings_override_percent: 50,
resource_metadata: {resource_type: '<string>', identifying_metadata: {}, account_metadata: {}},
team_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
insight_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
srn: '<string>'
})
};
fetch('https://api.select.dev/v2/actions/{action_id}', 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/{action_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'title' => '<string>',
'comment' => '<string>',
'user_email' => '<string>',
'actioned_time' => '2023-11-07T05:31:56Z',
'end_date' => '2023-12-25',
'savings_amount' => 123,
'savings_rate_percent' => 123,
'savings_override_percent' => 50,
'resource_metadata' => [
'resource_type' => '<string>',
'identifying_metadata' => [
],
'account_metadata' => [
]
],
'team_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'insight_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'srn' => '<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/actions/{action_id}"
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 \"savings_amount\": 123,\n \"savings_rate_percent\": 123,\n \"savings_override_percent\": 50,\n \"resource_metadata\": {\n \"resource_type\": \"<string>\",\n \"identifying_metadata\": {},\n \"account_metadata\": {}\n },\n \"team_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"insight_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"srn\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.select.dev/v2/actions/{action_id}")
.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 \"savings_amount\": 123,\n \"savings_rate_percent\": 123,\n \"savings_override_percent\": 50,\n \"resource_metadata\": {\n \"resource_type\": \"<string>\",\n \"identifying_metadata\": {},\n \"account_metadata\": {}\n },\n \"team_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"insight_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"srn\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.select.dev/v2/actions/{action_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.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 \"savings_amount\": 123,\n \"savings_rate_percent\": 123,\n \"savings_override_percent\": 50,\n \"resource_metadata\": {\n \"resource_type\": \"<string>\",\n \"identifying_metadata\": {},\n \"account_metadata\": {}\n },\n \"team_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"insight_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"srn\": \"<string>\"\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": [
{}
]
}{
"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.
Path Parameters
Body
Update a cost-saving action.
An omitted field is left unchanged; an explicit null clears a field that is
nullable. Re-point the action at a different resource with at most one of srn or
insight_id. Close an action by setting end_date. Savings status, calculation
metadata and materialization progress are server-managed and are not patchable.
200calculated, manual 0 <= x <= 100smart_suspend, apc_automated_savings, dbx_warehouse_automated_savings, jcss_automated_savings Show child attributes
Show child attributes
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. Patching srn detaches the action from any insight.
2048Response
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

