Set Admin Auto Liq Action

### Set the auto-liquidation action for an account. **Available to:** Organization administrators **Environments:** Demo **[Rate Limit](/overview/core-concepts/rate-limits):** No endpoint-specific limit Set the auto-liquidation action for an account. Use this endpoint to lock an account (rejecting new orders), trigger liquidation, or unlock it by setting the action back to `Normal`. <Warning>The status set by this endpoint is **persistent**. A locked or liquidated account stays in that state until you explicitly call this endpoint again with `adminAction` set to `Normal`. It does not auto-unlock at the next trading session, time out, or reset on its own.</Warning> There is no bulk version of this endpoint. You must call it separately for each account. **`adminAction` Values** | Value | Effect | |-------|--------| | `Normal` | Clears any restriction on the account and allows trading to resume. Use this to unlock an account after a lock or liquidation action. | | `LockTradingImmediately` | Immediately locks the account. All orders are rejected. Open positions are not liquidated. | | `LiquidateImmediately` | Immediately liquidates all open positions and locks the account. All orders are rejected. | | `LiquidateOnlyModeImmediately` | Immediately restricts the account to closing orders only. New position-opening orders are rejected. Open positions are not liquidated. | | `PlaceAutoLiqOnHold` (Internal) | Temporarily pauses auto-liquidation for one minute, then resumes.<br/>This value is not intended for partner workflows because it is set automatically by the system during internal risk processing. | | `DisableAutoLiq` (Internal) | Permanently disables auto-liquidation on the account.<br/>This value is not intended for partner workflows because it is set automatically by the system during internal risk processing. | | `AgreedOnLiqOnlyModeByAutoLiq` (Internal) | Temporarily suppresses auto-liquidation for one minute while allowing liquidate-only mode to trigger.<br/>This value is not intended for partner workflows because it is set automatically by the system during internal risk processing. | | `AgreedOnLiquidationByAutoLiq` (Internal) | Reserved.<br/>This value is not intended for partner workflows because it is set automatically by the system during internal risk processing. | **`adminActionReasonCode` Values** Most partners use `Other` (with a descriptive `adminActionReason`). The `Close*` and `Restricted*` codes are used internally for brokerage account management. When `adminActionReasonCode` is `Other`, you must provide an `adminActionReason` describing why you're taking the action. For all other reason codes, `adminActionReason` is optional. **Common Partner Workflows** - **Lock an account:** Set `adminAction` to `LockTradingImmediately` to prevent new orders. The account's open positions are not affected. - **Liquidate and lock:** Set `adminAction` to `LiquidateImmediately`, then call the endpoint again with `adminAction` set to `LockTradingImmediately`. - **Only block new positions:** Set `adminAction` to `LiquidateOnlyModeImmediately`. The account can still close existing positions but cannot open new ones. - **Unlock an account:** Set `adminAction` to `Normal` to allow the account to resume trading. - **Unlock after a daily loss limit breach** (`doNotUnlock` enabled): If the account's [`doNotUnlock`](/overview/prop-firm-management/risk-management/post-trade-risk) field is set to `true`, a daily loss limit breach locks the account and the lock does not auto-reset at the next market open. Call this endpoint with `Normal` before the next trading session to let the trader resume. The `doNotUnlock` setting stays in place for future sessions. - **Account remediation:** Use this endpoint alongside [`changeDemoBalance`](/api/rest-api-endpoints/accounting/change-demo-balance) and [`updateMaxNetLiq`](/api/rest-api-endpoints/risks/update-max-net-liq) to reset an account after an incident. **Best Practices** - Track active accounts on your end and avoid calling this endpoint on archived accounts. The endpoint accepts requests for archived accounts without returning an error, which can lead to unnecessary API calls and rate limit issues. - Verify the account status after calling this endpoint by checking the `accountRiskStatus` object in the response or by calling `accountRiskStatus/deps`. **Common Failure Scenarios** - `accountId` does not reference a valid account (returns `HTTP 404`) - `adminActionReasonCode` is `Other` but `adminActionReason` is missing - `adminActionReason` exceeds 8,192 characters - Caller is not an organization administrator on the Demo environment (returns `HTTP 401`) **Error Messages** | `errorText` | Trigger | |-------------|---------| | `"Account Id should be greater than 0"` | `accountId` is 0 or negative | | `"Admin Action should be between Normal and LiquidateImmediately"` | `adminAction` is not a valid enum value | | `"Admin Action Reason Code should be between CloseAMLDecision and Other"` | `adminActionReasonCode` is not a valid enum value | | `"Admin Action Reason should be no longer than 8192"` | `adminActionReason` exceeds 8,192 characters | | `"Admin Action Reason should be specified"` | `adminActionReasonCode` is `Other` but no `adminActionReason` was provided | | `"Access is denied"` | Caller is not an organization administrator, or the request was sent to the Live environment | | `"This endpoint should be called on live.tradovateapi.com"` | Called on the replay environment |

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Request

This endpoint expects an object.
accountIdlongRequired
adminActionenumRequired
AgreedOnLiqOnlyModeByAutoLiq, AgreedOnLiquidationByAutoLiq, DisableAutoLiq, LiquidateImmediately, LiquidateOnlyModeImmediately, LockTradingImmediately, Normal, PlaceAutoLiqOnHold
adminActionReasonCodeenumRequired
CloseAMLDecision, CloseComplianceDecision, CloseCustomerRequest, CloseDeceased, CloseEscheatment, CloseFraud, CloseInactiveUnfundedAccount, FullBalanceWithdrawal, Other, RestrictedAMLRequest, RestrictedAccountsRequest, RestrictedComplianceRequest, RestrictedRiskRestriction, RestrictedTreasuryRequest, RestrictedW8Expired
adminActionReasonstringOptional<=8192 characters

Response

AccountRiskStatusResponse
errorTextstring<=8192 characters

Non-empty if the request failed

accountRiskStatusobject