Skip to main content
POST
/
costs
/
data_exports
Generate cost data export
curl --request POST \
  --url https://api.vantage.sh/v2/costs/data_exports \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "cost_report_token": "<string>",
  "filter": "<string>",
  "workspace_token": "<string>",
  "start_date": "<string>",
  "end_date": "<string>",
  "date_bin": "day",
  "schema": "vntg",
  "settings[include_credits]": false,
  "settings[include_refunds]": false,
  "settings[include_discounts]": true,
  "settings[include_tax]": true,
  "settings[amortize]": true,
  "settings[unallocated]": false,
  "settings[aggregate_by]": "cost",
  "settings[show_previous_period]": true
}
'
This response has no body data.

Authorizations

Authorization
string
header
required

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

Query Parameters

groupings
string[]

Group the results by specific field(s). Defaults to provider, service, account_id. 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

Body

application/json
cost_report_token
string

The CostReport token.

filter
string

The VQL filter to apply to the costs. If this is supplied you do not need cost_report_token.

workspace_token
string

The token of the Workspace to query costs from. Ignored if 'cost_report_token' is set. Required if the API token is associated with multiple Workspaces.

start_date
string

First date you would like to filter costs from. ISO 8601 formatted.

end_date
string

Last date you would like to filter costs to. ISO 8601 formatted.

date_bin
enum<string>

The date bin of the costs. Defaults to the report's default or day.

Available options:
day,
week,
month,
quarter
schema
enum<string>
default:vntg

The schema of the data export.

Available options:
vntg,
focus
settings[include_credits]
boolean
default:false

Results will include credits.

settings[include_refunds]
boolean
default:false

Results will include refunds.

settings[include_discounts]
boolean
default:true

Results will include discounts.

settings[include_tax]
boolean
default:true

Results will include tax.

settings[amortize]
boolean
default:true

Results will amortize.

settings[unallocated]
boolean
default:false

Results will show unallocated costs.

settings[aggregate_by]
string
default:cost

Results will aggregate by cost or usage.

settings[show_previous_period]
boolean
default:true

Results will show previous period costs or usage comparison.

Response