> ## 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.

# Get a close-all run

> Progress and outcome of one close-all run. Poll every few seconds while `status` is `running`.

`accounts` lists only the accounts where something was closed or cancelled. `failures` lists accounts that could not be confirmed, with a code: `ENGINE_UNAVAILABLE` (the request for the account did not go through), `NO_RESULT` (no outcome was reported for the account), `CLOSE_FAILED` (closing a position was refused; working orders may still have been cancelled) or `INTERNAL_ERROR`. Start a new run, for example with those `accountIds`, to retry them.

Requires **view** permission on traders.

```bash
curl "https://api.hyperprop.com/platform/v1/organization/flatten-runs/3f2a9c1e-8b7d-4e6f-a5c4-1d2e3f4a5b6c" \
  -H "X-API-Key: hp_live_your_key_here"
```



## OpenAPI

````yaml https://api.hyperprop.com/platform/openapi.json get /v1/organization/flatten-runs/{runId}
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/flatten-runs/{runId}:
    get:
      tags:
        - Trading accounts
      summary: Get a close-all run
      description: >-
        Progress and outcome of one close-all run. Poll every few seconds while
        `status` is `running`.


        `accounts` lists only the accounts where something was closed or
        cancelled. `failures` lists accounts that could not be confirmed, with a
        code: `ENGINE_UNAVAILABLE` (the request for the account did not go
        through), `NO_RESULT` (no outcome was reported for the account),
        `CLOSE_FAILED` (closing a position was refused; working orders may still
        have been cancelled) or `INTERNAL_ERROR`. Start a new run, for example
        with those `accountIds`, to retry them.


        Requires **view** permission on traders.


        ```bash

        curl
        "https://api.hyperprop.com/platform/v1/organization/flatten-runs/3f2a9c1e-8b7d-4e6f-a5c4-1d2e3f4a5b6c"
        \
          -H "X-API-Key: hp_live_your_key_here"
        ```
      operationId: getV1OrganizationFlattenrunsRunid
      parameters:
        - x-format:
            guid: true
          name: runId
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Run retrieved
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Model377'
        '401':
          description: Authentication required
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Model11'
        '403':
          description: Forbidden - The caller lacks traders:view
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Model378'
        '404':
          description: Close-all run not found
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Model379'
        '500':
          description: An unexpected error occurred
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Model6'
        '504':
          description: >-
            Gateway Timeout - The request did not complete within 25 seconds
            (`REQUEST_TIMEOUT`). Nothing was changed; retry, or narrow the
            request (for example a shorter date range).
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Model380'
      security:
        - X-API-Key: []
components:
  schemas:
    Model377:
      type: object
      properties:
        success:
          type: boolean
          example: true
        data:
          $ref: '#/components/schemas/Model376'
    Model11:
      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
    Model378:
      type: object
      properties:
        statusCode:
          type: number
          example: 403
        error:
          type: string
          example: Forbidden
        message:
          type: string
          example: Your role does not have write access to "Traders & accounts"
        code:
          type: string
          example: INSUFFICIENT_PERMISSIONS
    Model379:
      type: object
      properties:
        success:
          type: boolean
          description: Always false on errors
          example: false
        statusCode:
          type: number
          example: 404
        error:
          type: string
          example: Not Found
        message:
          type: string
          example: Close-all run not found
        code:
          type: string
          description: Machine-readable error code — switch on this, not on message text
          example: FLATTEN_RUN_NOT_FOUND
    Model6:
      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
    Model380:
      type: object
      properties:
        statusCode:
          type: number
          example: 504
        error:
          type: string
          example: Gateway Timeout
        message:
          type: string
          example: >-
            The request did not complete within 25 seconds. Try again, or narrow
            it (for example a shorter date range).
        code:
          type: string
          description: Machine-readable error code — switch on this, not on message text
          example: REQUEST_TIMEOUT
    Model376:
      type: object
      properties:
        runId:
          type: string
          example: 3f2a9c1e-8b7d-4e6f-a5c4-1d2e3f4a5b6c
          x-format:
            guid: true
        scope:
          $ref: '#/components/schemas/scope'
        status:
          $ref: '#/components/schemas/Model372'
        reason:
          type: string
          example: Market data outage
        requestedBy:
          type: string
          description: Staff email, or `api-key`
          example: ops@yourfirm.com
        total:
          type: integer
          description: Accounts the run covers
          example: 7180
        processed:
          type: integer
          description: Accounts handled so far
          example: 7180
        accountsFlattened:
          type: integer
          description: Accounts where at least one position was closed or order cancelled
          example: 412
        positionsClosed:
          type: integer
          example: 530
        ordersCancelled:
          type: integer
          example: 244
        failed:
          type: integer
          description: Accounts that could not be confirmed; see `failures` on the run
          example: 0
        createdAt:
          type: string
          example: '2026-10-17T14:02:11.000Z'
        lastProgressAt:
          type: string
          description: When the run last reported progress
          example: '2026-10-17T14:04:52.000Z'
        completedAt:
          type: string
          example: '2026-10-17T14:04:52.000Z'
        accounts:
          $ref: '#/components/schemas/Model374'
        failures:
          $ref: '#/components/schemas/failures'
        failuresTruncated:
          type: boolean
          description: True when more accounts failed than are listed
          example: false
    scope:
      type: string
      description: >-
        `all`: every tradable account of the organization. `accounts`: the
        accounts you listed.
      example: all
      enum:
        - all
        - accounts
    Model372:
      type: string
      description: >-
        `interrupted`: the run stopped making progress before it finished (for
        example during a service restart). Start a new run to cover the rest;
        accounts already flat are left alone.
      example: completed
      enum:
        - running
        - completed
        - interrupted
    Model374:
      type: array
      description: Only the accounts where something was closed or cancelled
      items:
        $ref: '#/components/schemas/Model373'
    failures:
      type: array
      description: >-
        Accounts that could not be confirmed (at most 1,000 listed; `failed` is
        the exact count)
      items:
        $ref: '#/components/schemas/Model375'
    Model373:
      type: object
      properties:
        accountId:
          type: string
          example: 7c9e6679-7425-40de-944b-e07fc1f90ae7
          x-format:
            guid: true
        accountNumber:
          type: string
          example: ACME-50K-000123
        positionsClosed:
          type: integer
          example: 1
        ordersCancelled:
          type: integer
          example: 2
    Model375:
      type: object
      properties:
        accountId:
          type: string
          example: 9b2e1f4c-3d5a-4b6c-8e7f-0a1b2c3d4e5f
          x-format:
            guid: true
        code:
          $ref: '#/components/schemas/code'
        message:
          type: string
          example: >-
            The trading engine did not confirm this account; run again to retry
            it
    code:
      type: string
      example: ENGINE_UNAVAILABLE
      enum:
        - ENGINE_UNAVAILABLE
        - NO_RESULT
        - CLOSE_FAILED
        - INTERNAL_ERROR
  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

- [List close-all runs](/platform-api/trading-accounts/list-close-all-runs.md)
- [Close all positions across accounts](/platform-api/trading-accounts/close-all-positions-across-accounts.md)
- [Close all positions on an account](/platform-api/trading-accounts/close-all-positions-on-an-account.md)
- [Close all open positions for an account](/trade-api/positions/close-all-open-positions-for-an-account.md)
- [Rate limits & quotas](/concepts/rate-limits.md)


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