Skip to main content
GET
/
budgets
/
{budget_token}
Get budget by token
curl --request GET \
  --url https://api.vantage.sh/v2/budgets/{budget_token} \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.vantage.sh/v2/budgets/{budget_token}"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://api.vantage.sh/v2/budgets/{budget_token}', 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/budgets/{budget_token}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://api.vantage.sh/v2/budgets/{budget_token}"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("Authorization", "Bearer <token>")

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

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

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.vantage.sh/v2/budgets/{budget_token}")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.vantage.sh/v2/budgets/{budget_token}")

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "token": "bdgt_24068dbacaaad7fb",
  "name": "Total",
  "workspace_token": "wrkspc_545a937d68541448",
  "user_token": "usr_470d15b368844366",
  "created_by_token": "usr_470d15b368844366",
  "cost_report_token": "rprt_9ee9f29893956951",
  "created_at": "2024-07-11T20:22:41Z",
  "budget_alert_tokens": [],
  "periods": [
    {
      "start_at": "2024-07-01",
      "end_at": "2024-09-30",
      "amount": "10000.0"
    }
  ],
  "performance": [
    {
      "date": "July, 2024",
      "actual": "-100%",
      "amount": "10000.0"
    }
  ]
}
{
"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

budget_token
string
required

Query Parameters

include_performance
boolean

Include performance data.

Response

Budget model

token
string
required
name
string | null
required

The name of the Budget.

Example:

"Acme123 Budget"

workspace_token
string
required

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

created_at
string
required

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

Example:

"2024-03-19T00:00:00Z"

budget_alert_tokens
string[]
required

The tokens of the BudgetAlerts associated with the Budget.

child_budget_tokens
string[]
required

The tokens of the child Budgets associated with the hierarchical Budget.

periods
object[]
required

The budget periods associated with the Budget.

user_token
string | null

The token for the User who created this Budget.

created_by_token
string | null

The token of the Creator of the Budget.

cost_report_token
string | null

The token of the Report associated with the Budget.

performance
object[]

The historical performance of the Budget.