Skip to navigation

Set Admin Auto Liq Action

View as Markdown

Set the auto-liquidation action for an account.

Available to: Organization administrators

Environments: Demo

Rate Limit: 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.

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.

There is no bulk version of this endpoint. You must call it separately for each account.

adminAction Values

ValueEffect
NormalClears any restriction on the account and allows trading to resume. Use this to unlock an account after a lock or liquidation action.
LockTradingImmediatelyImmediately locks the account. All orders are rejected. Open positions are not liquidated.
LiquidateImmediatelyImmediately liquidates all open positions and locks the account. All orders are rejected.
LiquidateOnlyModeImmediatelyImmediately 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.
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.
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.
This value is not intended for partner workflows because it is set automatically by the system during internal risk processing.
AgreedOnLiquidationByAutoLiq (Internal)Reserved.
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 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 and updateMaxNetLiq 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

errorTextTrigger
"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, PartnerPayoutLock, RequalificationReset, RestrictedAMLRequest, RestrictedAccountsRequest, RestrictedComplianceRequest, RestrictedRiskRestriction, RestrictedSubaccountDeclineRequest, RestrictedTreasuryRequest, RestrictedW8Expired
adminActionReasonstringOptional<=8192 characters

Response

AccountRiskStatusResponse
errorTextstringOptional<=8192 characters

Non-empty if the request failed

accountRiskStatusobjectOptional