Rebuild the value history
curl --request POST \
--url https://api.synci.io/api/v1/finance/accounts/{accountId}/investment/rebuild-history \
--header 'Authorization: Bearer <token>'const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.synci.io/api/v1/finance/accounts/{accountId}/investment/rebuild-history', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.synci.io/api/v1/finance/accounts/{accountId}/investment/rebuild-history"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.synci.io/api/v1/finance/accounts/{accountId}/investment/rebuild-history",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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.synci.io/api/v1/finance/accounts/{accountId}/investment/rebuild-history"
req, _ := http.NewRequest("POST", 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))
}{
"message": "History rebuild queued.",
"data": {
"base_currency": "<string>",
"cash_tracking_enabled": true,
"paying_financial_account_id": "<string>",
"positions_count": 1,
"cash_anchor": {
"balance": 123,
"date": "<string>"
},
"last_priced_at": "2023-11-07T05:31:56Z",
"last_valued_on": "<string>",
"history_rebuild": {
"status": "QUEUED",
"from": "<string>",
"failed_at": "2023-11-07T05:31:56Z"
},
"stale_positions": [
"<string>"
]
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}Rebuild the value history
Queues a rebuild of the account’s daily values from the day a failed rebuild started (or the account’s
start), for a history_rebuild that reads FAILED: the price history of every security the account holds is
fetched again where the catalogue has gaps, then the days are re-derived. Returns the investment object with
the rebuild QUEUED.
POST
/
finance
/
accounts
/
{accountId}
/
investment
/
rebuild-history
Rebuild the value history
curl --request POST \
--url https://api.synci.io/api/v1/finance/accounts/{accountId}/investment/rebuild-history \
--header 'Authorization: Bearer <token>'const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.synci.io/api/v1/finance/accounts/{accountId}/investment/rebuild-history', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.synci.io/api/v1/finance/accounts/{accountId}/investment/rebuild-history"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.synci.io/api/v1/finance/accounts/{accountId}/investment/rebuild-history",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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.synci.io/api/v1/finance/accounts/{accountId}/investment/rebuild-history"
req, _ := http.NewRequest("POST", 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))
}{
"message": "History rebuild queued.",
"data": {
"base_currency": "<string>",
"cash_tracking_enabled": true,
"paying_financial_account_id": "<string>",
"positions_count": 1,
"cash_anchor": {
"balance": 123,
"date": "<string>"
},
"last_priced_at": "2023-11-07T05:31:56Z",
"last_valued_on": "<string>",
"history_rebuild": {
"status": "QUEUED",
"from": "<string>",
"failed_at": "2023-11-07T05:31:56Z"
},
"stale_positions": [
"<string>"
]
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}Authorizations
oauth2http
The access token received from the authorization server in the OAuth 2.0 flow.
Path Parameters
The financial account ID