> ## Documentation Index
> Fetch the complete documentation index at: https://docs.anthid.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get order health signals

> Reports the distribution of amendments issued against orders over a trailing window, and the orders currently sitting in a transitional status past the staleness threshold. An amendment is any command issued after the one that placed the order, so the cancel that ends it counts too. Stuck orders are limited to transitional statuses on purpose: a resting good-till-cancelled limit is open for days and entirely healthy, whereas a pending replace that was never confirmed is not.



## OpenAPI

````yaml /api-reference/ledger.openapi.json get /v1/orders/health
openapi: 3.1.0
info:
  title: ledger
  description: ''
  license:
    name: ''
  version: 0.1.0
servers:
  - url: https://api.anthid.com
    description: Production
security: []
tags:
  - name: Ledger
    description: Read current orders, order history, and order activity
  - name: Ledger
    description: Read current positions and position history
  - name: Ledger
    description: Read platform-wide execution metrics
  - name: Ledger
    description: >-
      Read ledger-wide reference data, such as the symbols an organization has
      traded
  - name: Ledger
    description: >-
      Read completed intents. Live ones are served by the intents service at
      /v1/intents; this is the six year record of finished ones
paths:
  /v1/orders/health:
    get:
      tags:
        - Ledger
      summary: Get order health signals
      description: >-
        Reports the distribution of amendments issued against orders over a
        trailing window, and the orders currently sitting in a transitional
        status past the staleness threshold. An amendment is any command issued
        after the one that placed the order, so the cancel that ends it counts
        too. Stuck orders are limited to transitional statuses on purpose: a
        resting good-till-cancelled limit is open for days and entirely healthy,
        whereas a pending replace that was never confirmed is not.
      operationId: getOrderHealth
      parameters:
        - name: account_id
          in: query
          description: >-
            Trading account ID. Omitted, the window covers every account in the
            organization
          required: false
          schema:
            type: string
            format: uuid
          example: 550e8400-e29b-41d4-a716-446655440000
        - name: environment
          in: query
          description: >-
            Required. Which environment the read covers. Resolved to the
            organization's accounts in that environment, including disabled and
            deleted ones, since the ledger stores no environment of its own.
            Rejected with 400 when it disagrees with the account named alongside
            it.
          required: true
          schema:
            $ref: '#/components/schemas/BrokerEnvironment'
          example: paper
        - name: days
          in: query
          description: >-
            Trailing day count for the amendment distribution. Clamped to
            1..=90, then to the window the caller's plan grants
          required: true
          schema:
            type: integer
            format: int64
          example: 7
        - name: symbol
          in: query
          description: >-
            Filter by symbol. Symbols are normalized to uppercase; a blank value
            is treated as no filter
          required: false
          schema:
            type: string
          example: AAPL
        - name: stuck_minutes
          in: query
          description: >-
            How long an order must have rested to count as stuck. Defaults to
            15, clamped to 1..=1440
          required: false
          schema:
            type: integer
            format: int64
          example: 15
      responses:
        '200':
          description: Health signals retrieved
          headers:
            anthid-retention-days:
              schema:
                type: integer
                format: int64
              description: >-
                Trailing window, in days, that this answer was produced under.
                Comes from the caller's plan, so a value shorter than the range
                requested means the range was narrowed to it. Absent for
                internal service callers, who have no window.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderHealthResponse'
              example:
                amendments:
                  - amendments: 0
                    is_cap: false
                    order_count: 812
                  - amendments: 1
                    is_cap: false
                    order_count: 96
                  - amendments: 2
                    is_cap: false
                    order_count: 11
                  - amendments: 3
                    is_cap: true
                    order_count: 2
                stuck_count: 1
                stuck_minutes: 15
                stuck_orders:
                  - account_id: 550e8400-e29b-41d4-a716-446655440000
                    age_seconds: 5220
                    broker: lightspeed
                    filled_quantity: '120'
                    last_seen_at: '2026-08-14T13:04:00Z'
                    order_id: 550e8400-e29b-41d4-a716-446655440111
                    order_side: BUY
                    order_status: PENDING_REPLACE
                    quantity: '500'
                    symbol: AAPL
        '400':
          description: >-
            Query parameters are invalid, including a missing or non-numeric
            `days`
          content:
            text/plain:
              schema:
                type: string
        '401':
          description: >-
            Missing or invalid authentication credentials or organization
            context
          content:
            text/plain:
              schema:
                type: string
        '403':
          description: >-
            Caller lacks intent read access, organization access, or ownership
            of the requested trading account, or is on the free tier: analytics
            requires a paid plan and is refused with `BillingTierRestriction`
          content:
            text/plain:
              schema:
                type: string
        '429':
          description: Caller exceeded the request rate limit
          content:
            text/plain:
              schema:
                type: string
        '500':
          description: Unexpected server error while reading health signals
          content:
            text/plain:
              schema:
                type: string
      security:
        - bearerAuth: []
        - apiKeyAuth: []
components:
  schemas:
    BrokerEnvironment:
      type: string
      enum:
        - paper
        - live
    OrderHealthResponse:
      type: object
      description: Order-level health signals that describe a window rather than a series.
      required:
        - amendments
        - stuck_orders
        - stuck_count
        - stuck_minutes
      properties:
        amendments:
          type: array
          items:
            $ref: '#/components/schemas/AmendmentBucket'
          description: >-
            The amendment distribution over the requested window, ascending,
            with

            every bucket present up to and including the cap.


            An amendment is any command issued against an order after the one
            that

            placed it, which includes the cancel that ends it, so an order
            replaced

            once and then cancelled reports two. The distribution is read for
            its

            shape near zero rather than as a count of replaces alone.
        stuck_count:
          type: integer
          format: int64
          description: |-
            How many were found, which can exceed `stuck_orders.len()`. The list
            is capped so one wedged account cannot return an unbounded response.
          minimum: 0
        stuck_minutes:
          type: integer
          format: int64
          description: >-
            The threshold the list was built with, echoed back so a caller does
            not

            have to remember what it asked for to label the result.
        stuck_orders:
          type: array
          items:
            $ref: '#/components/schemas/StuckOrder'
          description: Orders still open past the staleness threshold, oldest first.
    AmendmentBucket:
      type: object
      description: How many orders carried a given number of amendments.
      required:
        - amendments
        - is_cap
        - order_count
      properties:
        amendments:
          type: integer
          format: int32
          description: >-
            Amendments issued against the order after its placement. The top
            bucket

            is inclusive: it counts every order at or above that many.
          minimum: 0
        is_cap:
          type: boolean
          description: Whether `amendments` is that open-ended top bucket.
        order_count:
          type: integer
          format: int64
          minimum: 0
    StuckOrder:
      type: object
      description: An order the ledger still shows as working, long after it was placed.
      required:
        - order_id
        - account_id
        - broker
        - symbol
        - order_side
        - order_status
        - quantity
        - filled_quantity
        - last_seen_at
        - age_seconds
      properties:
        account_id:
          type: string
          format: uuid
        age_seconds:
          type: integer
          format: int64
        broker:
          type: string
        filled_quantity:
          $ref: '#/components/schemas/Quantity'
        last_seen_at:
          type: string
          format: date-time
          description: When the ledger last heard anything at all about this order.
        order_id:
          type: string
          format: uuid
        order_side:
          type: string
        order_status:
          type: string
        quantity:
          $ref: '#/components/schemas/Quantity'
        symbol:
          type: string
    Quantity:
      type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````