Skip to main content
POST
/
recommendation_views
Create recommendation view
curl --request POST \
  --url https://api.vantage.sh/v2/recommendation_views \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "title": "<string>",
  "workspace_token": "<string>",
  "provider_ids": [
    "<string>"
  ],
  "billing_account_ids": [
    "<string>"
  ],
  "account_ids": [
    "<string>"
  ],
  "regions": [
    "<string>"
  ],
  "types": [
    "<string>"
  ],
  "tag_key": "<string>",
  "tag_value": "<string>",
  "start_date": "<string>",
  "end_date": "<string>",
  "min_savings": 123
}
'
import requests

url = "https://api.vantage.sh/v2/recommendation_views"

payload = {
"title": "<string>",
"workspace_token": "<string>",
"provider_ids": ["<string>"],
"billing_account_ids": ["<string>"],
"account_ids": ["<string>"],
"regions": ["<string>"],
"types": ["<string>"],
"tag_key": "<string>",
"tag_value": "<string>",
"start_date": "<string>",
"end_date": "<string>",
"min_savings": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
workspace_token: '<string>',
provider_ids: ['<string>'],
billing_account_ids: ['<string>'],
account_ids: ['<string>'],
regions: ['<string>'],
types: ['<string>'],
tag_key: '<string>',
tag_value: '<string>',
start_date: '<string>',
end_date: '<string>',
min_savings: 123
})
};

fetch('https://api.vantage.sh/v2/recommendation_views', 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.vantage.sh/v2/recommendation_views",
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>',
'workspace_token' => '<string>',
'provider_ids' => [
'<string>'
],
'billing_account_ids' => [
'<string>'
],
'account_ids' => [
'<string>'
],
'regions' => [
'<string>'
],
'types' => [
'<string>'
],
'tag_key' => '<string>',
'tag_value' => '<string>',
'start_date' => '<string>',
'end_date' => '<string>',
'min_savings' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$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.vantage.sh/v2/recommendation_views"

payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"workspace_token\": \"<string>\",\n \"provider_ids\": [\n \"<string>\"\n ],\n \"billing_account_ids\": [\n \"<string>\"\n ],\n \"account_ids\": [\n \"<string>\"\n ],\n \"regions\": [\n \"<string>\"\n ],\n \"types\": [\n \"<string>\"\n ],\n \"tag_key\": \"<string>\",\n \"tag_value\": \"<string>\",\n \"start_date\": \"<string>\",\n \"end_date\": \"<string>\",\n \"min_savings\": 123\n}")

req, _ := http.NewRequest("POST", url, payload)

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.vantage.sh/v2/recommendation_views")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"workspace_token\": \"<string>\",\n \"provider_ids\": [\n \"<string>\"\n ],\n \"billing_account_ids\": [\n \"<string>\"\n ],\n \"account_ids\": [\n \"<string>\"\n ],\n \"regions\": [\n \"<string>\"\n ],\n \"types\": [\n \"<string>\"\n ],\n \"tag_key\": \"<string>\",\n \"tag_value\": \"<string>\",\n \"start_date\": \"<string>\",\n \"end_date\": \"<string>\",\n \"min_savings\": 123\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.vantage.sh/v2/recommendation_views")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\",\n \"workspace_token\": \"<string>\",\n \"provider_ids\": [\n \"<string>\"\n ],\n \"billing_account_ids\": [\n \"<string>\"\n ],\n \"account_ids\": [\n \"<string>\"\n ],\n \"regions\": [\n \"<string>\"\n ],\n \"types\": [\n \"<string>\"\n ],\n \"tag_key\": \"<string>\",\n \"tag_value\": \"<string>\",\n \"start_date\": \"<string>\",\n \"end_date\": \"<string>\",\n \"min_savings\": 123\n}"

response = http.request(request)
puts response.read_body
{
  "token": "rec_vw_a1b2c3d4e5f67890",
  "title": "Staging Recommendations",
  "workspace_token": "wrkspc_be6568a301b1d06c",
  "start_date": "2024-01-01",
  "end_date": "2024-06-30",
  "provider_ids": [
    "aws"
  ],
  "billing_account_ids": [],
  "account_ids": [],
  "regions": [],
  "tag_key": "environment",
  "tag_value": "staging",
  "created_at": "2024-07-15T16:10:00Z",
  "created_by": "usr_95fac32734bdceab"
}
{
"errors": [
"<string>"
],
"links": {
"self": "<string>",
"first": "<string>",
"next": "<string>",
"last": "<string>",
"prev": "<string>"
}
}
{
"errors": [
"<string>"
],
"links": {
"self": "<string>",
"first": "<string>",
"next": "<string>",
"last": "<string>",
"prev": "<string>"
}
}

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Body

application/json

Create a RecommendationView.

title
string
required

The title of the RecommendationView.

workspace_token
string
required

The Workspace to associate the RecommendationView with.

provider_ids
string[]

Filter by one or more providers (e.g. aws, gcp, azure, kubernetes, datadog).

billing_account_ids
string[]

Filter by billing account identifiers.

account_ids
string[]

Filter by cloud account identifiers.

regions
string[]

Filter by region slugs (e.g. us-east-1, eastus, asia-east1).

types
string[]

Filter by one or more recommendation type slugs.

tag_key
string

Filter by tag key (must be used with tag_value).

tag_value
string

Filter by tag value (requires tag_key).

start_date
string

Filter recommendations created on/after this YYYY-MM-DD date.

end_date
string

Filter recommendations created on/before this YYYY-MM-DD date.

min_savings
number<float>

Filter recommendations with at least this amount of potential savings.

Response

RecommendationView model

token
string | null
title
string | null

The title of the RecommendationView.

Example:

"Production Recommendations"

workspace_token
string | null

The token for the Workspace the RecommendationView is a part of.

start_date
string | null

Filter recommendations created on/after this YYYY-MM-DD date.

Example:

"2024-01-01"

end_date
string | null

Filter recommendations created on/before this YYYY-MM-DD date.

Example:

"2024-12-31"

provider_ids
string[] | null

Filter by one or more providers.

billing_account_ids
string[] | null

Filter by billing account identifiers.

account_ids
string[] | null

Filter by cloud account identifiers.

regions
string[] | null

Filter by region slugs (e.g. us-east-1, eastus, asia-east1).

types
string[] | null

Filter by one or more recommendation type slugs.

tag_key
string | null

Filter by tag key (must be used with tag_value).

Example:

"environment"

tag_value
string | null

Filter by tag value (requires tag_key).

Example:

"production"

min_savings
number<float> | null

Filter recommendations with at least this amount of potential savings.

Example:

100.5

created_at
string | null

The date and time, in UTC, the view was created. ISO 8601 Formatted.

Example:

"2023-08-04T00:00:00Z"

created_by
string | null

The token for the Creator of this RecommendationView.