Create Account Lockout

View as Markdown
### Lock an account for a specified duration. **Available to:** All authenticated users (own account only) **Environments:** Demo **[Rate Limit](/overview/core-concepts/rate-limits):** No endpoint-specific limit Traders can voluntarily lock themselves out of trading on a specific account for a set period. This helps traders protect their progress, whether that means locking in a winning day or stepping away before losses deepen. - **Traders can't cancel their own lockouts.** Once activated, the lockout stays in effect until it expires or an organization administrator manually unlocks it. - **Account-level lockout.** Only the specified account is locked. Other accounts belonging to the same user are not affected. - **Closes positions and blocks orders.** When a trader activates a lockout, open positions on the account are liquidated and new orders are rejected until the lockout expires. **Common Failure Scenarios** - The caller doesn't own the account (organization administrators can't create lockouts) - The user's organization doesn't have the Tradovate Prop entitlement - The account already has an active lockout - The account doesn't exist - The `durationMinutes` value is 0 All responses return `HTTP 200`. Errors are indicated by `ok: false` and an `errorText` field in the response body. **Error Messages** | `errorText` | Trigger | |-------------|---------| | `"Unauthorized: only the eval user may initiate a trading lockout. Org admins and super admins not permitted to create lockouts"` | The caller is not the account owner | | `"Account {id} already has an active lockout for user {userId}. New lockout requests are not permitted until the existing lockout expires."` | The account already has an active lockout | | `"Account not found."` | The `accountId` doesn't match an existing account | | `"Tradovate Prop required"` | The user's organization doesn't have the required Tradovate Prop entitlement | | `"durationMinutes must be greater than 0"` | The `durationMinutes` value is 0 | **Related Endpoints** - Use [`accountLockoutStatus`](/api/rest-api-endpoints/users/account-lockout-status) to check whether accounts are currently locked - Use [`expireAccountLockout`](/api/rest-api-endpoints/users/expire-account-lockout) to unlock a single account early (organization administrators only) - Use [`expireAllAccountLockouts`](/api/rest-api-endpoints/users/expire-all-account-lockouts) to unlock all accounts for a user (organization administrators only)

Authentication

AuthorizationBearer

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

Request

This endpoint expects an object.
accountIdlongRequired
durationMinutesintegerRequired>=0

Response

AccountLockoutResponse
errorTextstringOptional<=8192 characters

Non-empty if the request failed

okbooleanOptional