Flatten account: close positions and cancel orders
The full “panic button”: closes all open positions AND cancels all pending orders for the specified account(s).
Modes:
- Single account:
{ "account_ids": ["uuid"] } - Multiple accounts:
{ "account_ids": ["uuid1", "uuid2"] } - All accounts:
{}(empty body flattens everything) - Symbol-filtered: add
"symbols": ["ESH6"]to only flatten specific contracts
If flattening causes the profit target to be met on any account, those accounts are marked as passed.
Returns a command acceptance. Requires x-idempotency-key header.
Body
Request to flatten account(s)
Optional: List of account UUIDs to flatten. If omitted, flattens ALL accounts. Can be a single account or multiple accounts.
Internal: overrides the audit reason stamped on the flatten orders. Set by engine-initiated flattens (e.g. account lockout) that ride the same command path; clients should omit it.
Optional: List of contract symbols to flatten. If omitted, flattens ALL symbols. Examples: ["ESH6"], ["ESH6", "NQH6"], or omit for all symbols.
Related topics
Close all open positions for an accountCreate or update account lockoutRate limits & quotasClose a specific position by contractLink a standalone order into the position's OCO group