Close all positions on an account
Closes every open position at market and cancels every working order on one account, immediately. The account keeps its status and is not locked out — the trader can trade again straight away; combine with POST /organization/lockouts if you also want to stop further trading.
The resulting orders carry reason Admin flatten: <who> — <your reason> (trigger admin_flatten), and an ACCOUNT_UPDATED event with the counts lands on the account’s event log.
Requires manage permission on traders. If the trading engine cannot be reached the call fails with 502 and nothing is closed.
curl -X POST "https://api.hyperprop.com/platform/v1/organization/trading-accounts/7c9e6679-7425-40de-944b-e07fc1f90ae7/flatten" \
-H "X-API-Key: hp_live_your_key_here" \
-H "Content-Type: application/json" \
-d '{"reason": "Hedging review"}'
Authorizations
JWT Bearer token for user session auth. Format: "Bearer {token}". Used by User and Organization endpoints.
Path Parameters
Body
Why the positions are being closed. Recorded on every resulting order and on the account's event log.
3 - 200"Hedging review — positions closed pending clarification"