Create budget
curl --request POST \
--url https://api.vantage.sh/v2/budgets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"workspace_token": "<string>",
"cost_report_token": "<string>",
"unit": "<string>",
"child_budget_tokens": [
"<string>"
],
"periods": [
{
"start_at": "2023-12-25",
"amount": 123,
"end_at": "2023-12-25"
}
]
}
'import requests
url = "https://api.vantage.sh/v2/budgets"
payload = {
"name": "<string>",
"workspace_token": "<string>",
"cost_report_token": "<string>",
"unit": "<string>",
"child_budget_tokens": ["<string>"],
"periods": [
{
"start_at": "2023-12-25",
"amount": 123,
"end_at": "2023-12-25"
}
]
}
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({
name: '<string>',
workspace_token: '<string>',
cost_report_token: '<string>',
unit: '<string>',
child_budget_tokens: ['<string>'],
periods: [{start_at: '2023-12-25', amount: 123, end_at: '2023-12-25'}]
})
};
fetch('https://api.vantage.sh/v2/budgets', 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",
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([
'name' => '<string>',
'workspace_token' => '<string>',
'cost_report_token' => '<string>',
'unit' => '<string>',
'child_budget_tokens' => [
'<string>'
],
'periods' => [
[
'start_at' => '2023-12-25',
'amount' => 123,
'end_at' => '2023-12-25'
]
]
]),
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/budgets"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"workspace_token\": \"<string>\",\n \"cost_report_token\": \"<string>\",\n \"unit\": \"<string>\",\n \"child_budget_tokens\": [\n \"<string>\"\n ],\n \"periods\": [\n {\n \"start_at\": \"2023-12-25\",\n \"amount\": 123,\n \"end_at\": \"2023-12-25\"\n }\n ]\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/budgets")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"workspace_token\": \"<string>\",\n \"cost_report_token\": \"<string>\",\n \"unit\": \"<string>\",\n \"child_budget_tokens\": [\n \"<string>\"\n ],\n \"periods\": [\n {\n \"start_at\": \"2023-12-25\",\n \"amount\": 123,\n \"end_at\": \"2023-12-25\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vantage.sh/v2/budgets")
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 \"name\": \"<string>\",\n \"workspace_token\": \"<string>\",\n \"cost_report_token\": \"<string>\",\n \"unit\": \"<string>\",\n \"child_budget_tokens\": [\n \"<string>\"\n ],\n \"periods\": [\n {\n \"start_at\": \"2023-12-25\",\n \"amount\": 123,\n \"end_at\": \"2023-12-25\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"token": "bdgt_ea1eaec89d553e34",
"name": "New Budget Name",
"workspace_token": "wrkspc_b83e21368ee5fd9d",
"user_token": null,
"created_by_token": "team_aea2488160e90528",
"cost_report_token": null,
"created_at": "2024-07-11T20:22:52Z",
"budget_alert_tokens": [],
"child_budget_tokens": [],
"period_cadence": {
"starts_at": null,
"interval_count": 1,
"interval_unit": "month"
},
"periods": [
{
"start_at": "2024-01-01",
"end_at": "2024-01-31",
"amount": "100.0"
},
{
"start_at": "2024-02-01",
"end_at": "2024-02-29",
"amount": "200.0"
},
{
"start_at": "2024-03-01",
"end_at": "2024-04-30",
"amount": "300.0"
}
],
"performance": [
{
"date": "April, 2024",
"actual": "0%",
"amount": "300.0"
},
{
"date": "March, 2024",
"actual": "0%",
"amount": "300.0"
},
{
"date": "February, 2024",
"actual": "0%",
"amount": "200.0"
},
{
"date": "January, 2024",
"actual": "0%",
"amount": "100.0"
}
]
}{
"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>"
}
}Budgets
Create budget
Create a Budget.
POST
/
budgets
Create budget
curl --request POST \
--url https://api.vantage.sh/v2/budgets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"workspace_token": "<string>",
"cost_report_token": "<string>",
"unit": "<string>",
"child_budget_tokens": [
"<string>"
],
"periods": [
{
"start_at": "2023-12-25",
"amount": 123,
"end_at": "2023-12-25"
}
]
}
'import requests
url = "https://api.vantage.sh/v2/budgets"
payload = {
"name": "<string>",
"workspace_token": "<string>",
"cost_report_token": "<string>",
"unit": "<string>",
"child_budget_tokens": ["<string>"],
"periods": [
{
"start_at": "2023-12-25",
"amount": 123,
"end_at": "2023-12-25"
}
]
}
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({
name: '<string>',
workspace_token: '<string>',
cost_report_token: '<string>',
unit: '<string>',
child_budget_tokens: ['<string>'],
periods: [{start_at: '2023-12-25', amount: 123, end_at: '2023-12-25'}]
})
};
fetch('https://api.vantage.sh/v2/budgets', 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",
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([
'name' => '<string>',
'workspace_token' => '<string>',
'cost_report_token' => '<string>',
'unit' => '<string>',
'child_budget_tokens' => [
'<string>'
],
'periods' => [
[
'start_at' => '2023-12-25',
'amount' => 123,
'end_at' => '2023-12-25'
]
]
]),
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/budgets"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"workspace_token\": \"<string>\",\n \"cost_report_token\": \"<string>\",\n \"unit\": \"<string>\",\n \"child_budget_tokens\": [\n \"<string>\"\n ],\n \"periods\": [\n {\n \"start_at\": \"2023-12-25\",\n \"amount\": 123,\n \"end_at\": \"2023-12-25\"\n }\n ]\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/budgets")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"workspace_token\": \"<string>\",\n \"cost_report_token\": \"<string>\",\n \"unit\": \"<string>\",\n \"child_budget_tokens\": [\n \"<string>\"\n ],\n \"periods\": [\n {\n \"start_at\": \"2023-12-25\",\n \"amount\": 123,\n \"end_at\": \"2023-12-25\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vantage.sh/v2/budgets")
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 \"name\": \"<string>\",\n \"workspace_token\": \"<string>\",\n \"cost_report_token\": \"<string>\",\n \"unit\": \"<string>\",\n \"child_budget_tokens\": [\n \"<string>\"\n ],\n \"periods\": [\n {\n \"start_at\": \"2023-12-25\",\n \"amount\": 123,\n \"end_at\": \"2023-12-25\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"token": "bdgt_ea1eaec89d553e34",
"name": "New Budget Name",
"workspace_token": "wrkspc_b83e21368ee5fd9d",
"user_token": null,
"created_by_token": "team_aea2488160e90528",
"cost_report_token": null,
"created_at": "2024-07-11T20:22:52Z",
"budget_alert_tokens": [],
"child_budget_tokens": [],
"period_cadence": {
"starts_at": null,
"interval_count": 1,
"interval_unit": "month"
},
"periods": [
{
"start_at": "2024-01-01",
"end_at": "2024-01-31",
"amount": "100.0"
},
{
"start_at": "2024-02-01",
"end_at": "2024-02-29",
"amount": "200.0"
},
{
"start_at": "2024-03-01",
"end_at": "2024-04-30",
"amount": "300.0"
}
],
"performance": [
{
"date": "April, 2024",
"actual": "0%",
"amount": "300.0"
},
{
"date": "March, 2024",
"actual": "0%",
"amount": "300.0"
},
{
"date": "February, 2024",
"actual": "0%",
"amount": "200.0"
},
{
"date": "January, 2024",
"actual": "0%",
"amount": "100.0"
}
]
}{
"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
Body
application/json
Create a Budget.
Response
Budget model