> ## 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 Task Batches



## OpenAPI

````yaml /api-reference/openapi-v2.json post /public-api/v2/workspaces/{workspace_id}/farms/{farm_id}/task-batches/search
openapi: 3.1.0
info:
  title: Nonce Public API
  description: Nonce Public API
  version: 2.0.0
  contact: {}
servers:
  - url: https://api.nonce.app
    description: Production server
security: []
tags: []
paths:
  /public-api/v2/workspaces/{workspace_id}/farms/{farm_id}/task-batches/search:
    post:
      tags:
        - Task Batches
      summary: Search Task Batches
      operationId: SearchTaskBatches
      parameters:
        - name: workspace_id
          required: true
          in: path
          schema:
            type: string
        - name: farm_id
          required: true
          in: path
          schema:
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicTaskBatchSearchBodyDto'
      responses:
        '200':
          description: Task batches matching the search criteria
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          format: uuid
                          pattern: >-
                            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                          description: Task Batch ID
                        task_name:
                          type: string
                          enum:
                            - agent.scan.create
                            - agent.ip_diagnosis.create
                            - agent.self.update
                            - miner.system.reboot
                            - miner.log.get
                            - miner.light.update
                            - miner.power_mode.update
                            - miner.pool.update
                            - miner.pool.lock
                            - miner.firmware.update
                            - miner.tags.update
                            - miner.record.delete
                            - miner.rack_location.update
                          description: >-
                            Task or event type dispatched to miners or agents.
                            Execution types: `miner.system.reboot`,
                            `miner.log.get`, `miner.light.update`,
                            `miner.power_mode.update`, `miner.pool.update`,
                            `miner.pool.lock`, `miner.firmware.update`,
                            `agent.scan.create`, `agent.ip_diagnosis.create`,
                            `agent.self.update`. Event types:
                            `miner.tags.update`, `miner.record.delete`,
                            `miner.rack_location.update`.
                          example: miner.system.reboot
                        status:
                          type: string
                          enum:
                            - pending
                            - succeed
                            - failed
                            - partial_succeed
                          description: >-
                            Aggregate status of a task batch. `pending` = at
                            least one task is still running; `succeed` = all
                            tasks succeeded; `failed` = all tasks failed, timed
                            out, or were cancelled; `partial_succeed` = finished
                            with a mix of success and failure.
                          example: succeed
                        task_count:
                          type: integer
                          minimum: 0
                          maximum: 9007199254740991
                          description: Total tasks in the batch
                        succeed_count:
                          type: integer
                          minimum: 0
                          maximum: 9007199254740991
                          description: Tasks that succeeded
                        unsuccessful_count:
                          type: integer
                          minimum: 0
                          maximum: 9007199254740991
                          description: Tasks that failed, timed out, or were cancelled
                        task_params:
                          description: Batch parameters
                          additionalProperties: {}
                          type:
                            - object
                            - 'null'
                        metadata:
                          description: Batch metadata
                          additionalProperties: {}
                          type:
                            - object
                            - 'null'
                        created_by:
                          description: >-
                            Represents an entity that performs actions in the
                            system (user, API key, or system)
                          properties:
                            type:
                              type: string
                              enum:
                                - user
                                - apikey
                                - system
                              description: The type of actor
                              example: user
                            id:
                              type: string
                              description: The unique identifier of the actor
                              example: user_2xGz1234567890
                            name:
                              description: The display name of the actor
                              example: John Doe
                              type:
                                - string
                                - 'null'
                            avatar:
                              description: The avatar URL of the actor
                              example: https://example.com/avatar.png
                              type:
                                - string
                                - 'null'
                            metadata:
                              description: Additional metadata about the actor
                              type: object
                              additionalProperties: {}
                          required:
                            - type
                            - id
                            - name
                            - avatar
                          title: Actor
                          type:
                            - object
                            - 'null'
                        created_at:
                          type: string
                          format: date-time
                          pattern: >-
                            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
                          description: Batch creation time
                      required:
                        - id
                        - task_name
                        - status
                        - task_count
                        - succeed_count
                        - unsuccessful_count
                        - task_params
                        - metadata
                        - created_by
                        - created_at
                      title: TaskBatchSummary
                  pagination:
                    type: object
                    properties:
                      total:
                        type: integer
                        minimum: 0
                        maximum: 9007199254740991
                      page:
                        type: integer
                        exclusiveMinimum: 0
                        maximum: 9007199254740991
                      page_size:
                        type: integer
                        exclusiveMinimum: 0
                        maximum: 9007199254740991
                      total_pages:
                        type: integer
                        minimum: 0
                        maximum: 9007199254740991
                    required:
                      - total
                      - page
                      - page_size
                      - total_pages
                  error:
                    type: 'null'
                    example: null
                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 OAuth JWT or Workspace 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 credential
        '403':
          description: >-
            Forbidden - Credential does not grant access to the requested
            resource
          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
        '404':
          description: Farm not found
          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: FARM_NOT_FOUND
                  message: Farm not found
        '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:
        - oauth-jwt: []
        - clerk-api-key: []
components:
  schemas:
    PublicTaskBatchSearchBodyDto:
      type: object
      properties:
        status:
          description: Aggregate batch status filter
          type: object
          properties:
            eq:
              type: string
              enum:
                - pending
                - succeed
                - failed
                - partial_succeed
              description: >-
                Aggregate status of a task batch. `pending` = at least one task
                is still running; `succeed` = all tasks succeeded; `failed` =
                all tasks failed, timed out, or were cancelled;
                `partial_succeed` = finished with a mix of success and failure.
              example: succeed
            in:
              minItems: 1
              type: array
              items:
                type: string
                enum:
                  - pending
                  - succeed
                  - failed
                  - partial_succeed
                description: >-
                  Aggregate status of a task batch. `pending` = at least one
                  task is still running; `succeed` = all tasks succeeded;
                  `failed` = all tasks failed, timed out, or were cancelled;
                  `partial_succeed` = finished with a mix of success and
                  failure.
                example: succeed
          additionalProperties: false
        task_name:
          description: Task name filter
          type: object
          properties:
            eq:
              type: string
              enum:
                - agent.scan.create
                - agent.ip_diagnosis.create
                - agent.self.update
                - miner.system.reboot
                - miner.log.get
                - miner.light.update
                - miner.power_mode.update
                - miner.pool.update
                - miner.pool.lock
                - miner.firmware.update
                - miner.tags.update
                - miner.record.delete
                - miner.rack_location.update
              description: >-
                Task or event type dispatched to miners or agents. Execution
                types: `miner.system.reboot`, `miner.log.get`,
                `miner.light.update`, `miner.power_mode.update`,
                `miner.pool.update`, `miner.pool.lock`, `miner.firmware.update`,
                `agent.scan.create`, `agent.ip_diagnosis.create`,
                `agent.self.update`. Event types: `miner.tags.update`,
                `miner.record.delete`, `miner.rack_location.update`.
              example: miner.system.reboot
            in:
              minItems: 1
              type: array
              items:
                type: string
                enum:
                  - agent.scan.create
                  - agent.ip_diagnosis.create
                  - agent.self.update
                  - miner.system.reboot
                  - miner.log.get
                  - miner.light.update
                  - miner.power_mode.update
                  - miner.pool.update
                  - miner.pool.lock
                  - miner.firmware.update
                  - miner.tags.update
                  - miner.record.delete
                  - miner.rack_location.update
                description: >-
                  Task or event type dispatched to miners or agents. Execution
                  types: `miner.system.reboot`, `miner.log.get`,
                  `miner.light.update`, `miner.power_mode.update`,
                  `miner.pool.update`, `miner.pool.lock`,
                  `miner.firmware.update`, `agent.scan.create`,
                  `agent.ip_diagnosis.create`, `agent.self.update`. Event types:
                  `miner.tags.update`, `miner.record.delete`,
                  `miner.rack_location.update`.
                example: miner.system.reboot
          additionalProperties: false
        actor_type:
          description: Creator type filter
          type: object
          properties:
            eq:
              type: string
              enum:
                - user
                - automation
                - api
              description: >-
                Actor type used to filter task batches by creator. `user` =
                batches created by human users through the Nonce app;
                `automation` = batches created by the Automation workflow
                system; `api` = batches created via private-api tokens.
              example: user
          required:
            - eq
          additionalProperties: false
        created_at:
          description: Exclusive creation time bounds
          type: object
          properties:
            gt:
              type: string
              format: date-time
              pattern: >-
                ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
            lt:
              type: string
              format: date-time
              pattern: >-
                ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
          additionalProperties: false
        page:
          default: 1
          type: integer
          exclusiveMinimum: 0
          maximum: 9007199254740991
        page_size:
          default: 20
          type: integer
          exclusiveMinimum: 0
          maximum: 10000
  securitySchemes:
    oauth-jwt:
      scheme: bearer
      bearerFormat: JWT
      type: http
      description: Clerk OAuth JWT access token
    clerk-api-key:
      scheme: bearer
      bearerFormat: API Key
      type: http
      description: Workspace API key

````