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

# Retry the failed accounts of a background run

> Runs the **failed** and **cancelled** accounts of the batch's latest background revert (or undo) again, in the background, with the same restore point and reason. Accounts that already succeeded are not touched again. Each account gets a fresh set of retries. The batch stays one ledger entry, so it can still be undone as a whole.

The call answers **`202`**. Follow it like any background run: `GET /revert-batches/{batchId}` (`status`, `job`) and `GET /revert-batches/{batchId}/items`.

A retried revert works exactly like reverting those accounts now. For an instant restore (`revertTo`), any activity a trader had after that instant is voided too, including trades placed since the first run.

| Code | Status | Meaning |
|------|:---:|---------|
| `BATCH_NOT_FOUND` | 404 | Unknown batch id (or it belongs to a different organization) |
| `NO_JOB` | 404 | The batch ran within its request; it has no background run to retry |
| `NOTHING_TO_RETRY` | 409 | No failed or cancelled accounts |
| `BATCH_RUNNING` / `BATCH_UNDOING` | 409 | A background run of this batch is still in progress |
| `ALREADY_UNDONE` | 409 | The batch (or part of it) has been undone; start a new revert instead |

**Example:**
```bash
curl -X POST "https://api.hyperprop.com/platform/v1/organization/revert-batches/a1b2c3d4-e5f6-7890-abcd-ef1234567890/retry-failed" \
  -H "X-API-Key: hp_live_your_key_here"
```



## OpenAPI

````yaml https://api.hyperprop.com/platform/openapi.json post /v1/organization/revert-batches/{batchId}/retry-failed
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/revert-batches/{batchId}/retry-failed:
    post:
      tags:
        - Time Machine
      summary: Retry the failed accounts of a background run
      description: >-
        Runs the **failed** and **cancelled** accounts of the batch's latest
        background revert (or undo) again, in the background, with the same
        restore point and reason. Accounts that already succeeded are not
        touched again. Each account gets a fresh set of retries. The batch stays
        one ledger entry, so it can still be undone as a whole.


        The call answers **`202`**. Follow it like any background run: `GET
        /revert-batches/{batchId}` (`status`, `job`) and `GET
        /revert-batches/{batchId}/items`.


        A retried revert works exactly like reverting those accounts now. For an
        instant restore (`revertTo`), any activity a trader had after that
        instant is voided too, including trades placed since the first run.


        | Code | Status | Meaning |

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

        | `BATCH_NOT_FOUND` | 404 | Unknown batch id (or it belongs to a
        different organization) |

        | `NO_JOB` | 404 | The batch ran within its request; it has no
        background run to retry |

        | `NOTHING_TO_RETRY` | 409 | No failed or cancelled accounts |

        | `BATCH_RUNNING` / `BATCH_UNDOING` | 409 | A background run of this
        batch is still in progress |

        | `ALREADY_UNDONE` | 409 | The batch (or part of it) has been undone;
        start a new revert instead |


        **Example:**

        ```bash

        curl -X POST
        "https://api.hyperprop.com/platform/v1/organization/revert-batches/a1b2c3d4-e5f6-7890-abcd-ef1234567890/retry-failed"
        \
          -H "X-API-Key: hp_live_your_key_here"
        ```
      operationId: postV1OrganizationRevertbatchesBatchidRetryfailed
      parameters:
        - description: Batch id returned by the revert call
          x-format:
            guid: true
          name: batchId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Model970'
      responses:
        '202':
          description: Retry started in the background
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Model974'
        '401':
          description: Authentication required
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Model11'
        '403':
          description: Access denied
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Model63'
        '404':
          description: Batch not found, or it has no background run
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Model976'
        '409':
          description: Nothing to retry, still running, or undone
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Model978'
        '500':
          description: An unexpected error occurred
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Model6'
      security:
        - X-API-Key: []
components:
  schemas:
    Model970:
      type: object
    Model974:
      type: object
      properties:
        success:
          type: boolean
          example: true
        message:
          type: string
          example: >-
            Retrying 12 accounts in the background — follow progress with GET
            /revert-batches/a1b2c3d4-e5f6-7890-abcd-ef1234567890
        data:
          $ref: '#/components/schemas/Model973'
    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
    Model63:
      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
    Model976:
      type: object
      properties:
        success:
          type: boolean
          example: false
        code:
          $ref: '#/components/schemas/Model975'
        message:
          type: string
          example: This batch has no background run to retry
    Model978:
      type: object
      properties:
        success:
          type: boolean
          example: false
        code:
          $ref: '#/components/schemas/Model977'
        message:
          type: string
          example: No failed or cancelled accounts to retry
    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
    Model973:
      type: object
      example:
        batchId: a1b2c3d4-e5f6-7890-abcd-ef1234567890
        jobId: f47ac10b-58cc-4372-a567-0e02b2c3d479
        kind: revert
        status: running
        requeued: 12
      properties:
        batchId:
          type: string
        jobId:
          type: string
        kind:
          $ref: '#/components/schemas/Model971'
        status:
          $ref: '#/components/schemas/Model972'
        requeued:
          type: number
          description: Accounts sent again
    Model975:
      type: string
      example: NO_JOB
      enum:
        - BATCH_NOT_FOUND
        - NO_JOB
    Model977:
      type: string
      example: NOTHING_TO_RETRY
      enum:
        - NOTHING_TO_RETRY
        - BATCH_RUNNING
        - BATCH_UNDOING
        - ALREADY_UNDONE
    Model971:
      type: string
      enum:
        - revert
        - undo
    Model972:
      type: string
      enum:
        - running
        - undoing
  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 the accounts of a background run](/platform-api/time-machine/list-the-accounts-of-a-background-run.md)
- [Cancel a background run](/platform-api/time-machine/cancel-a-background-run.md)
- [Inspect a revert batch](/platform-api/time-machine/inspect-a-revert-batch.md)
- [Bulk revert accounts to a trading day or an instant](/platform-api/time-machine/bulk-revert-accounts-to-a-trading-day-or-an-instant.md)
- [List revert batches](/platform-api/time-machine/list-revert-batches.md)


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