Fixed

Rebalancing run and portfolio weight schemas corrected

Broker API

The rebalancing run and portfolio weight schemas now match the behavior the API already implements. No production API behavior changes, but generated clients and strict validators will see contract differences.

Create Run (POST /v1/rebalancing/runs):

  • The request body is now required, along with account_id and type.
  • type documents the supported values full_rebalance and invest_cash.
  • Adds an optional, nullable decimal amount field.
  • weights changes from a single object to an optional array of PortfolioWeightRequest entries, each requiring type and percent. Percentages must be positive and total exactly 100, and asset weights require a non-null symbol.
  • Omit weights or send an empty array to create a subscription-driven run; send a non-empty array for a manual one-off run, which is rejected when the account has an active subscription.

Weight schemas:

  • Request and response weights are now separate models: PortfolioWeightRequest for inputs and PortfolioWeights for responses. Portfolio create and update requests now use PortfolioWeightRequest.
  • PortfolioWeights now documents type, symbol, and percent as always present, with symbol explicitly nullable for cash weights and type limited to asset or cash.

Affected Endpoints

  • POST /v1/rebalancing/runs
  • GET /v1/rebalancing/runs
  • GET /v1/rebalancing/runs/{run_id}
  • POST /v1/rebalancing/portfolios
  • PATCH /v1/rebalancing/portfolios/{portfolio_id}
  • GET /v1/rebalancing/portfolios
  • GET /v1/rebalancing/portfolios/{portfolio_id}