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

# Bulk revert accounts to a trading day or an instant

> **Time Machine, org-wide:** the same operation as the single-account revert, applied to many accounts in one call — built for exchange/platform outages.

**Who** — exactly one of:
- `accountIds` (max 1000) — a targeted revert;
- `allAccounts: true` — every account in your organization with activity after the restore point;
- `audience: { from, to, condition }` — the accounts an outage window actually touched: `traded` (any fill in the window), `loss` (net realized P&L in the window below zero), `failed` (the account failed inside the window), or `failed_or_loss`. Everyone else is left alone.

**To when** — `tradingDay` (end-of-day state of that Chicago trading day) or `revertTo` (exact state at an instant; see the single-account endpoint for how it is reconstructed). With an `audience` and neither given, the accounts go back to `audience.from` — the point at which the issues began.

Each account is processed independently: the response lists per-account results and per-account failures (one bad account never aborts the batch — per-account error codes match the single-account endpoint). All changes share one `batchId` in the audit trail, and the batch records the restore point and the audience that selected it.

**Example — an outage at the NY open (09:30–10:00 ET on 8 Sep 2026) failed some accounts and cost others money; put exactly those accounts back to 09:30:**
```json
{
  "audience": { "from": "2026-09-08T13:30:00Z", "to": "2026-09-08T14:00:00Z", "condition": "failed_or_loss" },
  "reason": "Feed outage at the NY open, 8 Sep",
  "preview": true
}
```

**Undoable.** The returned `batchId` is a Time Machine ledger entry (`GET /revert-batches`). If the batch was a mistake, `POST /revert-batches/{batchId}/undo` restores every account in it to its pre-revert state in one call — accounts with new trader activity since the revert are skipped and reported individually.

**Batch-level error codes:**
| Code | Status | Meaning |
|------|:---:|---------|
| `NO_ACCOUNTS` | 400 | Nothing to revert (empty accountIds, or allAccounts found no affected accounts). An empty `audience` is NOT an error: 200 with `reverted: 0` |
| `TOO_MANY_ACCOUNTS` | 400 | More than 1000 accounts in one call — split into batches |
| `AMBIGUOUS_TARGET` | 400 | Not exactly one of accountIds / allAccounts / audience |
| `INVALID_AUDIENCE_WINDOW` | 400 | audience.from is not before audience.to, or not timestamps |
| `INVALID_REVERT_POINT` | 400 | Both tradingDay and revertTo, revertTo not a timestamp, or in the future |
| `AUDIENCE_ERROR` | 500 | Could not read the activity needed to resolve the audience — retry |

**Recommended flow:** run with `"preview": true` first — you get the full per-account impact report (balances restored, accounts revived, orders voided) with zero changes — then execute.

**Example — preview an org-wide revert, then execute:**
```bash
# 1. Dry run
curl -X POST ".../v1/organization/accounts/revert-trading-day" \
  -H "X-API-Key: hp_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{ "tradingDay": "2026-07-07", "allAccounts": true, "reason": "Data feed outage", "preview": true }'

# 2. Execute
curl -X POST ".../v1/organization/accounts/revert-trading-day" \
  -H "X-API-Key: hp_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{ "tradingDay": "2026-07-07", "allAccounts": true, "reason": "Data feed outage" }'
```



## OpenAPI

````yaml /api-reference/openapi.json post /v1/organization/accounts/revert-trading-day
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/accounts/revert-trading-day:
    post:
      tags:
        - Time Machine
      summary: Bulk revert accounts to a trading day or an instant
      description: >-
        **Time Machine, org-wide:** the same operation as the single-account
        revert, applied to many accounts in one call — built for
        exchange/platform outages.


        **Who** — exactly one of:

        - `accountIds` (max 1000) — a targeted revert;

        - `allAccounts: true` — every account in your organization with activity
        after the restore point;

        - `audience: { from, to, condition }` — the accounts an outage window
        actually touched: `traded` (any fill in the window), `loss` (net
        realized P&L in the window below zero), `failed` (the account failed
        inside the window), or `failed_or_loss`. Everyone else is left alone.


        **To when** — `tradingDay` (end-of-day state of that Chicago trading
        day) or `revertTo` (exact state at an instant; see the single-account
        endpoint for how it is reconstructed). With an `audience` and neither
        given, the accounts go back to `audience.from` — the point at which the
        issues began.


        Each account is processed independently: the response lists per-account
        results and per-account failures (one bad account never aborts the batch
        — per-account error codes match the single-account endpoint). All
        changes share one `batchId` in the audit trail, and the batch records
        the restore point and the audience that selected it.


        **Example — an outage at the NY open (09:30–10:00 ET on 8 Sep 2026)
        failed some accounts and cost others money; put exactly those accounts
        back to 09:30:**

        ```json

        {
          "audience": { "from": "2026-09-08T13:30:00Z", "to": "2026-09-08T14:00:00Z", "condition": "failed_or_loss" },
          "reason": "Feed outage at the NY open, 8 Sep",
          "preview": true
        }

        ```


        **Undoable.** The returned `batchId` is a Time Machine ledger entry
        (`GET /revert-batches`). If the batch was a mistake, `POST
        /revert-batches/{batchId}/undo` restores every account in it to its
        pre-revert state in one call — accounts with new trader activity since
        the revert are skipped and reported individually.


        **Batch-level error codes:**

        | Code | Status | Meaning |

        |------|:---:|---------|

        | `NO_ACCOUNTS` | 400 | Nothing to revert (empty accountIds, or
        allAccounts found no affected accounts). An empty `audience` is NOT an
        error: 200 with `reverted: 0` |

        | `TOO_MANY_ACCOUNTS` | 400 | More than 1000 accounts in one call —
        split into batches |

        | `AMBIGUOUS_TARGET` | 400 | Not exactly one of accountIds / allAccounts
        / audience |

        | `INVALID_AUDIENCE_WINDOW` | 400 | audience.from is not before
        audience.to, or not timestamps |

        | `INVALID_REVERT_POINT` | 400 | Both tradingDay and revertTo, revertTo
        not a timestamp, or in the future |

        | `AUDIENCE_ERROR` | 500 | Could not read the activity needed to resolve
        the audience — retry |


        **Recommended flow:** run with `"preview": true` first — you get the
        full per-account impact report (balances restored, accounts revived,
        orders voided) with zero changes — then execute.


        **Example — preview an org-wide revert, then execute:**

        ```bash

        # 1. Dry run

        curl -X POST ".../v1/organization/accounts/revert-trading-day" \
          -H "X-API-Key: hp_live_your_key_here" \
          -H "Content-Type: application/json" \
          -d '{ "tradingDay": "2026-07-07", "allAccounts": true, "reason": "Data feed outage", "preview": true }'

        # 2. Execute

        curl -X POST ".../v1/organization/accounts/revert-trading-day" \
          -H "X-API-Key: hp_live_your_key_here" \
          -H "Content-Type: application/json" \
          -d '{ "tradingDay": "2026-07-07", "allAccounts": true, "reason": "Data feed outage" }'
        ```
      operationId: postV1OrganizationAccountsReverttradingday
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Model640'
      responses:
        '200':
          description: Bulk revert processed (check per-account failures)
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Model646'
        '400':
          description: No accounts / too many accounts
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Model647'
        '401':
          description: Authentication required
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Model9'
        '403':
          description: Access denied
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Model47'
        '500':
          description: An unexpected error occurred
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Model5'
      security:
        - X-API-Key: []
components:
  schemas:
    Model640:
      type: object
      properties:
        tradingDay:
          type: string
          description: >-
            END-OF-DAY restore: Chicago trading day (YYYY-MM-DD) to revert TO.
            One of tradingDay / revertTo; with an `audience` and neither given,
            the accounts are restored to `audience.from`.
          example: '2026-07-07'
          pattern: ^\d{4}-\d{2}-\d{2}$
        revertTo:
          type: string
          description: >-
            POINT-IN-TIME restore: the exact instant (ISO 8601, UTC) every
            targeted account is restored to — typically the moment the outage
            began. See the single-account endpoint for how the state at an
            instant is reconstructed.
          example: '2026-09-08T13:30:00Z'
          x-format:
            isoDate: true
        reason:
          type: string
          description: Why — audit trail, account metadata, webhooks
          example: Data feed outage
          minLength: 3
        accountIds:
          $ref: '#/components/schemas/Model637'
        allAccounts:
          type: boolean
          description: >-
            Revert every account in the organization with activity after the
            restore point (later trades or snapshots) — including accounts
            created during the outage day itself. Untouched accounts are
            skipped.
          enum:
            - true
        audience:
          $ref: '#/components/schemas/Model639'
        preview:
          type: boolean
          description: >-
            Dry run: per-account report of what WOULD happen, nothing changed.
            Use it to build the confirmation screen before an org-wide revert.
          example: true
          default: false
      required:
        - reason
    Model646:
      type: object
      properties:
        success:
          type: boolean
          example: true
        message:
          type: string
          example: Reverted 42 accounts to 2026-07-07
        data:
          $ref: '#/components/schemas/Model645'
    Model647:
      type: object
      properties:
        success:
          type: boolean
          example: false
        code:
          type: string
          example: TOO_MANY_ACCOUNTS
        message:
          type: string
          example: Too many accounts in one revert (max 1000) — split into batches
    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
    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
    Model637:
      type: array
      description: Specific accounts to revert (max 1000 per call)
      minItems: 1
      maxItems: 1000
      items:
        type: string
        x-format:
          guid: true
    Model639:
      type: object
      description: >-
        Target the accounts an outage window actually touched, instead of naming
        them. Only non-voided activity counts. The response reports how many
        matched; an empty audience returns 200 with `reverted: 0` (nothing to do
        is not an error).
      properties:
        from:
          type: string
          description: Start of the outage window (ISO 8601, UTC)
          example: '2026-09-08T13:30:00Z'
          x-format:
            isoDate: true
        to:
          type: string
          description: 'End of the outage window (ISO 8601, UTC). Default: now.'
          example: '2026-09-08T14:00:00Z'
          x-format:
            isoDate: true
        condition:
          $ref: '#/components/schemas/Model638'
      required:
        - from
        - condition
    Model645:
      type: object
      example:
        batchId: a1b2c3d4-e5f6-7890-abcd-ef1234567890
        tradingDay: '2026-07-07'
        reverted: 2
        failed: 0
        accounts:
          - accountId: 7c9e6679-7425-40de-944b-e07fc1f90ae7
            accountNumber: ACC-7845KXPQ
            revertedTo: '2026-07-07'
            balanceBefore: 48750
            balanceAfter: 51250
            statusBefore: failed
            statusAfter: in_progress
            snapshotsDeleted: 1
            ordersVoided: 14
            positionsClosed: 1
            ordersCancelled: 2
          - accountId: 8d0f7780-8536-51ef-b55c-f18gd2g01bf8
            accountNumber: ACC-9921MZPL
            revertedTo: '2026-07-07'
            balanceBefore: 50100
            balanceAfter: 50900
            statusBefore: in_progress
            statusAfter: in_progress
            snapshotsDeleted: 1
            ordersVoided: 9
            positionsClosed: 0
            ordersCancelled: 0
        failures: []
      properties:
        batchId:
          type: string
          description: >-
            Time Machine ledger id — list it via GET /revert-batches, undo the
            whole batch via POST /revert-batches/{batchId}/undo. null in
            previews.
        tradingDay:
          type: string
          description: >-
            Chicago trading day restored (end-of-day restore) or containing the
            instant (point-in-time restore)
        revertTo:
          type: string
          description: >-
            The instant (ISO, UTC) for a point-in-time restore; null for an
            end-of-day restore
        audience:
          $ref: '#/components/schemas/Model641'
        preview:
          type: boolean
          description: true = dry run, nothing was changed
        reverted:
          type: number
        failed:
          type: number
        accounts:
          $ref: '#/components/schemas/Model643'
        failures:
          $ref: '#/components/schemas/failures'
    Model638:
      type: string
      description: >-
        Who inside the window: `traded` = any fill in the window · `loss` = net
        realized P&L in the window is negative · `failed` = the account failed
        in the window · `failed_or_loss` = either
      example: failed_or_loss
      enum:
        - traded
        - loss
        - failed
        - failed_or_loss
    Model641:
      type: object
      description: >-
        Echo of the audience that selected the accounts; null when
        accountIds/allAccounts were used
      properties:
        from:
          type: string
        to:
          type: string
        condition:
          type: string
        matched:
          type: number
          description: Accounts the window + condition selected
    Model643:
      type: array
      items:
        $ref: '#/components/schemas/Model642'
    failures:
      type: array
      items:
        $ref: '#/components/schemas/Model644'
    Model642:
      type: object
      properties:
        accountId:
          type: string
        accountNumber:
          type: string
        revertedTo:
          type: string
        balanceBefore:
          type: number
        balanceAfter:
          type: number
        statusBefore:
          type: string
        statusAfter:
          type: string
        snapshotsDeleted:
          type: number
        ordersVoided:
          type: number
        positionsClosed:
          type: number
          description: Open positions force-closed before the revert
        ordersCancelled:
          type: number
          description: Working orders cancelled before the revert
    Model644:
      type: object
      properties:
        accountId:
          type: string
        code:
          type: string
        message:
          type: string
  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

- [Revert an account to a trading day or an instant](/platform-api/time-machine/revert-an-account-to-a-trading-day-or-an-instant.md)
- [List revert batches](/platform-api/time-machine/list-revert-batches.md)
- [Inspect a revert batch](/platform-api/time-machine/inspect-a-revert-batch.md)
- [Undo a revert batch](/platform-api/time-machine/undo-a-revert-batch.md)
- [Introduction](/introduction.md)


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