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

# Search Miners

> Search miners in the farm with operator-object filters. Supports id, agent_id, sn, mac, status, ops_status, and ip_ranges criteria. `lifecycle_statuses` is the legacy combined filter; still accepted for backward compatibility (values are auto-routed to status / ops_status). `health_statuses` is deprecated and ignored at runtime. Omit body for an unfiltered first-page list.



## OpenAPI

````yaml /api-reference/openapi.json post /private-api/v1/{workspace_id}/farms/{farm_id}/miner/search
openapi: 3.1.0
info:
  title: Nonce Private API
  description: |-
    Nonce Private API documentation - Internal endpoints for system integration

    Generated by NestJS Swagger Module with nestjs-zod
    Scope: Private API endpoints only (/private-api/*)
    Do not edit this file manually - regenerate with: pnpm run docs:openapi
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.nonce.app
    description: Production server
security: []
tags: []
paths:
  /private-api/v1/{workspace_id}/farms/{farm_id}/miner/search:
    post:
      tags:
        - Private API
        - Farm
      summary: Search Miners
      description: >-
        Search miners in the farm with operator-object filters. Supports id,
        agent_id, sn, mac, status, ops_status, and ip_ranges criteria.
        `lifecycle_statuses` is the legacy combined filter; still accepted for
        backward compatibility (values are auto-routed to status / ops_status).
        `health_statuses` is deprecated and ignored at runtime. Omit body for an
        unfiltered first-page list.
      operationId: SearchMiners
      parameters:
        - name: workspace_id
          required: true
          in: path
          schema:
            type: string
        - name: farm_id
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MinerSearchRequestDto'
      responses:
        '200':
          description: Successfully retrieved miner status
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                    description: Indicates if the request was successful
                  data:
                    type: array
                    description: Array of items
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          description: Miner Id
                          example: 002b1a50fa281efe0f320ebc39f5047b
                        farm_id:
                          type: string
                          description: Farm Id (uuid generated by nonce system)
                          example: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
                        farm:
                          type: object
                          properties:
                            id:
                              type: string
                              description: Farm Id (uuid generated by nonce system)
                              example: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
                            name:
                              description: Farm Name
                              example: Farm Name
                              type:
                                - string
                                - 'null'
                          required:
                            - id
                            - name
                          title: Farm Reference
                          description: Farm details
                        workspace_id:
                          type: string
                          description: Workspace Id
                          example: org_xxxxxxxxxxxxxxxxxxxxxxxxxxx
                        serial_number:
                          description: Serial number
                          example: HTM3FS28HD25011939878367054H36045
                          type:
                            - string
                            - 'null'
                        model:
                          description: Miner model
                          example: Antminer S19
                          type:
                            - string
                            - 'null'
                        ip:
                          type: string
                          description: IP address
                          example: 192.168.1.100
                        mac:
                          type: string
                          description: MAC address
                          example: 00:1B:44:11:3A:B7
                        firmware_version:
                          description: Firmware version
                          example: 20250304.15.REL
                          type:
                            - string
                            - 'null'
                        rack:
                          description: >-
                            Rack identifier where the miner is physically
                            located. Null when the miner has not been assigned
                            to a rack.
                          example: A1
                          type:
                            - string
                            - 'null'
                        position:
                          description: >-
                            Slot position within the rack (1-based). Null when
                            the miner has not been assigned to a rack slot.
                          example: 3
                          minimum: -9007199254740991
                          maximum: 9007199254740991
                          type:
                            - integer
                            - 'null'
                        is_mining:
                          type: boolean
                          description: Whether the miner is actively mining
                          example: true
                        last_check_succeed:
                          type: boolean
                          description: Whether the last health check succeeded
                          example: true
                        stale:
                          type: boolean
                          description: Whether the miner has stale data
                          example: false
                        overheat:
                          type: boolean
                          description: >-
                            Deprecated. Check anomaly_flags with `temperature`
                            bit. Always false.
                          example: false
                          deprecated: true
                        low_hashrate:
                          type: boolean
                          description: >-
                            Deprecated. Derive from hashrate /
                            expected_hashrate. Always false.
                          example: false
                          deprecated: true
                        overpower:
                          type: boolean
                          description: >-
                            Deprecated. Check anomaly_flags with `power` bit.
                            Always false.
                          example: false
                          deprecated: true
                        underpower:
                          type: boolean
                          description: >-
                            Deprecated. Check anomaly_flags with `power` bit.
                            Always false.
                          example: false
                          deprecated: true
                        status:
                          type: string
                          description: >-
                            Run status. `online` = currently reporting; `stale`
                            = no recent reports.
                          example: online
                          enum:
                            - online
                            - stale
                        ops_status:
                          description: >-
                            Ops status (operator-managed). NULL when miner has
                            no ops intervention. Values: maintenance / retired /
                            off_rack / transit / archived.
                          example: null
                          enum:
                            - maintenance
                            - retired
                            - off_rack
                            - transit
                            - archived
                            - null
                          type:
                            - string
                            - 'null'
                        unstable_reason:
                          description: >-
                            Unstable reason. NULL when miner is stable (mac/sn
                            valid + unique). Set when the raw could not be
                            reliably matched to a stable identity (mac_invalid /
                            mac_duplicate / sn_invalid / sn_duplicate /
                            mac_empty / sn_empty / all_invalid / ip_only).
                          example: null
                          type:
                            - string
                            - 'null'
                        lifecycle_status:
                          description: >-
                            **Deprecated** — legacy combined lifecycle status,
                            derived from `ops_status ?? status` for backward
                            compatibility. New clients should consume `status`
                            (online/stale) and `ops_status`
                            (maintenance/retired/off_rack/transit/archived)
                            separately. Will be removed in a future major
                            version.
                          example: online
                          enum:
                            - online
                            - offline
                            - stale
                            - archived
                            - off_rack
                            - transit
                            - maintenance
                            - retired
                          deprecated: true
                          type:
                            - string
                            - 'null'
                        health_status:
                          description: >-
                            Deprecated. Replaced by anomaly_flags (anomalies),
                            derived hashrate/expected_hashrate (low hashrate),
                            and mining_mode (overclocking). Always null.
                          example: null
                          deprecated: true
                          type:
                            - string
                            - 'null'
                        anomaly_flags:
                          default: 0
                          description: >-
                            Bitmask of active anomaly types. Each bit
                            corresponds to a specific anomaly: bit 0=fan,
                            1=power, 2=temperature, 3=hashboard, 4=network,
                            5=firmware, 6=unknown, 8=control_board, 9=pool. Use
                            bitwise AND to check for specific anomalies.
                          example: 0
                          type: integer
                          minimum: -9007199254740991
                          maximum: 9007199254740991
                        mining_mode:
                          type: string
                          description: >-
                            Current mining mode of the miner. Possible values:
                            sleep, low, normal, high

                            AntMiner supports: sleep, low, normal

                            WhatsMiner supports: sleep, low, normal, high

                            Reference:
                            https://github.com/UpstreamData/pyasic/blob/master/pyasic/config/mining/__init__.py
                          example: normal
                        mining_mode_preset:
                          description: >-
                            Processed preset name for preset-mode miners. Null
                            for non-preset miners.
                          type:
                            - string
                            - 'null'
                        hashrate:
                          description: Hashrate value in H/s
                          example: 100120000000000
                          type:
                            - number
                            - 'null'
                        hashrate_24h:
                          description: 24-hour average hashrate in H/s
                          example: 100120000000000
                          type:
                            - number
                            - 'null'
                        power:
                          description: Power consumption in watts
                          example: 9771
                          type:
                            - number
                            - 'null'
                        temp:
                          description: Temperature in Celsius
                          example: 75.5
                          type:
                            - number
                            - 'null'
                        temperature_inlet_avg:
                          description: Average inlet temperature in Celsius
                          example: 35.5
                          type:
                            - number
                            - 'null'
                        temperature_outlet_avg:
                          description: Average outlet temperature in Celsius
                          example: 65.5
                          type:
                            - number
                            - 'null'
                        efficiency:
                          description: Power efficiency in J/TH
                          example: 34
                          type:
                            - number
                            - 'null'
                        uptime:
                          type: number
                          description: Uptime in seconds
                          example: 86400
                        last_updated_at:
                          description: Timestamp of last updated. ISO Format
                          example: '2025-08-27T00:00:00Z'
                          type:
                            - string
                            - 'null'
                        created_at:
                          description: >-
                            Timestamp when the agent first discovered and
                            registered this miner. ISO Format. Persistent — not
                            reset by reboots or rescans.
                          example: '2025-08-27T00:00:00Z'
                          type:
                            - string
                            - 'null'
                        errors:
                          type: array
                          items:
                            type: object
                            properties:
                              code:
                                type: string
                                description: Error code
                                example: E001
                              message:
                                description: Error message
                                example: Temperature too high
                                type:
                                  - string
                                  - 'null'
                            required:
                              - code
                              - message
                          description: Array of error objects
                        hashboards:
                          type: array
                          items:
                            type: object
                            properties:
                              serial_number:
                                description: Hashboard serial number
                                example: HB123456
                                type:
                                  - string
                                  - 'null'
                              hashrate:
                                description: Hashboard hashrate in H/s
                                example: 25120000000000
                                type:
                                  - number
                                  - 'null'
                              chips:
                                description: Number of chips on the hashboard
                                example: 4
                                type:
                                  - number
                                  - 'null'
                              chip_frequency:
                                description: Chip frequency in MHz
                                example: 650
                                type:
                                  - number
                                  - 'null'
                            required:
                              - serial_number
                              - hashrate
                              - chips
                              - chip_frequency
                          description: Array of hashboard objects
                        total_chips:
                          description: Total number of chips
                          example: 5
                          type:
                            - number
                            - 'null'
                        expected_chips:
                          description: Expected number of chips
                          example: 4
                          type:
                            - number
                            - 'null'
                        pools:
                          default: []
                          description: Array of pool objects
                          type: array
                          items:
                            type: object
                            properties:
                              url:
                                description: Mining pool URL
                                example: stratum+tcp://pool.example.com:4444
                                type: string
                              worker_id:
                                description: Worker ID for the mining pool
                                example: worker1.100x0x217
                                type: string
                              difficulty_accepted:
                                description: Accepted share difficulty
                                example: 354515730432
                                type:
                                  - number
                                  - 'null'
                              difficulty_rejected:
                                description: Rejected share difficulty
                                example: 53477376
                                type:
                                  - number
                                  - 'null'
                              difficulty_stale:
                                description: Stale share difficulty
                                example: 0
                                type:
                                  - number
                                  - 'null'
                        psus:
                          default: []
                          description: Array of power supply unit objects
                          type: array
                          items:
                            type: object
                            properties:
                              serial_number:
                                description: Power supply unit serial number
                                example: 1717A2446600193
                                type:
                                  - string
                                  - 'null'
                              temperature:
                                description: Power supply unit temperature in Celsius
                                example: 56.7
                                type:
                                  - number
                                  - 'null'
                            required:
                              - serial_number
                              - temperature
                      required:
                        - id
                        - farm_id
                        - farm
                        - workspace_id
                        - serial_number
                        - model
                        - ip
                        - mac
                        - firmware_version
                        - rack
                        - position
                        - is_mining
                        - last_check_succeed
                        - stale
                        - overheat
                        - low_hashrate
                        - overpower
                        - underpower
                        - status
                        - ops_status
                        - unstable_reason
                        - lifecycle_status
                        - health_status
                        - mining_mode
                        - mining_mode_preset
                        - hashrate
                        - hashrate_24h
                        - power
                        - temp
                        - temperature_inlet_avg
                        - temperature_outlet_avg
                        - efficiency
                        - uptime
                        - last_updated_at
                        - created_at
                        - errors
                        - hashboards
                        - total_chips
                        - expected_chips
                      title: Miner
                  pagination:
                    type: object
                    description: Pagination metadata
                    properties:
                      total:
                        type: number
                        example: 50
                        description: Total number of items
                      limit:
                        type: number
                        example: 10
                        description: Maximum number of items per page
                      offset:
                        type: number
                        example: 0
                        description: Number of items to skip
                      hasNext:
                        type: boolean
                        example: true
                        description: Whether there are more items after this page
                      hasPrevious:
                        type: boolean
                        example: false
                        description: Whether there are items before this page
                    required:
                      - total
                      - limit
                      - offset
                      - hasNext
                      - hasPrevious
                  error:
                    type: 'null'
                    example: null
                    description: Error object (null on success)
                required:
                  - success
                  - data
                  - pagination
                  - error
        '400':
          description: Bad Request - Invalid parameters
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    description: HTTP status code
                    example: 400
                  message:
                    type: string
                    description: Error message
                    example: Invalid request parameters
                  error:
                    type: string
                    description: Error type
                    example: Bad Request
                required:
                  - statusCode
                  - message
                  - error
        '401':
          description: Unauthorized - Invalid or missing API key
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    description: HTTP status code
                    example: 401
                  message:
                    type: string
                    description: Error message
                    example: Invalid or missing API key
                  error:
                    type: string
                    description: Error type
                    example: Unauthorized
                required:
                  - statusCode
                  - message
                  - error
        '403':
          description: Forbidden - Valid API key but insufficient permissions
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    description: HTTP status code
                    example: 403
                  message:
                    type: string
                    description: Error message
                    example: Access denied to workspace
                  error:
                    type: string
                    description: Error type
                    example: Forbidden
                required:
                  - statusCode
                  - message
                  - error
      security:
        - clerk-api-key: []
components:
  schemas:
    MinerSearchRequestDto:
      type: object
      properties:
        id:
          description: >-
            Miner ID filter. Supports exact match (`eq`) or set membership
            (`in`).
          example:
            in:
              - miner_abc123
              - miner_def456
          type: object
          properties:
            eq:
              type: string
            in:
              type: array
              items:
                type: string
          additionalProperties: false
        agent_id:
          type: object
          properties:
            eq:
              type: string
            contains:
              type: string
          additionalProperties: false
          description: String filter operators. Provide at least one operator.
          example:
            contains: S19
        sn:
          type: object
          properties:
            eq:
              type: string
            contains:
              type: string
          additionalProperties: false
          description: String filter operators. Provide at least one operator.
          example:
            contains: S19
        mac:
          type: object
          properties:
            eq:
              type: string
            contains:
              type: string
          additionalProperties: false
          description: String filter operators. Provide at least one operator.
          example:
            contains: S19
        status:
          description: 'Run status filter. Accepted values: `online`, `stale`.'
          type: object
          properties:
            eq:
              type: string
            in:
              type: array
              items:
                type: string
          additionalProperties: false
          example:
            in:
              - online
              - offline
        ops_status:
          description: >-
            Ops status filter. Accepted values: `maintenance`, `retired`,
            `off_rack`, `transit`, `archived`.
          type: object
          properties:
            eq:
              type: string
            in:
              type: array
              items:
                type: string
          additionalProperties: false
          example:
            in:
              - online
              - offline
        unstable:
          description: >-
            Unstable filter. `true` returns only miners with non-null
            `unstable_reason`. Omit to include both stable and unstable miners.
          type: boolean
        lifecycle_statuses:
          deprecated: true
          description: >-
            **Deprecated** — legacy combined filter. Use `status` and
            `ops_status` instead. Values are auto-routed to the matching axis.
            Note: run-state and ops-state are now independent — filtering by a
            run-state value (e.g. `online`) no longer excludes miners with an
            ops_status set. Will be removed in a future major version.
          type: object
          properties:
            eq:
              type: string
            in:
              type: array
              items:
                type: string
          additionalProperties: false
          example:
            in:
              - online
              - offline
        health_statuses:
          deprecated: true
          description: >-
            **Deprecated** — accepted for backward compatibility but ignored at
            runtime. Use `anomaly_filters` (anomaly bitmask) or
            `hashrate_realization` (ratio range) instead.
          type: object
          properties:
            eq:
              type: string
            in:
              type: array
              items:
                type: string
          additionalProperties: false
          example:
            in:
              - online
              - offline
        ip_ranges:
          description: >-
            Filter miners by IPv4 ranges. A miner matches if its IP falls into
            any of the provided ranges. Each item accepts one of: single address
            `192.168.1.5`, CIDR `192.168.1.0/24`, or hyphen range
            `192.168.1.1-192.168.1.254`. At most 10 ranges per request.
          example:
            - 192.168.1.5
            - 192.168.144.0/24
            - 10.0.0.1-10.0.0.50
          maxItems: 10
          type: array
          items:
            type: string
            pattern: >-
              ^(?:(?:(25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(25[0-5]|2[0-4]\d|[01]?\d\d?)\/(?:3[0-2]|[12]?\d)|(?:(25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(25[0-5]|2[0-4]\d|[01]?\d\d?)-(?:(25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:(25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(25[0-5]|2[0-4]\d|[01]?\d\d?))$
        page:
          type: integer
          minimum: 1
          maximum: 9007199254740991
        limit:
          type: integer
          minimum: 1
          maximum: 10000
  securitySchemes:
    clerk-api-key:
      scheme: bearer
      bearerFormat: API Key
      type: http
      description: Clerk Machine API Key for authentication

````