Create actions in a batch
curl --request POST \
--url https://api.select.dev/v2/actions/actions/batch-create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-tenant-id: <x-tenant-id>' \
--data '
{
"items": [
{
"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/actions/batch-create"
payload = { "items": [
{
"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({
items: [
{
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/actions/batch-create', 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/actions/batch-create",
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([
'items' => [
[
'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/actions/batch-create"
payload := strings.NewReader("{\n \"items\": [\n {\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 }\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/actions/actions/batch-create")
.header("x-tenant-id", "<x-tenant-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\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 }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.select.dev/v2/actions/actions/batch-create")
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 \"items\": [\n {\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 }\n ]\n}"
response = http.request(request)
puts response.read_body{
"items": [
{
"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>"
}
],
"page_token": "<string>",
"row_count": 123
}{
"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": [
{}
]
}Actions
Create actions in a batch
POST
/
actions
/
actions
/
batch-create
Create actions in a batch
curl --request POST \
--url https://api.select.dev/v2/actions/actions/batch-create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-tenant-id: <x-tenant-id>' \
--data '
{
"items": [
{
"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/actions/batch-create"
payload = { "items": [
{
"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({
items: [
{
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/actions/batch-create', 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/actions/batch-create",
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([
'items' => [
[
'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/actions/batch-create"
payload := strings.NewReader("{\n \"items\": [\n {\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 }\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/actions/actions/batch-create")
.header("x-tenant-id", "<x-tenant-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\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 }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.select.dev/v2/actions/actions/batch-create")
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 \"items\": [\n {\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 }\n ]\n}"
response = http.request(request)
puts response.read_body{
"items": [
{
"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>"
}
],
"page_token": "<string>",
"row_count": 123
}{
"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
application/json
Create a batch of cost-saving actions in one all-or-nothing request.
Every entry is checked before anything is written: if any entry is rejected,
no actions are created and the error names the entry that caused it. The
created actions are returned in the same order as items.
Required array length:
1 - 100 elementsShow child attributes
Show child attributes

