REFERENCE

API Reference

Base URL: https://api.portfolwright.com/v1 — All requests require Authorization: Bearer <key>


Portfolios

POST /v1/portfolios Create portfolio

Register a new portfolio with current holdings and target weights. Returns a portfolio_id used in subsequent rebalance requests.

Request body
"external_id"    string  // Your internal portfolio identifier
"currency"       string  // Base currency: "EUR" | "GBP" | "CHF"
"tax_wrapper"    string  // "GIA" | "ISA" | "PEA" | "Depot" | "SIPP"
"holdings"       array   // Current positions (isin, exchange, quantity)
"targets"        array   // Target allocations (isin, weight: 0.0–1.0)
GET /v1/portfolios/{portfolio_id} Get portfolio

Return current holdings, target weights, and latest drift snapshot for a portfolio.

DELETE /v1/portfolios/{portfolio_id} Delete portfolio

Remove a portfolio and stop monitoring it for drift. Historical rebalance records are retained per data retention policy (7 years).


Rebalancing

POST /v1/rebalance Create rebalance plan

Generate a rebalance plan for a portfolio. The plan includes an ordered list of buy/sell orders and cost estimates. Use "simulation": true for a dry run (not billed).

Request body
"portfolio_id"         string   // required
"drift_threshold"      float    // 0.01–0.20, default: 0.05
"band_type"            string   // "absolute" | "relative"
"rebalance_trigger"    string   // "any_position" | "portfolio"
"cost_budget"          float    // Max bps total cost (optional)
"simulation"           bool     // Default: false
"fractional_precision" int      // 2–6, default: 4
"fx_overlay"           bool     // Separate FX drift. Default: true
GET /v1/rebalance/{rebalance_id} Get plan status

Poll plan status. Possible values: plan_ready, executing, partially_filled, complete, failed, cancelled.

POST /v1/rebalance/{rebalance_id}/execute Execute plan

Submit the plan for execution. Pass {"confirm": true}. Orders are routed to the relevant exchange connectors. Subscribe to webhooks for fill events.

DELETE /v1/rebalance/{rebalance_id} Cancel plan

Cancel a plan that is in plan_ready state. Plans in executing or later states cannot be cancelled — contact support for partial execution rollback.


Exchange Prices

GET /v1/prices/{isin} Get intraday price

Returns the current mid price and last trade price for an ISIN across connected exchanges. Useful for pre-flight cost estimation.

Response 200
{
  "isin": "IE00B4L5Y983",
  "prices": [
    { "exchange": "XAMS", "mid_eur": 72.14, "last_trade_eur": 72.11 }
  ],
  "timestamp": "2025-01-03T14:22:11Z"
}

Error codes

HTTPCodeDescription
400invalid_requestRequest body malformed or missing required fields
401unauthorizedMissing or invalid API key
402quota_exceededMonthly event limit reached for your tier
404not_foundPortfolio or rebalance plan ID does not exist
409already_executingA rebalance is already in progress for this portfolio
422drift_below_thresholdNo position exceeds the configured drift band — no rebalance needed
429rate_limitExceeded 60 requests/minute per API key
500internal_errorExchange connectivity failure or pricing unavailable