> ## 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, tags, and ip_ranges criteria. `lifecycle_statuses` is the legacy combined filter; still accepted for backward compatibility (values are auto-routed to status / tags). `health_statuses` is deprecated and ignored at runtime. Omit body for an unfiltered first-page list.



## OpenAPI

````yaml /api-reference/openapi-legacy.json post /private-api/v1/{workspace_id}/farms/{farm_id}/miners/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}/miners/search:
    post:
      tags:
        - Miners
      summary: Search Miners
      description: >-
        Search miners in the farm with operator-object filters. Supports id,
        agent_id, sn, mac, status, tags, and ip_ranges criteria.
        `lifecycle_statuses` is the legacy combined filter; still accepted for
        backward compatibility (values are auto-routed to status / tags).
        `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
                          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
                        network:
                          default: null
                          description: >-
                            Network configuration read from the miner, null
                            before the agent has reported it
                          properties:
                            mode:
                              description: How the address is assigned
                              enum:
                                - dhcp
                                - static
                              type:
                                - string
                                - 'null'
                            ip:
                              description: Address currently in use
                              type:
                                - string
                                - 'null'
                            netmask:
                              description: Subnet mask currently in use
                              type:
                                - string
                                - 'null'
                            gateway:
                              description: >-
                                Gateway in use. Null when the firmware does not
                                report one, which is the case for Antminer
                                derivatives on DHCP
                              type:
                                - string
                                - 'null'
                            dns:
                              description: >-
                                DNS servers in use, semicolon separated when
                                there are several
                              type:
                                - string
                                - 'null'
                          required:
                            - mode
                            - ip
                            - netmask
                            - gateway
                            - dns
                          type:
                            - object
                            - 'null'
                        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
                        tags:
                          default: []
                          description: >-
                            Operator-managed labels (multi-value). Preset
                            values: maintenance / retired / off_rack / transit /
                            archived, plus free-form custom tags. Empty array
                            when none set.
                          example: []
                          type: array
                          items:
                            type: string
                        ops_status:
                          deprecated: true
                          description: >-
                            Deprecated; always null. Operator labels moved to
                            `tags`.
                          type:
                            - string
                            - 'null'
                        lifecycle_status:
                          deprecated: true
                          description: >-
                            Deprecated; always null. Derive from `status` and
                            `tags`.
                          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'
                        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'
                        expected_hashrate:
                          description: Expected hashrate in H/s
                          example: 125000000000000
                          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
                        reboot_count:
                          description: >-
                            Total reboots aggregated from daily miner_metrics
                            over the default 7-day window. Null when no metrics
                            have been computed yet. >= 10 in 7 days is
                            considered high-frequency.
                          minimum: -9007199254740991
                          maximum: 9007199254740991
                          type:
                            - integer
                            - 'null'
                        low_uptime_reboot_count:
                          description: >-
                            Reboots where pre-reboot uptime was < 10 min (boot
                            cycling), aggregated over the default 7-day window.
                            Null when no metrics have been computed yet. High
                            ratio (> 50% of reboot_count) suggests hardware
                            fault.
                          minimum: -9007199254740991
                          maximum: 9007199254740991
                          type:
                            - integer
                            - 'null'
                      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
                        - lifecycle_status
                        - unstable_reason
                        - health_status
                        - mining_mode
                        - mining_mode_preset
                        - hashrate
                        - expected_hashrate
                        - hashrate_24h
                        - power
                        - temp
                        - temperature_inlet_avg
                        - temperature_outlet_avg
                        - efficiency
                        - uptime
                        - last_updated_at
                        - created_at
                        - errors
                        - hashboards
                        - total_chips
                        - expected_chips
                        - reboot_count
                        - low_uptime_reboot_count
                      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:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: 'null'
                    example: null
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      details:
                        type: object
                        properties:
                          field_errors:
                            type: array
                            items:
                              type: object
                              properties:
                                path:
                                  type: string
                                message:
                                  type: string
                              required:
                                - path
                                - message
                              additionalProperties: false
                        additionalProperties: {}
                      traceId:
                        type: string
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - success
                  - data
                  - error
                additionalProperties: false
              example:
                success: false
                data: null
                error:
                  code: VALIDATION_ERROR
                  message: Validation failed
        '401':
          description: Unauthorized - Invalid or missing API key
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: 'null'
                    example: null
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      details:
                        type: object
                        properties:
                          field_errors:
                            type: array
                            items:
                              type: object
                              properties:
                                path:
                                  type: string
                                message:
                                  type: string
                              required:
                                - path
                                - message
                              additionalProperties: false
                        additionalProperties: {}
                      traceId:
                        type: string
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - success
                  - data
                  - error
                additionalProperties: false
              example:
                success: false
                data: null
                error:
                  code: UNAUTHORIZED
                  message: Invalid or missing API key
        '403':
          description: Forbidden - Valid API key but insufficient permissions
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: 'null'
                    example: null
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      details:
                        type: object
                        properties:
                          field_errors:
                            type: array
                            items:
                              type: object
                              properties:
                                path:
                                  type: string
                                message:
                                  type: string
                              required:
                                - path
                                - message
                              additionalProperties: false
                        additionalProperties: {}
                      traceId:
                        type: string
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - success
                  - data
                  - error
                additionalProperties: false
              example:
                success: false
                data: null
                error:
                  code: FORBIDDEN
                  message: Access denied to workspace
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  data:
                    type: 'null'
                    example: null
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                      details:
                        type: object
                        properties:
                          field_errors:
                            type: array
                            items:
                              type: object
                              properties:
                                path:
                                  type: string
                                message:
                                  type: string
                              required:
                                - path
                                - message
                              additionalProperties: false
                        additionalProperties: {}
                      traceId:
                        type: string
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - success
                  - data
                  - error
                additionalProperties: false
              example:
                success: false
                data: null
                error:
                  code: INTERNAL_SERVER_ERROR
                  message: Internal server 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
            ne:
              type: string
            in:
              type: array
              items:
                type: string
            nin:
              type: array
              items:
                type: string
          additionalProperties: false
        agent_id:
          description: Agent ID filter. Use exact match (`eq`) with the agent UUID.
          example:
            eq: 123e4567-e89b-12d3-a456-426614174000
          type: object
          properties:
            eq:
              type: string
            contains:
              type: string
          additionalProperties: false
        sn:
          description: Miner serial number filter. Use exact match (`eq`).
          example:
            eq: HTM3FS28HD25011939878367054H36045
          type: object
          properties:
            eq:
              type: string
            contains:
              type: string
          additionalProperties: false
        mac:
          description: Miner MAC address filter. Use exact match (`eq`).
          example:
            eq: 00:1A:2B:3C:4D:5E
          type: object
          properties:
            eq:
              type: string
            contains:
              type: string
          additionalProperties: false
        status:
          description: 'Run status filter. Accepted values: `online`, `stale`.'
          example:
            in:
              - online
              - stale
          type: object
          properties:
            eq:
              type: string
            ne:
              type: string
            in:
              type: array
              items:
                type: string
            nin:
              type: array
              items:
                type: string
          additionalProperties: false
        tags:
          description: >-
            Tag filter (operator-managed labels). Overlap match. Preset values:
            `maintenance`, `retired`, `off_rack`, `transit`, `archived`, plus
            free-form custom tags.
          example:
            in:
              - maintenance
              - building-a
          type: object
          properties:
            eq:
              type: string
            ne:
              type: string
            in:
              type: array
              items:
                type: string
            nin:
              type: array
              items:
                type: string
          additionalProperties: false
        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 `tags`
            instead. Values are auto-routed to the matching axis. Note:
            run-state and tags are independent — filtering by a run-state value
            (e.g. `online`) does not exclude miners carrying tags. Will be
            removed in a future major version.
          type: object
          properties:
            eq:
              type: string
            ne:
              type: string
            in:
              type: array
              items:
                type: string
            nin:
              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
            ne:
              type: string
            in:
              type: array
              items:
                type: string
            nin:
              type: array
              items:
                type: string
          additionalProperties: false
          example:
            in:
              - online
              - offline
        network_mode:
          description: >-
            Network mode filter. `unknown` matches miners whose firmware does
            not report a mode or that have not been collected yet.
          example:
            in:
              - dhcp
              - unknown
          type: object
          properties:
            eq:
              type: string
              enum:
                - dhcp
                - static
                - unknown
            ne:
              type: string
              enum:
                - dhcp
                - static
                - unknown
            in:
              type: array
              items:
                type: string
                enum:
                  - dhcp
                  - static
                  - unknown
            nin:
              type: array
              items:
                type: string
                enum:
                  - dhcp
                  - static
                  - unknown
          additionalProperties: false
        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:
          description: Page number, starting at 1
          example: 1
          type: integer
          minimum: 1
          maximum: 9007199254740991
        limit:
          description: Results per page
          example: 50
          type: integer
          minimum: 1
          maximum: 10000
  securitySchemes:
    clerk-api-key:
      scheme: bearer
      bearerFormat: API Key
      type: http
      description: Clerk Machine API Key for authentication

````