Skip to main content
PUT
/
cost_reports
/
{cost_report_token}
Update cost report
curl --request PUT \
  --url https://api.vantage.sh/v2/cost_reports/{cost_report_token} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "title": "<string>",
  "groupings": "<string>",
  "filter": "<string>",
  "saved_filter_tokens": [
    "<string>"
  ],
  "business_metric_tokens_with_metadata": [
    {
      "business_metric_token": "<string>",
      "unit_scale": "per_unit",
      "label_filter": [
        "<string>"
      ]
    }
  ],
  "folder_token": "<string>",
  "settings": {
    "include_credits": true,
    "include_refunds": true,
    "include_discounts": true,
    "include_tax": true,
    "amortize": true,
    "unallocated": true,
    "aggregate_by": "<string>",
    "show_previous_period": true
  },
  "chart_settings": {
    "x_axis_dimension": [
      "<string>"
    ],
    "y_axis_dimension": "<string>"
  },
  "previous_period_start_date": "<string>",
  "previous_period_end_date": "<string>",
  "start_date": "<string>",
  "end_date": "<string>",
  "date_interval": "this_month",
  "chart_type": "line",
  "date_bin": "cumulative"
}
'
{
  "token": "rprt_c02b21cb3750e2c8",
  "title": "Updated Cost Report",
  "folder_token": "fldr_5671a9c9785c0aff",
  "saved_filter_tokens": [
    "svd_fltr_fe456f29a8e9a706"
  ],
  "business_metric_tokens_with_metadata": [
    {
      "business_metric_token": "bsnss_mtrc_352795a0c2b0be50",
      "unit_scale": "per_thousand",
      "label_filter": [
        "CBGB",
        "Roxy",
        "Studio 54",
        ""
      ]
    },
    {
      "business_metric_token": "bsnss_mtrc_13ce0c4cb90eb641",
      "unit_scale": "per_million"
    }
  ],
  "filter": "costs.provider = 'azure'",
  "groupings": "account_id,service",
  "settings": {
    "include_credits": false,
    "include_refunds": false,
    "include_discounts": true,
    "include_tax": true,
    "amortize": true,
    "unallocated": false,
    "aggregate_by": "cost",
    "show_previous_period": true
  },
  "created_at": "2024-07-03T00:00:00Z",
  "workspace_token": "wrkspc_b727d292ad47b28b",
  "previous_period_start_date": null,
  "previous_period_end_date": null,
  "start_date": "2024-07-01",
  "end_date": "2024-07-31",
  "date_interval": "this_month",
  "chart_type": "pie",
  "date_bin": "week",
  "chart_settings": {
    "y_axis_dimension": "cost",
    "x_axis_dimension": [
      "date"
    ]
  }
}

Authorizations

Authorization
string
header
required

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

Path Parameters

cost_report_token
string
required

Body

application/json

Update a CostReport.

title
string

The title of the CostReport.

groupings
string

Grouping values for aggregating costs on the report. Valid groupings: account_id, billing_account_id, charge_type, cost_category, cost_subcategory, provider, region, resource_id, service, tagged, tag:<tag_value>. If providing multiple groupings, join as comma separated values: groupings=provider,service,region

filter
string

The filter query language to apply to the CostReport. Additional documentation available at https://docs.vantage.sh/vql.

saved_filter_tokens
string[]

The tokens of the SavedFilters to apply to the CostReport.

business_metric_tokens_with_metadata
object[]

The tokens for any BusinessMetrics to attach to the CostReport, and the unit scale.

folder_token
string

The token of the Folder to add the CostReport to. Determines the Workspace the report is assigned to.

settings
object

Report settings.

chart_settings
object

Report chart settings.

previous_period_start_date
string

The previous period start date of the CostReport. ISO 8601 Formatted.

previous_period_end_date
string

The previous period end date of the CostReport. ISO 8601 Formatted.

start_date
string

The start date of the CostReport. ISO 8601 Formatted. Incompatible with 'date_interval' parameter.

end_date
string

The end date of the CostReport. ISO 8601 Formatted. Incompatible with 'date_interval' parameter.

date_interval
enum<string>

The date interval of the CostReport. Incompatible with 'start_date' and 'end_date' parameters. Defaults to 'this_month' if start_date and end_date are not provided.

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
chart_type
enum<string>
default:line

The chart type of the CostReport.

Available options:
area,
line,
pie,
bar,
multi_bar
date_bin
enum<string>
default:cumulative

The date bin of the CostReport.

Available options:
cumulative,
day,
week,
month,
quarter

Response

CostReport model

token
string
required
title
string
required

The title of the CostReport.

Example:

"Production Environment"

business_metric_tokens_with_metadata
object[]
required

The tokens for the BusinessMetrics assigned to the CostReport, the unit scale, and label filter.

filter
string | null
required

The filter applied to the CostReport. Additional documentation available at https://docs.vantage.sh/vql.

created_at
string
required

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

Example:

"2021-07-09T00:00:00Z"

workspace_token
string
required

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

date_interval
string
required

The date interval of the CostReport.

chart_type
string
required

The chart type of the CostReport.

date_bin
string
required

The date bin of the CostReport.

chart_settings
object
required
folder_token
string

The token for the Folder the CostReport is a part of.

saved_filter_tokens
string[]

The tokens for the SavedFilters assigned to the CostReport.

groupings
string

The grouping aggregations applied to the filtered data.

Example:

"provider, service"

settings
object

Report settings.

previous_period_start_date
string

The previous period start date of the CostReport. ISO 8601 Formatted.

Example:

"2024-06-01"

previous_period_end_date
string

The previous period end date of the CostReport. ISO 8601 Formatted.

Example:

"2024-06-15"

start_date
string

The start date of the CostReports. ISO 8601 Formatted. Overwrites 'date_interval' if set.

Example:

"2024-07-01"

end_date
string

The end date of the CostReports. ISO 8601 Formatted. Overwrites 'date_interval' if set.

Example:

"2024-07-15"