curl --request POST \
--url https://allocait.app/api/v1/preferences \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"active_portfolio_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"active_scenario_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"active_watchlist_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"active_chart_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"active_playbook_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"active_monitor_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"clear_active_portfolio_id": true,
"clear_active_scenario_id": true,
"clear_active_watchlist_id": true,
"clear_active_chart_id": true,
"clear_active_playbook_id": true,
"clear_active_monitor_id": true
}
'import requests
url = "https://allocait.app/api/v1/preferences"
payload = {
"active_portfolio_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"active_scenario_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"active_watchlist_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"active_chart_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"active_playbook_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"active_monitor_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"clear_active_portfolio_id": True,
"clear_active_scenario_id": True,
"clear_active_watchlist_id": True,
"clear_active_chart_id": True,
"clear_active_playbook_id": True,
"clear_active_monitor_id": True
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
active_portfolio_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
active_scenario_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
active_watchlist_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
active_chart_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
active_playbook_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
active_monitor_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
clear_active_portfolio_id: true,
clear_active_scenario_id: true,
clear_active_watchlist_id: true,
clear_active_chart_id: true,
clear_active_playbook_id: true,
clear_active_monitor_id: true
})
};
fetch('https://allocait.app/api/v1/preferences', 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://allocait.app/api/v1/preferences",
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([
'active_portfolio_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'active_scenario_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'active_watchlist_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'active_chart_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'active_playbook_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'active_monitor_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'clear_active_portfolio_id' => true,
'clear_active_scenario_id' => true,
'clear_active_watchlist_id' => true,
'clear_active_chart_id' => true,
'clear_active_playbook_id' => true,
'clear_active_monitor_id' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://allocait.app/api/v1/preferences"
payload := strings.NewReader("{\n \"active_portfolio_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"active_scenario_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"active_watchlist_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"active_chart_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"active_playbook_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"active_monitor_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"clear_active_portfolio_id\": true,\n \"clear_active_scenario_id\": true,\n \"clear_active_watchlist_id\": true,\n \"clear_active_chart_id\": true,\n \"clear_active_playbook_id\": true,\n \"clear_active_monitor_id\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://allocait.app/api/v1/preferences")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"active_portfolio_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"active_scenario_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"active_watchlist_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"active_chart_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"active_playbook_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"active_monitor_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"clear_active_portfolio_id\": true,\n \"clear_active_scenario_id\": true,\n \"clear_active_watchlist_id\": true,\n \"clear_active_chart_id\": true,\n \"clear_active_playbook_id\": true,\n \"clear_active_monitor_id\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://allocait.app/api/v1/preferences")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"active_portfolio_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"active_scenario_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"active_watchlist_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"active_chart_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"active_playbook_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"active_monitor_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"clear_active_portfolio_id\": true,\n \"clear_active_scenario_id\": true,\n \"clear_active_watchlist_id\": true,\n \"clear_active_chart_id\": true,\n \"clear_active_playbook_id\": true,\n \"clear_active_monitor_id\": true\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"preferences": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"active_portfolio_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"active_scenario_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"active_watchlist_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"active_chart_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"active_playbook_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"active_monitor_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"theme": "light",
"onboarding_pinned": true,
"onboarding_completed_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"error": "Portfolio not found or access denied",
"error_code": "NOT_FOUND"
}{
"error": "Portfolio not found or access denied",
"error_code": "NOT_FOUND"
}{
"error": "Portfolio not found or access denied",
"error_code": "NOT_FOUND"
}{
"error": "Portfolio not found or access denied",
"error_code": "NOT_FOUND"
}{
"error": "Portfolio not found or access denied",
"error_code": "NOT_FOUND"
}{
"error": "Internal error",
"error_code": "INTERNAL_ERROR",
"request_id": "5b1e7c52-3f4a-4d0e-9a55-2d5cbe6f0a11"
}Set which portfolio/watchlist/chart/playbook/monitor the app shows, or the theme
active_scenario_id here is a display fallback only. The app and every
agent read the portfolio’s own active scenario first, so to switch the
scenario compliance is judged against, use PATCH /portfolios/{id}
with active_scenario_id.
Every field is optional and independently a no-op when omitted (partial
update). Pass only the field(s) you want to change. Each
active_*_id is ownership-checked against its own table. Deleting
the referenced row clears the matching pointer automatically; to
clear one explicitly without deleting anything, pass its
clear_active_*_id flag as true; it wins over the paired
active_*_id value when both are sent in the same call.
Requires the API key to have the write permission.
curl --request POST \
--url https://allocait.app/api/v1/preferences \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"active_portfolio_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"active_scenario_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"active_watchlist_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"active_chart_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"active_playbook_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"active_monitor_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"clear_active_portfolio_id": true,
"clear_active_scenario_id": true,
"clear_active_watchlist_id": true,
"clear_active_chart_id": true,
"clear_active_playbook_id": true,
"clear_active_monitor_id": true
}
'import requests
url = "https://allocait.app/api/v1/preferences"
payload = {
"active_portfolio_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"active_scenario_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"active_watchlist_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"active_chart_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"active_playbook_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"active_monitor_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"clear_active_portfolio_id": True,
"clear_active_scenario_id": True,
"clear_active_watchlist_id": True,
"clear_active_chart_id": True,
"clear_active_playbook_id": True,
"clear_active_monitor_id": True
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
active_portfolio_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
active_scenario_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
active_watchlist_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
active_chart_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
active_playbook_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
active_monitor_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
clear_active_portfolio_id: true,
clear_active_scenario_id: true,
clear_active_watchlist_id: true,
clear_active_chart_id: true,
clear_active_playbook_id: true,
clear_active_monitor_id: true
})
};
fetch('https://allocait.app/api/v1/preferences', 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://allocait.app/api/v1/preferences",
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([
'active_portfolio_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'active_scenario_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'active_watchlist_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'active_chart_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'active_playbook_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'active_monitor_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'clear_active_portfolio_id' => true,
'clear_active_scenario_id' => true,
'clear_active_watchlist_id' => true,
'clear_active_chart_id' => true,
'clear_active_playbook_id' => true,
'clear_active_monitor_id' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://allocait.app/api/v1/preferences"
payload := strings.NewReader("{\n \"active_portfolio_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"active_scenario_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"active_watchlist_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"active_chart_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"active_playbook_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"active_monitor_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"clear_active_portfolio_id\": true,\n \"clear_active_scenario_id\": true,\n \"clear_active_watchlist_id\": true,\n \"clear_active_chart_id\": true,\n \"clear_active_playbook_id\": true,\n \"clear_active_monitor_id\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://allocait.app/api/v1/preferences")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"active_portfolio_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"active_scenario_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"active_watchlist_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"active_chart_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"active_playbook_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"active_monitor_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"clear_active_portfolio_id\": true,\n \"clear_active_scenario_id\": true,\n \"clear_active_watchlist_id\": true,\n \"clear_active_chart_id\": true,\n \"clear_active_playbook_id\": true,\n \"clear_active_monitor_id\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://allocait.app/api/v1/preferences")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"active_portfolio_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"active_scenario_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"active_watchlist_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"active_chart_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"active_playbook_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"active_monitor_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"clear_active_portfolio_id\": true,\n \"clear_active_scenario_id\": true,\n \"clear_active_watchlist_id\": true,\n \"clear_active_chart_id\": true,\n \"clear_active_playbook_id\": true,\n \"clear_active_monitor_id\": true\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"preferences": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"active_portfolio_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"active_scenario_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"active_watchlist_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"active_chart_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"active_playbook_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"active_monitor_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"theme": "light",
"onboarding_pinned": true,
"onboarding_completed_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"error": "Portfolio not found or access denied",
"error_code": "NOT_FOUND"
}{
"error": "Portfolio not found or access denied",
"error_code": "NOT_FOUND"
}{
"error": "Portfolio not found or access denied",
"error_code": "NOT_FOUND"
}{
"error": "Portfolio not found or access denied",
"error_code": "NOT_FOUND"
}{
"error": "Portfolio not found or access denied",
"error_code": "NOT_FOUND"
}{
"error": "Internal error",
"error_code": "INTERNAL_ERROR",
"request_id": "5b1e7c52-3f4a-4d0e-9a55-2d5cbe6f0a11"
}Authorizations
Raw API key shown once when created in the Allocait app (Settings > API keys). Send it verbatim in this header; the server stores and compares only its SHA-256 hash. Allocait generates every key: alc_ followed by 64 lowercase hex characters. Keys issued before 2026-10-10 are 64 hex characters with no prefix and keep working. A key may carry an expiry (90 days or 1 year, or never). A malformed, unknown, revoked or expired key gets 401 with no further detail, and a malformed one is refused before any lookup. Keys cannot be created through this API.
Body
Display fallback only, read when the portfolio has no active scenario. Switch the judged scenario with PATCH /portfolios/{id}.
light, dark, system Set true to clear active_portfolio_id to null. Wins over active_portfolio_id in the same call.
Set true to clear active_scenario_id to null. Wins over active_scenario_id in the same call.
Set true to clear active_watchlist_id to null. Wins over active_watchlist_id in the same call.
Set true to clear active_chart_id to null. Wins over active_chart_id in the same call.
Set true to clear active_playbook_id to null. Wins over active_playbook_id in the same call.
Set true to clear active_monitor_id to null. Wins over active_monitor_id in the same call.