Create admin lockout
Lock a trading account so the trader cannot open new risk. Risk-reducing actions (closing positions, cancelling orders, flattening) always remain available to the trader — a lockout can never trap someone in a losing position.
How it works:
- Any existing active lockout on the account is cancelled first
- A new lockout is created with
locked_by: admin - The running trade engine picks it up immediately (this endpoint pushes it; a periodic engine resync is the fallback within ~15 seconds)
- For every mode except
trade_clock, the account is flattened at creation: open positions are closed and working orders cancelled. The response reportspositionsClosedandordersCancelled. - If any exposure somehow appears on a locked account later (for example an in-flight order), the engine detects it on the next market tick and closes it automatically
- The trader cannot remove admin lockouts — only an admin can unlock
Lockout modes:
| Mode | Description |
|---|---|
admin | Blocks new entries until endsAt; account is flattened at creation |
timed | Time-based lock with specific start/end; account is flattened at creation |
session | Locked for the current trading session; account is flattened at creation |
trade_clock | Discipline lock — blocks new entries while the account holds exposure, does NOT flatten; closing/flattening stays available |
For indefinite locks: Set endsAt to a far-future date like 2099-12-31T23:59:59Z.
Authorizations
JWT Bearer token for user session auth. Format: "Bearer {token}". Used by User and Organization endpoints.
Body
Account ID to lock
Lockout mode
admin, timed, session, trade_clock "admin"
Reason shown to the trader
3"Risk review: unusual trading pattern detected"
When lockout expires. Use far-future date for indefinite locks.
"2026-04-01T00:00:00Z"
Related topics
Create or update account lockoutList all active lockoutsRemove lockout from accountCreate an API keyCreate a custom role