Skip to main content
PUT
/
business_metrics
/
{business_metric_token}
/
values.csv
Update business metric values from CSV
curl --request PUT \
  --url https://api.vantage.sh/v2/business_metrics/{business_metric_token}/values.csv \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data 'csv=<string>' \
  --data forecasted=false
import requests

url = "https://api.vantage.sh/v2/business_metrics/{business_metric_token}/values.csv"

payload = {
"csv": "<string>",
"forecasted": "false"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/x-www-form-urlencoded"
}

response = requests.put(url, data=payload, headers=headers)

print(response.text)
const options = {
method: 'PUT',
headers: {
Authorization: 'Bearer <token>',
'Content-Type': 'application/x-www-form-urlencoded'
},
body: new URLSearchParams({csv: '<string>', forecasted: 'false'})
};

fetch('https://api.vantage.sh/v2/business_metrics/{business_metric_token}/values.csv', 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/business_metrics/{business_metric_token}/values.csv",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => "csv=%3Cstring%3E&forecasted=false",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/x-www-form-urlencoded"
],
]);

$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/business_metrics/{business_metric_token}/values.csv"

payload := strings.NewReader("csv=%3Cstring%3E&forecasted=false")

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

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.put("https://api.vantage.sh/v2/business_metrics/{business_metric_token}/values.csv")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("csv=%3Cstring%3E&forecasted=false")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.vantage.sh/v2/business_metrics/{business_metric_token}/values.csv")

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

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/x-www-form-urlencoded'
request.body = "csv=%3Cstring%3E&forecasted=false"

response = http.request(request)
puts response.read_body
{
  "token": "bsnss_mtrc_6bb1021d8651923a",
  "title": "Overhold",
  "created_by_token": "usr_ad24de73bffb7791",
  "cost_report_tokens_with_metadata": [],
  "import_type": "csv",
  "integration_token": ""
}
{
"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>"
}
}
{
"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.

Path Parameters

business_metric_token
string
required

Body

csv
file
required

CSV file containing BusinessMetric dates and amounts

forecasted
boolean
default:false

When true, imports values as forecasted metrics instead of historical metrics.

Response

BusinessMetric model

token
string
required

The token of the BusinessMetric.

Example:

"bsnss_mtrc_1234"

title
string
required

The title of the BusinessMetric.

Example:

"Total Revenue"

cost_report_tokens_with_metadata
object[]
required

The tokens for any CostReports that use the BusinessMetric, the unit scale, and label filter.

import_type
enum<string> | null
required

The type of import for the BusinessMetric.

Available options:
datadog_metrics,
cloudwatch,
snowflake_metrics,
metronome_metrics,
csv
Example:

"datadog_metrics"

integration_token
string | null
required

The Integration token used to import the BusinessMetric.

created_by_token
string | null

The token of the Creator of the BusinessMetric.

Example:

"usr_1234"

cloudwatch_fields
object
datadog_metric_fields
object
snowflake_metric_fields
object