Fixed

Corrected request and response schemas on rebalancing endpoints

Broker API

The rebalancing schemas now match what the API actually accepts and returns. No API behavior changes; generated clients and strict validators may need updating.

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

  • The request body, account_id, and type are now required. type accepts full_rebalance or invest_cash, and account_id is documented as a UUID.
  • Adds a nullable decimal amount field.
  • weights is now an optional array of weight entries instead of a single object. 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 if the account already has an active subscription.

Weight schemas:

  • Request weights use the new PortfolioWeightRequest schema, where type and percent are required, percentages must be positive, and the weights must total exactly 100. This schema is also used by the portfolio create and update requests.
  • Response weights (PortfolioWeights) now require type, symbol, and percent, with symbol explicitly nullable for cash weights.

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}