> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hyperprop.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 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:**
1. Any existing active lockout on the account is cancelled first
2. A new lockout is created with `locked_by: admin`
3. The lockout takes effect immediately
4. For every mode except `trade_clock`, the account is **flattened at creation**: open positions are closed and working orders cancelled. The response reports `positionsClosed` and `ordersCancelled`.
5. If a position still opens on a locked account later (for example from an order that was already in flight), it is closed automatically
6. 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`.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/organization/lockouts
openapi: 3.0.0
info:
  title: Hyperprop Platform API
  version: 1.0.0
  description: >-
    REST API for the Hyperprop Trading Platform — provision evaluation and
    funded trading accounts, manage traders and plans, react to account
    lifecycle events via signed webhooks, and reconcile billing. Built for prop
    firms integrating from their own backend.


    Authentication, quick start, error handling, idempotency, pagination, custom
    metadata, webhooks, and the MCP connector are documented at
    https://docs.hyperprop.com.
  x-logo:
    url: https://app.hyperprop.com/logo-icon.svg
    altText: Hyperprop
    href: https://hyperprop.com
servers:
  - url: https://api.hyperprop.com/platform
    description: Production
security: []
tags:
  - name: Trading accounts
    description: Create, update, and inspect trading accounts.
  - name: Traders
    description: Look up and update the traders in your organization.
  - name: Trading plans
    description: Define the plans you sell.
  - name: Trading rules
    description: Define how accounts are evaluated.
  - name: Lockouts
    description: Pause and resume trading on an account.
  - name: Payouts
    description: Check payout eligibility and record payouts.
  - name: Purchases
    description: Purchases recorded for your organization.
  - name: Time Machine
    description: Restore accounts to an earlier trading day or instant.
  - name: Webhooks
    description: Register webhook endpoints and inspect deliveries.
  - name: Events
    description: Your organization's event history and real-time event stream.
  - name: Reconciliation
    description: Balances, end-of-day snapshots, and fills for reconciliation.
  - name: Analytics
    description: Organization performance and plan economics.
  - name: Billing
    description: 'Your Hyperprop bill: activity, billing cycles, and forecasts.'
  - name: Team and roles
    description: Manage dashboard access for your staff.
  - name: API keys
    description: Manage your organization's API key.
  - name: Logs and health
    description: API request logs, the audit log, and integration health.
  - name: Organization profile
    description: Your organization's profile and logo.
  - name: Support
    description: Open and follow up on support tickets.
  - name: Partner access
    description: >-
      Read a trader's journal as an approved partner app, with the trader's own
      key.
paths:
  /v1/organization/lockouts:
    post:
      tags:
        - Lockouts
      summary: Create admin lockout
      description: >-
        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:**

        1. Any existing active lockout on the account is cancelled first

        2. A new lockout is created with `locked_by: admin`

        3. The lockout takes effect immediately

        4. For every mode except `trade_clock`, the account is **flattened at
        creation**: open positions are closed and working orders cancelled. The
        response reports `positionsClosed` and `ordersCancelled`.

        5. If a position still opens on a locked account later (for example from
        an order that was already in flight), it is closed automatically

        6. 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`.
      operationId: postV1OrganizationLockouts
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Model538'
      responses:
        '201':
          description: Lockout created
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Model540'
        '401':
          description: Authentication required
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Model9'
        '403':
          description: Access denied
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Model47'
        '404':
          description: Account not found
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Model541'
        '500':
          description: An unexpected error occurred
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Model5'
      security:
        - X-API-Key: []
components:
  schemas:
    Model538:
      type: object
      properties:
        accountId:
          type: string
          description: Account ID to lock
          x-format:
            guid: true
        mode:
          $ref: '#/components/schemas/mode'
        reason:
          type: string
          description: Reason shown to the trader
          example: 'Risk review: unusual trading pattern detected'
          minLength: 3
        endsAt:
          type: string
          description: When lockout expires. Use far-future date for indefinite locks.
          example: '2026-04-01T00:00:00Z'
          x-format:
            isoDate: true
      required:
        - accountId
        - mode
        - reason
        - endsAt
    Model540:
      type: object
      properties:
        success:
          type: boolean
          example: true
        message:
          type: string
          example: Lockout created successfully
        data:
          $ref: '#/components/schemas/Model539'
    Model9:
      type: object
      properties:
        success:
          type: boolean
          description: Always false on errors
          example: false
        statusCode:
          type: number
          example: 401
        error:
          type: string
          example: Unauthorized
        message:
          type: string
          example: Authentication required
        code:
          type: string
          description: Machine-readable error code — switch on this, not on message text
          example: UNAUTHORIZED
    Model47:
      type: object
      properties:
        success:
          type: boolean
          description: Always false on errors
          example: false
        statusCode:
          type: number
          example: 403
        error:
          type: string
          example: Forbidden
        message:
          type: string
          example: Access denied
        code:
          type: string
          description: Machine-readable error code — switch on this, not on message text
          example: FORBIDDEN
    Model541:
      type: object
      properties:
        statusCode:
          type: number
          example: 404
        error:
          type: string
          example: Not Found
        message:
          type: string
          example: Account not found in your organization
        code:
          type: string
          example: ACCOUNT_NOT_FOUND
    Model5:
      type: object
      properties:
        success:
          type: boolean
          description: Always false on errors
          example: false
        statusCode:
          type: number
          example: 500
        error:
          type: string
          example: Internal Server Error
        message:
          type: string
          example: An unexpected error occurred
        code:
          type: string
          description: Machine-readable error code — switch on this, not on message text
          example: INTERNAL_ERROR
    mode:
      type: string
      description: Lockout mode
      example: admin
      enum:
        - admin
        - timed
        - session
        - trade_clock
    Model539:
      type: object
      example:
        id: b1c2d3e4-f5a6-7890-abcd-ef1234567890
        accountId: 7c9e6679-7425-40de-944b-e07fc1f90ae7
        userId: f994bc02-343c-4026-8a57-afc085eca8d5
        mode: admin
        reason: 'Risk review: unusual trading pattern detected'
        lockedBy: admin
        startsAt: '2026-03-12T15:00:00.000Z'
        endsAt: '2026-04-01T00:00:00.000Z'
        createdAt: '2026-03-12T15:00:00.000Z'
        positionsClosed: 1
        ordersCancelled: 2
      properties:
        id:
          type: string
        accountId:
          type: string
        userId:
          type: string
        mode:
          type: string
        reason:
          type: string
        lockedBy:
          type: string
        startsAt:
          type: string
        endsAt:
          type: string
        createdAt:
          type: string
        positionsClosed:
          type: number
          description: >-
            Open positions closed by the lockout flatten (0 for trade_clock
            mode)
        ordersCancelled:
          type: number
          description: >-
            Working orders cancelled by the lockout flatten (0 for trade_clock
            mode)
  securitySchemes:
    X-API-Key:
      type: apiKey
      name: X-API-Key
      in: header
      description: >-
        Organization API key. Format: "hp_live_{key}". Organization admins
        manage the key in the dashboard.

````

## Related topics

- [Create or update account lockout](/trade-api/account/create-or-update-account-lockout.md)
- [List all active lockouts](/platform-api/lockouts/list-all-active-lockouts.md)
- [Remove lockout from account](/platform-api/lockouts/remove-lockout-from-account.md)
- [Create an API key](/platform-api/api-keys/create-an-api-key.md)
- [Create a custom role](/platform-api/team-and-roles/create-a-custom-role.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.