Portfolio
balance object uses API-wallet
figures — never the $1,000 UI MAIN wallet. wallet_id accepts
all / api / <integer id> (404 WALLET_NOT_FOUND for ids you don’t
own) — see Wallets → Scoping account reads.
With wallet_id=all, positions and trade stats span every wallet you own
while the balance object keeps the API-wallet cash basis (the same
blended view as Profile Analysis).
Authentication
API key only —X-API-Key: <key> (or the PM-compat POLY_API_KEY /
Authorization: Bearer ps_live_... aliases). A Supabase Bearer JWT is
not accepted here (unlike GET /v1/account/balance).
Request
Response
| Field | Description |
|---|---|
balance | Nested balance object (see Balance) |
positions | Array of open positions (see Positions). Each position’s current_price, market_value, and unrealized_pnl are null when no live price is cached. |
total_trades | Total filled orders for the resolved wallet |
win_rate | Percentage of profitable closed positions (string with % suffix), or null when no closed positions have a classifiable exit price |
Bot Integration
Errors
All errors return{"error": "<CODE>", "message": "<human-readable>"}.
| Status | error code | When |
|---|---|---|
| 401 | MISSING_API_KEY | No API key header supplied |
| 401 | INVALID_KEY | API key is unknown, deactivated, or expired |
| 404 | WALLET_NOT_FOUND | wallet_id is not owned by the caller |
| 404 | ACCOUNT_NOT_FOUND | Authenticated user has no account record |
| 500 | INTERNAL_ERROR | Unexpected server error building the portfolio |
Next Steps
- Trade History — View filled orders
- Equity Curve — Portfolio value over time