Improved
Per-position error details documented on close-all-positions endpoints
November 3rd, 2026
Documents the per-position result returned when closing all open positions. The 207 response contains one entry per position: when status is 200, body is the closing Order; for any other status, body is the error object explaining why that position was not closed.
- Adds a
ClosePositionErrorschema describing the per-position rejection payload. - Adds a documented
422response for request-level failures, with an example for an invalidcancel_ordersvalue. Request-level failures return a single error and no per-position results. - Documents optional fields the server can include on the shared
Errorschema:symbol,existing_qty,held_for_orders, andavailable. - Documents
codeon theErrorschema as the Alpaca error code (usually the HTTP status followed by a five-digit suffix) andmessageas the human-readable rejection reason. - Adds partial-close response examples.
No wire change: the response shape is what the API already returns, and the new properties are optional.
Broker API
DELETE /v1/trading/accounts/{account_id}/positions
Trading API
DELETE /v2/positions