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

# Preview a mass credit

> Starts a preview job: for each selected account, what the rules would credit, or why it is left out, with an explanation. Nothing is changed.

The call returns `202` with the job at once; the work runs in the background in batches, so any number of accounts can be previewed. Follow it with `GET /organization/jobs/{jobId}` (progress and totals) and read the outcome per account with `GET /organization/jobs/{jobId}/items`.

Pick the accounts with `selection`: `all` (every account of the organization), `filter` (plan, status, type, creation date), or `list` (account ids or account numbers in `accounts`, up to 10,000 per call; for a longer list send `deferStart: true`, add the rest with `POST .../previews/{jobId}/inputs`, then `POST .../previews/{jobId}/start`).

Passed, failed and expired accounts are never credited: they are listed as skipped (`ACCOUNT_CLOSED`). Review warnings before confirming: `BALANCE_TRAIL_MISMATCH` means the account's recorded balance changes for these fills do not add up to their P&L, so the loss may never have reached its balance.

A completed preview can be confirmed within 24 hours.

Requires **manage** permission on traders.

```bash
curl -X POST "https://api.hyperprop.com/platform/v1/organization/balance-adjustments/previews" \
  -H "X-API-Key: hp_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"rules": {"windowStart": "2026-10-21T13:30:00Z", "windowEnd": "2026-10-21T14:15:00Z"}, "selection": {"mode": "all"}}'
```



## OpenAPI

````yaml https://api.hyperprop.com/platform/openapi.json post /v1/organization/balance-adjustments/previews
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: Mass credit
    description: >-
      Credit back losses across many accounts after an incident, as background
      jobs you can follow, pause, export and reverse.
  - 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, integration health, and idempotency key
      recovery.
  - 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/balance-adjustments/previews:
    post:
      tags:
        - Mass credit
      summary: Preview a mass credit
      description: >-
        Starts a preview job: for each selected account, what the rules would
        credit, or why it is left out, with an explanation. Nothing is changed.


        The call returns `202` with the job at once; the work runs in the
        background in batches, so any number of accounts can be previewed.
        Follow it with `GET /organization/jobs/{jobId}` (progress and totals)
        and read the outcome per account with `GET
        /organization/jobs/{jobId}/items`.


        Pick the accounts with `selection`: `all` (every account of the
        organization), `filter` (plan, status, type, creation date), or `list`
        (account ids or account numbers in `accounts`, up to 10,000 per call;
        for a longer list send `deferStart: true`, add the rest with `POST
        .../previews/{jobId}/inputs`, then `POST .../previews/{jobId}/start`).


        Passed, failed and expired accounts are never credited: they are listed
        as skipped (`ACCOUNT_CLOSED`). Review warnings before confirming:
        `BALANCE_TRAIL_MISMATCH` means the account's recorded balance changes
        for these fills do not add up to their P&L, so the loss may never have
        reached its balance.


        A completed preview can be confirmed within 24 hours.


        Requires **manage** permission on traders.


        ```bash

        curl -X POST
        "https://api.hyperprop.com/platform/v1/organization/balance-adjustments/previews"
        \
          -H "X-API-Key: hp_live_your_key_here" \
          -H "Content-Type: application/json" \
          -d '{"rules": {"windowStart": "2026-10-21T13:30:00Z", "windowEnd": "2026-10-21T14:15:00Z"}, "selection": {"mode": "all"}}'
        ```
      operationId: postV1OrganizationBalanceadjustmentsPreviews
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Model981'
      responses:
        '201':
          description: >-
            Created - A draft list preview (with `deferStart`); add accounts,
            then start it
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Model982'
        '202':
          description: Accepted - The preview job is queued
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Model983'
        '400':
          description: >-
            Bad Request - `VALIDATION_ERROR`, `INVALID_WINDOW`, `INVALID_RULES`,
            `INVALID_SELECTION`, `NO_ACCOUNTS`, `TOO_MANY_ACCOUNTS`
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Model985'
        '401':
          description: Authentication required
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Model11'
        '403':
          description: >-
            Forbidden - The caller lacks traders:manage
            (`INSUFFICIENT_PERMISSIONS`)
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Model986'
        '404':
          description: Template not found
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Model987'
        '500':
          description: An unexpected error occurred
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Model6'
        '503':
          description: Mass credit is not available yet; nothing was changed
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Model144'
      security:
        - X-API-Key: []
components:
  schemas:
    Model981:
      type: object
      properties:
        templateId:
          type: string
          description: >-
            Start from a template: its rules (and selection), overridden by
            `rules` and `selection` in this request
          x-format:
            guid: true
        rules:
          $ref: '#/components/schemas/Model378'
        selection:
          $ref: '#/components/schemas/selection'
        accounts:
          $ref: '#/components/schemas/Model980'
        deferStart:
          type: boolean
          description: >-
            Selection `list`: create a draft to add more accounts to before
            starting
          default: false
    Model982:
      type: object
      properties:
        success:
          type: boolean
          example: true
        data:
          $ref: '#/components/schemas/Model139'
    Model983:
      type: object
      properties:
        success:
          type: boolean
          example: true
        data:
          $ref: '#/components/schemas/Model139'
    Model985:
      type: object
      properties:
        success:
          type: boolean
          example: false
        statusCode:
          type: number
          example: 400
        error:
          type: string
          example: Bad Request
        message:
          type: string
          example: 'The window must have ended: `windowEnd` is in the future'
        code:
          $ref: '#/components/schemas/Model984'
    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
    Model986:
      type: object
      properties:
        statusCode:
          type: number
          example: 403
        error:
          type: string
          example: Forbidden
        message:
          type: string
          example: Insufficient permissions
        code:
          $ref: '#/components/schemas/code'
    Model987:
      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: Template not found
        code:
          type: string
          description: Machine-readable error code — switch on this, not on message text
          example: TEMPLATE_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
    Model144:
      type: object
      properties:
        success:
          type: boolean
          description: Always false on errors
          example: false
        statusCode:
          type: number
          example: 503
        error:
          type: string
          example: Error
        message:
          type: string
          example: Mass credit is not available yet; nothing was changed
        code:
          type: string
          description: Machine-readable error code — switch on this, not on message text
          example: FEATURE_NOT_READY
    Model378:
      type: object
      description: >-
        How the credit is computed. Every field is optional (a template or the
        defaults fill the rest), except the window, which the request or the
        template must give.
      properties:
        windowStart:
          type: string
          format: date-time
          description: Start of the incident window (inclusive), ISO 8601
          example: '2026-10-21T13:30:00Z'
        windowEnd:
          type: string
          format: date-time
          description: >-
            End of the window (exclusive). Must be in the past; at most 7 days
            after `windowStart`.
          example: '2026-10-21T14:15:00Z'
        lossBasis:
          $ref: '#/components/schemas/Model377'
        includeFees:
          type: boolean
          description: 'Default `true`: fees and commission count as part of the loss.'
          example: true
        maxCreditPerAccount:
          type: number
          description: Largest credit per account. No cap by default.
          example: null
          x-constraint:
            precision: 2
            sign: positive
        minCreditPerAccount:
          type: number
          description: >-
            Smallest credit paid; smaller losses are skipped (`BELOW_MINIMUM`).
            None by default.
          example: null
          x-constraint:
            precision: 2
            sign: positive
        countTowardDailyPnl:
          type: boolean
          description: >-
            Default `false`: the day's starting balance moves with the credit,
            so it does not count as that day's profit (the daily loss limit
            stays where it was). `true`: the credit counts toward the day's P&L.
          example: false
        moveHighWaterMark:
          type: boolean
          description: >-
            Default `false`: the high-water mark (trailing drawdown peak) stays
            where it is. `true`: it moves up with the credit.
          example: false
        requireFlat:
          type: boolean
          description: >-
            Default `false`. `true`: accounts holding positions or working
            orders when the credit lands fail with `OPEN_EXPOSURE` (retry them
            later).
          example: false
        skipAlreadyCredited:
          type: boolean
          description: >-
            Default `true`: leave out accounts already credited, and not
            reversed, for an overlapping window.
          example: true
    selection:
      type: object
      properties:
        mode:
          $ref: '#/components/schemas/mode'
        filters:
          $ref: '#/components/schemas/Model138'
      required:
        - mode
        - filters
    Model980:
      type: array
      description: >-
        Selection `list`: account ids or account numbers (up to 10,000;
        duplicates are ignored)
      maxItems: 10000
      items:
        type: string
        minLength: 1
        maxLength: 64
        x-convert:
          trim: true
    Model139:
      type: object
      properties:
        id:
          type: string
          example: 5d1c7a2e-3b4f-4c8d-9e0a-1b2c3d4e5f60
          x-format:
            guid: true
        kind:
          $ref: '#/components/schemas/Model134'
        type:
          $ref: '#/components/schemas/type'
        state:
          $ref: '#/components/schemas/Model135'
        parentJobId:
          type: string
          description: A credit's preview, or a reversal's credit
          x-format:
            guid: true
        createdBy:
          type: string
          example: ops@yourfirm.com
        createdAt:
          type: string
        startedAt:
          type: string
        finishedAt:
          type: string
        heartbeatAt:
          type: string
        progress:
          $ref: '#/components/schemas/progress'
        summary:
          $ref: '#/components/schemas/Model136'
        lastError:
          type: string
        rules:
          $ref: '#/components/schemas/rules'
        selection:
          $ref: '#/components/schemas/selection'
        templateId:
          type: string
          x-format:
            guid: true
        expiresAt:
          type: string
          description: 'Preview: confirm before this time'
        batchId:
          type: string
          description: 'Credit/reversal: the batch recorded on every adjustment'
          x-format:
            guid: true
        tag:
          type: string
        reason:
          type: string
        previewJobId:
          type: string
          x-format:
            guid: true
        applyJobId:
          type: string
          x-format:
            guid: true
        expected:
          $ref: '#/components/schemas/expected'
    Model984:
      type: string
      example: VALIDATION_ERROR
      enum:
        - VALIDATION_ERROR
        - INVALID_WINDOW
        - INVALID_RULES
        - INVALID_SELECTION
        - NO_ACCOUNTS
        - TOO_MANY_ACCOUNTS
    code:
      type: string
      example: INSUFFICIENT_PERMISSIONS
      enum:
        - INSUFFICIENT_PERMISSIONS
    Model377:
      type: string
      description: >-
        `net` (default): the window's net P&L, when it is a loss.
        `gross_losers`: the total of the losing round trips that ended in the
        window; winning trades are not netted against them.
      example: net
      enum:
        - net
        - gross_losers
    mode:
      type: string
      description: >-
        `all`: every account of the organization. `list`: the accounts you send
        (ids or account numbers). `filter`: accounts matching `filters`.
      example: all
      enum:
        - all
        - list
        - filter
    Model138:
      type: object
      properties:
        planIds:
          $ref: '#/components/schemas/planIds'
        statuses:
          $ref: '#/components/schemas/statuses'
        types:
          $ref: '#/components/schemas/types'
        createdFrom:
          type: string
          format: date-time
          description: Accounts created at or after
        createdTo:
          type: string
          format: date-time
          description: Accounts created before
    Model134:
      type: string
      example: mass_credit.preview
      enum:
        - mass_credit.preview
        - mass_credit.apply
        - mass_credit.reversal
    type:
      type: string
      example: preview
      enum:
        - preview
        - credit
        - reversal
    Model135:
      type: string
      description: >-
        `draft`: a list preview still taking accounts. `completed_with_errors`:
        finished, some items failed (retry them). `failed`: the job could not go
        on (`lastError`).
      example: running
      enum:
        - draft
        - queued
        - running
        - paused
        - cancelling
        - cancelled
        - completed
        - completed_with_errors
        - failed
    progress:
      type: object
      properties:
        total:
          type: integer
          example: 120000
        processed:
          type: integer
          example: 48200
        succeeded:
          type: integer
          description: 'Preview: accounts to credit. Credit/reversal: adjustments applied.'
          example: 9100
        failed:
          type: integer
          example: 0
        skipped:
          type: integer
          description: 'Preview: accounts left out (see `summary.skip_*`).'
          example: 39100
        planning:
          type: boolean
          description: >-
            The selection is still being expanded; `total` grows until this is
            false.
          example: false
        percent:
          type: number
          example: 40.2
    Model136:
      type: object
      description: >-
        Running totals. Preview: `credits`, `creditAmount` (send it back as
        `expectedTotalAmount`), `lossAmount`, `capped`, `warnings`,
        `skip_<REASON>`. Credit/reversal: `applied`, `appliedAmount`, `failed`,
        `failedAmount`, `duplicates`, `failed_<CODE>`.
      example:
        credits: 9100
        creditAmount: 1830220.5
        lossAmount: 1902118.25
        capped: 120
        warnings: 14
        skip_ACCOUNT_CLOSED: 30000
        skip_NO_FILLS: 9100
    rules:
      type: object
      description: >-
        How the credit is computed. Every field is optional (a template or the
        defaults fill the rest), except the window, which the request or the
        template must give.
      properties:
        windowStart:
          type: string
          format: date-time
          description: Start of the incident window (inclusive), ISO 8601
          example: '2026-10-21T13:30:00Z'
        windowEnd:
          type: string
          format: date-time
          description: >-
            End of the window (exclusive). Must be in the past; at most 7 days
            after `windowStart`.
          example: '2026-10-21T14:15:00Z'
        lossBasis:
          $ref: '#/components/schemas/Model137'
        includeFees:
          type: boolean
          description: 'Default `true`: fees and commission count as part of the loss.'
          example: true
        maxCreditPerAccount:
          type: number
          description: Largest credit per account. No cap by default.
          example: null
          x-constraint:
            precision: 2
            sign: positive
        minCreditPerAccount:
          type: number
          description: >-
            Smallest credit paid; smaller losses are skipped (`BELOW_MINIMUM`).
            None by default.
          example: null
          x-constraint:
            precision: 2
            sign: positive
        countTowardDailyPnl:
          type: boolean
          description: >-
            Default `false`: the day's starting balance moves with the credit,
            so it does not count as that day's profit (the daily loss limit
            stays where it was). `true`: the credit counts toward the day's P&L.
          example: false
        moveHighWaterMark:
          type: boolean
          description: >-
            Default `false`: the high-water mark (trailing drawdown peak) stays
            where it is. `true`: it moves up with the credit.
          example: false
        requireFlat:
          type: boolean
          description: >-
            Default `false`. `true`: accounts holding positions or working
            orders when the credit lands fail with `OPEN_EXPOSURE` (retry them
            later).
          example: false
        skipAlreadyCredited:
          type: boolean
          description: >-
            Default `true`: leave out accounts already credited, and not
            reversed, for an overlapping window.
          example: true
    expected:
      type: object
      properties:
        accounts:
          type: integer
        totalAmount:
          type: number
    planIds:
      type: array
      description: Trading plans the account was bought on
      maxItems: 100
      items:
        type: string
        x-format:
          guid: true
    statuses:
      type: array
      description: Account statuses
      example:
        - in_progress
      maxItems: 20
      items:
        type: string
        maxLength: 40
    types:
      type: array
      description: Account types
      example:
        - evaluation
      maxItems: 20
      items:
        type: string
        maxLength: 40
    Model137:
      type: string
      description: >-
        `net` (default): the window's net P&L, when it is a loss.
        `gross_losers`: the total of the losing round trips that ended in the
        window; winning trades are not netted against them.
      example: net
      enum:
        - net
        - gross_losers
  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

- [Confirm a mass credit](https://docs.hyperprop.com/platform-api/mass-credit/confirm-a-mass-credit.md)
- [Reverse a mass credit](https://docs.hyperprop.com/platform-api/mass-credit/reverse-a-mass-credit.md)
- [Start a draft preview](https://docs.hyperprop.com/platform-api/mass-credit/start-a-draft-preview.md)
- [Add accounts to a draft preview](https://docs.hyperprop.com/platform-api/mass-credit/add-accounts-to-a-draft-preview.md)
- [List bulk jobs](https://docs.hyperprop.com/platform-api/mass-credit/list-bulk-jobs.md)


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