Skip to main content
POST
/
dashboards
Create dashboard
curl --request POST \
  --url https://api.vantage.sh/v2/dashboards \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "title": "<string>",
  "widgets": [
    {
      "widgetable_token": "<string>",
      "title": "<string>"
    }
  ],
  "saved_filter_tokens": [
    "<string>"
  ],
  "start_date": "<string>",
  "end_date": "<string>",
  "workspace_token": "<string>"
}
'
import requests

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

payload = {
"title": "<string>",
"widgets": [
{
"widgetable_token": "<string>",
"title": "<string>"
}
],
"saved_filter_tokens": ["<string>"],
"start_date": "<string>",
"end_date": "<string>",
"workspace_token": "<string>"
}
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>',
widgets: [{widgetable_token: '<string>', title: '<string>'}],
saved_filter_tokens: ['<string>'],
start_date: '<string>',
end_date: '<string>',
workspace_token: '<string>'
})
};

fetch('https://api.vantage.sh/v2/dashboards', 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/dashboards",
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>',
'widgets' => [
[
'widgetable_token' => '<string>',
'title' => '<string>'
]
],
'saved_filter_tokens' => [
'<string>'
],
'start_date' => '<string>',
'end_date' => '<string>',
'workspace_token' => '<string>'
]),
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/dashboards"

payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"widgets\": [\n {\n \"widgetable_token\": \"<string>\",\n \"title\": \"<string>\"\n }\n ],\n \"saved_filter_tokens\": [\n \"<string>\"\n ],\n \"start_date\": \"<string>\",\n \"end_date\": \"<string>\",\n \"workspace_token\": \"<string>\"\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/dashboards")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"widgets\": [\n {\n \"widgetable_token\": \"<string>\",\n \"title\": \"<string>\"\n }\n ],\n \"saved_filter_tokens\": [\n \"<string>\"\n ],\n \"start_date\": \"<string>\",\n \"end_date\": \"<string>\",\n \"workspace_token\": \"<string>\"\n}")
.asString();
require 'uri'
require 'net/http'

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

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 \"widgets\": [\n {\n \"widgetable_token\": \"<string>\",\n \"title\": \"<string>\"\n }\n ],\n \"saved_filter_tokens\": [\n \"<string>\"\n ],\n \"start_date\": \"<string>\",\n \"end_date\": \"<string>\",\n \"workspace_token\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "token": "dshbrd_7e272e8d3de34719",
  "title": "New Dashboard",
  "widget_tokens": [
    "fncl_cmnt_rprt_d4743c186c130e30",
    "kbnts_eff_rprt_892d1566bd543b67",
    "rprt_750074c1b25b372a"
  ],
  "widgets": [
    {
      "widgetable_token": "fncl_cmnt_rprt_d4743c186c130e30",
      "title": "All Financial Commitments",
      "settings": {
        "display_type": "chart"
      }
    },
    {
      "widgetable_token": "kbnts_eff_rprt_892d1566bd543b67",
      "title": "All Kubernetes Nodes Efficiency",
      "settings": {
        "display_type": "table"
      }
    },
    {
      "widgetable_token": "rprt_750074c1b25b372a",
      "title": "Azure Cost Report",
      "settings": {
        "display_type": "chart"
      }
    }
  ],
  "saved_filter_tokens": [
    "svd_fltr_3f45aefa131861ac"
  ],
  "date_bin": "week",
  "date_interval": "this_month",
  "start_date": "2023-08-01",
  "end_date": "2023-08-31",
  "created_at": "2023-08-15T00:00:00Z",
  "updated_at": "2023-08-15T00:00:00Z",
  "workspace_token": "wrkspc_08e043cc14ced776"
}
{
"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 Dashboard.

title
string
required

The title of the Dashboard.

widgets
object[]

The widgets to add to the Dashboard. Currently supports CostReport, ResourceReport, KubernetesEfficiencyReport, FinancialCommitmentReport, and RecommendationView.

saved_filter_tokens
string[]

The tokens of the Saved Filters used in the Dashboard.

date_bin
enum<string>

Determines how to group costs in the Dashboard.

Available options:
cumulative,
day,
week,
month
date_interval
enum<string>

Determines the date range in the Dashboard. Incompatible with 'start_date' and 'end_date' parameters.

Available options:
this_month,
last_7_days,
last_30_days,
last_month,
last_3_months,
last_6_months,
custom,
last_12_months,
last_24_months,
last_36_months,
next_month,
next_3_months,
next_6_months,
next_12_months,
year_to_date,
last_3_days,
last_14_days
start_date
string

The start date for the date range for costs in the Dashboard. ISO 8601 Formatted. Incompatible with 'date_interval' parameter.

end_date
string

The end date for the date range for costs in the Dashboard. ISO 8601 Formatted. Incompatible with 'date_interval' parameter.

workspace_token
string

The token of the Workspace to add the Dashboard to. Required if the API token is associated with multiple Workspaces.

Response

Dashboard model

token
string
required
Example:

"dshbrd_abcd1234567890"

title
string
required

The title of the Dashboard.

Example:

"AWS Dashboard"

widgets
object[]
required
saved_filter_tokens
string[]
required

The tokens of the Saved Filters used in the Dashboard.

date_bin
enum<string> | null
required

Determines how to group costs in the Dashboard.

Available options:
cumulative,
day,
week,
month
date_interval
enum<string> | null
required

Determines the date range for Reports in the Dashboard. Guaranteed to be set to 'custom' if 'start_date' and 'end_date' are set.

Available options:
this_month,
last_7_days,
last_30_days,
last_month,
last_3_months,
last_6_months,
custom,
last_12_months,
last_24_months,
last_36_months,
next_month,
next_3_months,
next_6_months,
next_12_months,
year_to_date,
last_3_days,
last_14_days
created_at
string
required

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

Example:

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

updated_at
string
required

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

Example:

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

workspace_token
string
required

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

Example:

"wrkspc_abcd1234567890"

start_date
string | null

The start date for the date range for Reports in the Dashboard. ISO 8601 Formatted. Overwrites 'date_interval' if set.

Example:

"2023-08-04"

end_date
string | null

The end date for the date range for Reports in the Dashboard. ISO 8601 Formatted. Overwrites 'date_interval' if set.

Example:

"2023-09-04"