Skip to main content
PUT
/
workspaces
/
{workspace_token}
Update workspace
curl --request PUT \
  --url https://api.vantage.sh/v2/workspaces/{workspace_token} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "enable_currency_conversion": true,
  "exchange_rate_date": "daily_rate"
}
'
import requests

url = "https://api.vantage.sh/v2/workspaces/{workspace_token}"

payload = {
"name": "<string>",
"enable_currency_conversion": True,
"exchange_rate_date": "daily_rate"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

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

print(response.text)
const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
enable_currency_conversion: true,
exchange_rate_date: 'daily_rate'
})
};

fetch('https://api.vantage.sh/v2/workspaces/{workspace_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/workspaces/{workspace_token}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'enable_currency_conversion' => true,
'exchange_rate_date' => 'daily_rate'
]),
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/workspaces/{workspace_token}"

payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"enable_currency_conversion\": true,\n \"exchange_rate_date\": \"daily_rate\"\n}")

req, _ := http.NewRequest("PUT", 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.put("https://api.vantage.sh/v2/workspaces/{workspace_token}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"enable_currency_conversion\": true,\n \"exchange_rate_date\": \"daily_rate\"\n}")
.asString();
require 'uri'
require 'net/http'

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

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/json'
request.body = "{\n \"name\": \"<string>\",\n \"enable_currency_conversion\": true,\n \"exchange_rate_date\": \"daily_rate\"\n}"

response = http.request(request)
puts response.read_body
{
  "token": "wrkspc_a44f83d3e85be91d",
  "name": "My Workspace (Edited)",
  "created_at": "2024-10-01T01:00:56Z",
  "enable_currency_conversion": true,
  "currency": "EUR",
  "exchange_rate_date": "daily_rate"
}
{
"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

workspace_token
string
required

Body

application/json

Update a workspace

name
string

Name of the workspace.

enable_currency_conversion
boolean
default:true

Enable currency conversion for the workspace.

currency
enum<string>

Currency code for the workspace.

Available options:
AED,
AFN,
ALL,
AMD,
ANG,
AOA,
ARS,
AUD,
AWG,
AZN,
BAM,
BBD,
BDT,
BGN,
BHD,
BIF,
BMD,
BND,
BOB,
BRL,
BSD,
BTC,
BTN,
BWP,
BYN,
BYR,
BZD,
CAD,
CDF,
CHF,
CLF,
CLP,
CNY,
COP,
CRC,
CUC,
CUP,
CVE,
CZK,
DJF,
DKK,
DOP,
DZD,
EGP,
ERN,
ETB,
EUR,
FJD,
FKP,
GBP,
GEL,
GGP,
GHS,
GIP,
GMD,
GNF,
GTQ,
GYD,
HKD,
HNL,
HRK,
HTG,
HUF,
IDR,
ILS,
IMP,
INR,
IQD,
IRR,
ISK,
JEP,
JMD,
JOD,
JPY,
KES,
KGS,
KHR,
KMF,
KPW,
KRW,
KWD,
KYD,
KZT,
LAK,
LBP,
LKR,
LRD,
LSL,
LTL,
LVL,
LYD,
MAD,
MDL,
MGA,
MKD,
MMK,
MNT,
MOP,
MRO,
MUR,
MVR,
MWK,
MXN,
MYR,
MZN,
NAD,
NGN,
NIO,
NOK,
NPR,
NZD,
OMR,
PAB,
PEN,
PGK,
PHP,
PKR,
PLN,
PYG,
QAR,
RON,
RSD,
RUB,
RWF,
SAR,
SBD,
SCR,
SDG,
SEK,
SGD,
SHP,
SLL,
SOS,
SRD,
SSP,
STD,
STN,
SVC,
SYP,
SZL,
THB,
TJS,
TMT,
TND,
TOP,
TRY,
TTD,
TWD,
TZS,
UAH,
UGX,
USD,
UYU,
UZS,
VEF,
VND,
VUV,
WST,
XAF,
XCD,
XDR,
XOF,
XPF,
YER,
ZAR,
ZMW,
ZWL
exchange_rate_date
enum<string>
default:daily_rate

The date to use for currency conversion.

Available options:
daily_rate,
end_of_billing_period_rate

Response

Workspace model

token
string
required
name
string
required

The name of the Workspace.

Example:

"Acme Corp."

created_at
string
required

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

Example:

"2023-08-04T00:00:00Z"

enable_currency_conversion
boolean
required

Whether or not currency conversion is enabled for the Workspace.

currency
string
required

The currency code for the Workspace that will be used for currency conversion.

Example:

"USD"

exchange_rate_date
string
required

The exchange rate date that will be used to convert currency for your cost data.