Portfolio Center API
Accounts, positions, lots, cash, drift, risk, model portfolios, rebalancing and what-ifs.
Objects
- Account: a portfolio (simulated cash), with its strategy, tags, base currency, model, tax-lot method (
tax_optimalorfifo), value at the latest closes, cash, and your_permissions on it (view,propose,trade,approve). You only ever see accounts you may view; others answer 404. - Position: a holding with quantity, price, value, cost basis, unrealized P&L and weight. Lot: an open tax lot. Cash: the balance and recent movements.
- Drift: each security's target, actual weight and drift against the account's model, and whether it is out of tolerance. Risk: concentration (top position, top 5, HHI, effective N), sector and issuer weights, factor betas, volatility and correlation spikes.
- Model: target weights per symbol, a cash target and a drift tolerance.
- Proposal: trades proposed by the deterministic optimizer for one account (from a rebalance, a what-if or the pipeline), with an explanation. A proposal is never an order.
Typical sequences
Monitor drift every morning
GET /accounts?tag=growth→ the accounts.GET /accounts/{id}/driftfor each →out_of_tolerance.- For those out of tolerance,
POST /rebalance-proposalswith their ids → a pipeline run with proposals (202 and a job for more than three accounts). - A person reviews the proposals and creates the orders (
POST /pipeline/runs/{id}/orders).
Keep a model in sync: GET /models/{id} (keep the ETag) → PUT /models/{id} with If-Match and the full targets.
Rules that apply
Writes need propose on the accounts (rebalances, what-ifs) or the manage accounts privilege (accounts, cash, models' assignment). Everything is checked like the screens and logged.
Endpoints
| Call | What it does | Scope |
|---|---|---|
GET/accounts | The accounts you can see, valued at the latest simulated closes | reference:read |
GET/accounts/{id} | One account | reference:read |
POST/accounts | Add an account (simulated cash) | reference:write |
PATCH/accounts/{id} | Change an account, incl. its model (If-Match) | reference:write |
GET/accounts/{id}/positions | Positions with value and weight | portfolio:read |
GET/accounts/{id}/lots | Open tax lots | portfolio:read |
GET/accounts/{id}/cash | Cash balance and recent (simulated) movements | portfolio:read |
POST/accounts/{id}/cash | Deposit or withdraw simulated cash | portfolio:write |
GET/accounts/{id}/drift | Drift against the account's model | portfolio:read |
GET/accounts/{id}/risk | Concentration, exposures and factor betas | portfolio:read |
GET/models | Model portfolios | reference:read |
GET/models/{id} | One model with targets | reference:read |
POST/models | Create a model | reference:write |
PUT/models/{id} | Replace a model's targets (If-Match) | reference:write |
POST/rebalance-proposals | Rebalance accounts: proposals in the Intent Pipeline (never orders); 202 with a job for more than 3 accounts | portfolio:write |
POST/what-ifs | A what-if: sector changes for accounts, as a pipeline proposal | portfolio:write |
GET/proposals | Rebalance proposals | pipeline:read |
GET/proposals/{id} | One proposal with its trades | pipeline:read |