Improved

Error responses documented on rebalancing endpoints

Broker API

All 13 rebalancing operations now document the errors the service returns, each with a named example showing the HTTP status, numeric code, and message from the {code, message} error body.

  • Adds 400, 401, 403, 404, 415, 422, and 500 responses where applicable, with per-case examples such as invalid portfolio_id, duplicate assets, weights that must sum to 100, account not funded, subscription already exists, and run not cancelable.
  • Adds an UnexpectedError schema for unhandled server errors, which returns {error, message} with no numeric code.
  • DELETE /v1/rebalancing/portfolios/{portfolio_id} no longer documents 400; the service does not return it. An invalid portfolio_id returns 422 invalid portfolio_id, and an already inactive portfolio returns 422 nothing to delete.
  • Clarifies cancel-run behavior: only runs in QUEUED or IN_PROGRESS can be canceled, and canceling does not stop orders already placed, so the final run status can replace CANCELED. The PortfolioRunStatus description is updated to match.