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

# Get Task Batch



## OpenAPI

````yaml /api-reference/openapi-v2.json get /public-api/v2/workspaces/{workspace_id}/farms/{farm_id}/task-batches/{task_batch_id}
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/{task_batch_id}:
    get:
      tags:
        - Task Batches
      summary: Get Task Batch
      operationId: GetTaskBatch
      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)$
        - name: task_batch_id
          required: true
          in: path
          description: Task Batch ID
          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)$
      responses:
        '200':
          description: Task batch detail and status counts
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    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
                      created_count:
                        type: integer
                        minimum: 0
                        maximum: 9007199254740991
                        description: Tasks waiting for an agent
                      queuing_count:
                        type: integer
                        minimum: 0
                        maximum: 9007199254740991
                        description: Tasks waiting in an agent queue
                      pending_count:
                        type: integer
                        minimum: 0
                        maximum: 9007199254740991
                        description: Tasks currently executing
                      failed_count:
                        type: integer
                        minimum: 0
                        maximum: 9007199254740991
                        description: Tasks that failed
                      timed_out_count:
                        type: integer
                        minimum: 0
                        maximum: 9007199254740991
                        description: Tasks that timed out
                      cancelled_count:
                        type: integer
                        minimum: 0
                        maximum: 9007199254740991
                        description: Tasks that were cancelled
                    required:
                      - id
                      - task_name
                      - status
                      - task_count
                      - succeed_count
                      - unsuccessful_count
                      - task_params
                      - metadata
                      - created_by
                      - created_at
                      - created_count
                      - queuing_count
                      - pending_count
                      - failed_count
                      - timed_out_count
                      - cancelled_count
                    title: TaskBatch
                  error:
                    type: 'null'
                    example: null
                required:
                  - success
                  - data
                  - 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: Task batch 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: TASK_BATCH_NOT_FOUND
                  message: Task batch 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:
  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

````