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

# Create Agent Self Update Task Batch

> Trigger a self-update on the agents in the farm.



## OpenAPI

````yaml /api-reference/openapi-v2.json post /public-api/v2/workspaces/{workspace_id}/farms/{farm_id}/task-batches/agent-self-update
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/agent-self-update:
    post:
      tags:
        - Task Batches
      summary: Create Agent Self Update Task Batch
      description: Trigger a self-update on the agents in the farm.
      operationId: CreateAgentSelfUpdateTaskBatch
      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/CreateAgentSelfUpdateDto'
      responses:
        '200':
          description: Task batch created
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: object
                    properties:
                      batches:
                        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
                                - agent.pause
                                - agent.resume
                                - agent.ip_report.start
                                - agent.ip_report.stop
                                - miner.system.reboot
                                - miner.log.get
                                - miner.light.update
                                - miner.power_mode.update
                                - miner.pool.update
                                - miner.pool.lock
                                - miner.firmware.update
                                - miner.network.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`, `agent.pause`,
                                `agent.resume`, `agent.ip_report.start`,
                                `agent.ip_report.stop`. Event types:
                                `miner.tags.update`, `miner.record.delete`,
                                `miner.rack_location.update`.
                              example: miner.system.reboot
                            task_count:
                              type: integer
                              minimum: 0
                              maximum: 9007199254740991
                              description: Tasks created in this batch
                            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
                            - task_count
                            - task_params
                            - metadata
                            - created_by
                            - created_at
                        description: Created task batches
                      summary:
                        type: object
                        properties:
                          created_count:
                            type: integer
                            minimum: 0
                            maximum: 9007199254740991
                            description: Miners with tasks created
                          skipped_count:
                            type: integer
                            minimum: 0
                            maximum: 9007199254740991
                            description: Miners skipped
                          failed_count:
                            type: integer
                            minimum: 0
                            maximum: 9007199254740991
                            description: Miners that failed to process
                        required:
                          - created_count
                          - skipped_count
                          - failed_count
                      skipped:
                        description: Skipped miners grouped by reason
                        type: array
                        items:
                          type: object
                          properties:
                            reason:
                              type: string
                              enum:
                                - no_change
                                - unsupported_mode
                                - miner_not_found
                                - unstable_miner
                              description: >-
                                Reason a miner was skipped during task batch
                                creation. `no_change` = miner is already in the
                                requested state; `unsupported_mode` = miner
                                hardware does not support the requested mode;
                                `miner_not_found` = miner id was not found in
                                the workspace or farm; `unstable_miner` = miner
                                row is flagged unstable and cannot accept
                                actions.
                              example: no_change
                            message:
                              type: string
                              description: Human-readable skip explanation
                            miner_ids:
                              type: array
                              items:
                                type: string
                              description: Affected miner IDs
                          required:
                            - reason
                            - message
                            - miner_ids
                    required:
                      - batches
                      - summary
                    title: CreateTaskBatchResult
                    description: Result of a task batch creation.
                  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: 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:
    CreateAgentSelfUpdateDto:
      type: object
      properties:
        params:
          type: object
          properties:
            binary_url:
              description: Agent binary download URL
              type: string
            md5:
              description: Legacy MD5 checksum
              type: string
            signature:
              description: Ed25519 detached signature of the agent binary
              type: string
            target_version:
              description: Target agent version
              example: v0.4.30
              type: string
          additionalProperties: false
          description: Agent self-update parameters.
      required:
        - params
  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

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.