Portfolios
Get portfolio holdings
Retrieve portfolio holdings (ISIN, asset, quantity) and target allocation (percentages per asset)
GET
/
portfolios
/
{id}
Get portfolio holdings
curl --request GET \
--url https://{host}/portfolios/{id} \
--header 'Authorization: Bearer <token>' \
--header 'x-user-id: <x-user-id>'import requests
url = "https://{host}/portfolios/{id}"
headers = {
"x-user-id": "<x-user-id>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'x-user-id': '<x-user-id>', Authorization: 'Bearer <token>'}
};
fetch('https://{host}/portfolios/{id}', 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://{host}/portfolios/{id}",
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>",
"x-user-id: <x-user-id>"
],
]);
$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://{host}/portfolios/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-user-id", "<x-user-id>")
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://{host}/portfolios/{id}")
.header("x-user-id", "<x-user-id>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/portfolios/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-user-id"] = '<x-user-id>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "64f0c51e7fb3fc001234abcd",
"currency": "EUR",
"holdings": [
{
"isin": "US0378331005",
"assetCommonId": "equities_apple",
"quantity": 12.5
},
{
"isin": "EU0009658145",
"assetCommonId": "etf_vanguard_snp500",
"quantity": 8
}
],
"targetAllocation": [
{
"assetCommonId": "equities_apple",
"percentage": 40
},
{
"assetCommonId": "etf_vanguard_snp500",
"percentage": 60
}
],
"createdAt": "2024-03-01T10:00:00.000Z",
"updatedAt": "2024-07-10T12:00:00.000Z"
}{
"status": 401,
"error": {
"message": "User not found"
},
"responseId": "56962f31-e1bc-4a32-8b47-623f793aa2f8"
}{
"status": 403,
"error": {
"message": "Portfolio does not belong to user"
},
"responseId": "1c8b2106-5f8f-4f71-8f06-23a53205b384"
}{
"status": 404,
"error": {
"message": "Portfolio not found"
},
"responseId": "77354fbd-2d0a-4f5a-8e15-a64c2b7ac3b5"
}Authorizations
Auth0-issued access token that includes the scopes listed for the route.
Headers
MongoDB identifier of the user whose portfolio is being queried.
Pattern:
^[a-f0-9]{24}$Path Parameters
Portfolio identifier belonging to the authenticated user.
Pattern:
^[a-f0-9]{24}$Response
Portfolio holdings with asset details.
Portfolio unique identifier.
ISO currency code for the portfolio (e.g. EUR, GBP, USD).
Array of holdings with asset details and quantities.
Show child attributes
Show child attributes
Target allocation by asset. Weights are persisted with the portfolio. May be an empty array when unset.
Show child attributes
Show child attributes
Portfolio creation timestamp.
Last update timestamp.
⌘I
Get portfolio holdings
curl --request GET \
--url https://{host}/portfolios/{id} \
--header 'Authorization: Bearer <token>' \
--header 'x-user-id: <x-user-id>'import requests
url = "https://{host}/portfolios/{id}"
headers = {
"x-user-id": "<x-user-id>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'x-user-id': '<x-user-id>', Authorization: 'Bearer <token>'}
};
fetch('https://{host}/portfolios/{id}', 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://{host}/portfolios/{id}",
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>",
"x-user-id: <x-user-id>"
],
]);
$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://{host}/portfolios/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-user-id", "<x-user-id>")
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://{host}/portfolios/{id}")
.header("x-user-id", "<x-user-id>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/portfolios/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-user-id"] = '<x-user-id>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "64f0c51e7fb3fc001234abcd",
"currency": "EUR",
"holdings": [
{
"isin": "US0378331005",
"assetCommonId": "equities_apple",
"quantity": 12.5
},
{
"isin": "EU0009658145",
"assetCommonId": "etf_vanguard_snp500",
"quantity": 8
}
],
"targetAllocation": [
{
"assetCommonId": "equities_apple",
"percentage": 40
},
{
"assetCommonId": "etf_vanguard_snp500",
"percentage": 60
}
],
"createdAt": "2024-03-01T10:00:00.000Z",
"updatedAt": "2024-07-10T12:00:00.000Z"
}{
"status": 401,
"error": {
"message": "User not found"
},
"responseId": "56962f31-e1bc-4a32-8b47-623f793aa2f8"
}{
"status": 403,
"error": {
"message": "Portfolio does not belong to user"
},
"responseId": "1c8b2106-5f8f-4f71-8f06-23a53205b384"
}{
"status": 404,
"error": {
"message": "Portfolio not found"
},
"responseId": "77354fbd-2d0a-4f5a-8e15-a64c2b7ac3b5"
}