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

# Credit back an incident window's losses

> Credits each account the loss it took in the window, as computed by the preview, and records it as one batch.

The credit is applied to the live account straight away, alongside any trading on it, and exactly once per account and batch. By default the day's starting balance moves with the credit, so it is not counted as that day's profit, and the high-water mark does not change (see `policy`).

The batch continues in the background and the call returns `202` with a `batchId` at once. Follow it with `GET /organization/balance-adjustments/{batchId}`. Each credited account gets an `account.updated` event with trigger `balance_adjustment`, the batch ID, tag and reason, and an `account.balance_changed` event with reason `adjustment`.

Requires **manage** permission on traders.

```bash
curl -X POST "https://api.hyperprop.com/platform/v1/organization/balance-adjustments" \
  -H "X-API-Key: hp_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"accountIds": ["7c9e6679-7425-40de-944b-e07fc1f90ae7"], "windowStart": "2026-10-21T13:30:00Z", "windowEnd": "2026-10-21T14:15:00Z", "reason": "US-open outage", "tag": "incident-2026-10-21", "expectedTotalAmount": 412.5}'
```



## OpenAPI

````yaml https://api.hyperprop.com/platform/openapi.json post /v1/organization/balance-adjustments
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:
    post:
      tags:
        - Mass credit
      summary: Credit back an incident window's losses
      description: >-
        Credits each account the loss it took in the window, as computed by the
        preview, and records it as one batch.


        The credit is applied to the live account straight away, alongside any
        trading on it, and exactly once per account and batch. By default the
        day's starting balance moves with the credit, so it is not counted as
        that day's profit, and the high-water mark does not change (see
        `policy`).


        The batch continues in the background and the call returns `202` with a
        `batchId` at once. Follow it with `GET
        /organization/balance-adjustments/{batchId}`. Each credited account gets
        an `account.updated` event with trigger `balance_adjustment`, the batch
        ID, tag and reason, and an `account.balance_changed` event with reason
        `adjustment`.


        Requires **manage** permission on traders.


        ```bash

        curl -X POST
        "https://api.hyperprop.com/platform/v1/organization/balance-adjustments"
        \
          -H "X-API-Key: hp_live_your_key_here" \
          -H "Content-Type: application/json" \
          -d '{"accountIds": ["7c9e6679-7425-40de-944b-e07fc1f90ae7"], "windowStart": "2026-10-21T13:30:00Z", "windowEnd": "2026-10-21T14:15:00Z", "reason": "US-open outage", "tag": "incident-2026-10-21", "expectedTotalAmount": 412.5}'
        ```
      operationId: postV1OrganizationBalanceadjustments
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Model830'
      responses:
        '202':
          description: Accepted - The batch has started
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Model833'
        '400':
          description: >-
            Bad Request - Invalid payload or window (`VALIDATION_ERROR`,
            `INVALID_WINDOW`), or some `accountIds` are not accounts of your
            organization (`ACCOUNTS_NOT_FOUND`; nothing is changed)
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Model835'
        '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/Model836'
        '409':
          description: >-
            Conflict - The total changed since your preview (`PREVIEW_CHANGED`),
            or the tag is already used (`TAG_EXISTS`); nothing was credited
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Model839'
        '500':
          description: An unexpected error occurred
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Model6'
        '503':
          description: Balance adjustments are not available yet; nothing was changed
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Model93'
      security:
        - X-API-Key: []
components:
  schemas:
    Model830:
      type: object
      properties:
        accountIds:
          $ref: '#/components/schemas/Model829'
        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 incident window (exclusive). Must be in the past; the
            window may span at most 7 days.
          example: '2026-10-21T14:15:00Z'
        policy:
          $ref: '#/components/schemas/policy'
        reason:
          type: string
          description: >-
            Why the accounts are credited. Recorded on every adjustment, the
            account activity and the webhook.
          example: US-open outage, 21 October
          minLength: 3
          maxLength: 200
          x-convert:
            trim: true
        tag:
          type: string
          description: >-
            Your name for this credit (letters, digits, `.`, `_`, `:`, `-`). One
            credit batch per tag: sending the same tag again is refused with
            `409`.
          example: incident-2026-10-21
          minLength: 3
          maxLength: 80
          pattern: ^[A-Za-z0-9._:-]+$
          x-convert:
            trim: true
        expectedTotalAmount:
          type: number
          description: >-
            `totals.totalAmount` from the preview you reviewed. If the
            recomputed total differs, nothing is credited and the call answers
            `409 PREVIEW_CHANGED`.
          example: 186420.75
          x-constraint:
            precision: 2
      required:
        - accountIds
        - windowStart
        - windowEnd
        - reason
        - tag
        - expectedTotalAmount
    Model833:
      type: object
      properties:
        success:
          type: boolean
          example: true
        data:
          $ref: '#/components/schemas/Model832'
    Model835:
      type: object
      properties:
        success:
          type: boolean
          example: false
        statusCode:
          type: number
          example: 400
        error:
          type: string
          example: Bad Request
        message:
          type: string
          example: >-
            2 of the account IDs are not accounts of your organization; nothing
            was changed
        code:
          $ref: '#/components/schemas/Model834'
        unknownAccountIds:
          $ref: '#/components/schemas/unknownAccountIds'
        unknownCount:
          type: integer
    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
    Model836:
      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:
          $ref: '#/components/schemas/code'
    Model839:
      type: object
      properties:
        success:
          type: boolean
          example: false
        statusCode:
          type: number
          example: 409
        error:
          type: string
          example: Conflict
        message:
          type: string
          example: >-
            The credit total is now $186,532.75, not the $186,420.75 you
            confirmed; preview again. Nothing was credited.
        code:
          $ref: '#/components/schemas/Model837'
        totals:
          $ref: '#/components/schemas/Model838'
    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
    Model93:
      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: Balance adjustments are 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
    Model829:
      type: array
      description: >-
        The accounts to consider (1 to 5,000 of your organization; duplicates
        are ignored).
      example:
        - 7c9e6679-7425-40de-944b-e07fc1f90ae7
      minItems: 1
      maxItems: 5000
      items:
        type: string
        x-format:
          guid: true
    policy:
      type: object
      description: >-
        How the credit is computed and applied. Every field is optional; the
        defaults are shown.
      properties:
        lossBasis:
          $ref: '#/components/schemas/lossBasis'
        shiftDailyBaseline:
          type: boolean
          description: >-
            Default `true`: the day's starting balance moves with the credit, so
            the credit is not counted as that day's profit (daily loss limit and
            daily profit stay as they were).
          example: true
        highWaterMarkMode:
          $ref: '#/components/schemas/highWaterMarkMode'
        requireFlat:
          type: boolean
          description: >-
            Default `false`. When `true`, accounts that hold positions or
            working orders when the credit is applied are not credited (they
            fail with `OPEN_EXPOSURE`; retry later).
          example: false
        skipAlreadyCredited:
          type: boolean
          description: >-
            Default `true`: leave out accounts already credited, and not
            reversed, by a batch whose window overlaps this one.
          example: true
        maxCreditPerAccount:
          type: number
          description: Largest credit one account may get. No cap by default.
          example: null
          x-constraint:
            precision: 2
            sign: positive
    Model832:
      type: object
      properties:
        batchId:
          type: string
          example: 5d1c7a2e-3b4f-4c8d-9e0a-1b2c3d4e5f60
          x-format:
            guid: true
        kind:
          $ref: '#/components/schemas/kind'
        tag:
          type: string
          example: incident-2026-10-21
        reason:
          type: string
          example: US-open outage, 21 October
        status:
          $ref: '#/components/schemas/Model831'
        windowStart:
          type: string
          example: '2026-10-21T13:30:00.000Z'
        windowEnd:
          type: string
          example: '2026-10-21T14:15:00.000Z'
        policy:
          $ref: '#/components/schemas/policy'
        requestedBy:
          type: string
          description: Staff email, or `api-key`
          example: ops@yourfirm.com
        total:
          type: integer
          description: Adjustments in the batch
          example: 840
        processed:
          type: integer
          example: 840
        applied:
          type: integer
          example: 838
        failed:
          type: integer
          description: Adjustments not applied, or not confirmed; see `adjustments`
          example: 2
        skipped:
          type: integer
          description: Accounts the preview left out
          example: 410
        totalAmount:
          type: number
          description: Negative for a reversal
          example: 186420.75
        appliedAmount:
          type: number
          example: 186010.25
        reversesBatchId:
          type: string
          description: 'For a reversal: the credit batch it reverses'
          example: null
          x-format:
            guid: true
        createdAt:
          type: string
          example: '2026-10-25T15:02:11.000Z'
        lastProgressAt:
          type: string
          example: '2026-10-25T15:04:52.000Z'
        completedAt:
          type: string
          example: '2026-10-25T15:04:52.000Z'
        skippedAccounts:
          $ref: '#/components/schemas/skippedAccounts'
    Model834:
      type: string
      example: ACCOUNTS_NOT_FOUND
      enum:
        - VALIDATION_ERROR
        - INVALID_WINDOW
        - ACCOUNTS_NOT_FOUND
        - NOTHING_TO_DO
    unknownAccountIds:
      type: array
      description: 'With ACCOUNTS_NOT_FOUND: up to 50 of the IDs that were not found'
      items:
        type: string
    code:
      type: string
      example: INSUFFICIENT_PERMISSIONS
      enum:
        - INSUFFICIENT_PERMISSIONS
    Model837:
      type: string
      example: PREVIEW_CHANGED
      enum:
        - PREVIEW_CHANGED
        - TAG_EXISTS
    Model838:
      type: object
      description: 'With PREVIEW_CHANGED: the recomputed totals'
    lossBasis:
      type: string
      description: >-
        What is credited back: the net P&L of the window's fills after fees and
        commission (default), or before them.
      example: net_after_fees
      enum:
        - net_after_fees
        - net_before_fees
    highWaterMarkMode:
      type: string
      description: >-
        Default `unchanged`: the high-water mark (trailing drawdown peak) stays
        where it is. `shift` moves it by the credit as well.
      example: unchanged
      enum:
        - unchanged
        - shift
    kind:
      type: string
      example: credit
      enum:
        - credit
        - reversal
    Model831:
      type: string
      description: >-
        `interrupted`: the batch stopped making progress before it finished (for
        example during a service restart). Retry it to finish; nothing is
        applied twice.
      example: completed
      enum:
        - running
        - completed
        - interrupted
    skippedAccounts:
      type: array
      items:
        $ref: '#/components/schemas/Model387'
    Model387:
      type: object
      properties:
        accountId:
          type: string
          example: 9b2e1f4c-3d5a-4b6c-8e7f-0a1b2c3d4e5f
          x-format:
            guid: true
        accountNumber:
          type: string
          example: ACC-50K-000456
        reason:
          $ref: '#/components/schemas/reason'
        netPnl:
          type: number
          example: -120
    reason:
      type: string
      description: >-
        `ACCOUNT_CLOSED`: passed, failed or expired. `NO_FILLS`: no fill in the
        window. `NO_LOSS`: the window's net P&L is not a loss.
        `ALREADY_CREDITED`: credited for an overlapping window already.
      example: ACCOUNT_CLOSED
      enum:
        - ACCOUNT_CLOSED
        - NO_FILLS
        - NO_LOSS
        - ALREADY_CREDITED
  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

- [Preview a balance credit](https://docs.hyperprop.com/platform-api/mass-credit/preview-a-balance-credit.md)
- [Preview a mass credit](https://docs.hyperprop.com/platform-api/mass-credit/preview-a-mass-credit.md)
- [Create a mass credit template](https://docs.hyperprop.com/platform-api/mass-credit/create-a-mass-credit-template.md)
- [Update a mass credit template](https://docs.hyperprop.com/platform-api/mass-credit/update-a-mass-credit-template.md)
- [Confirm a mass credit](https://docs.hyperprop.com/platform-api/mass-credit/confirm-a-mass-credit.md)


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