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

# Update Worker

> Updates build and runtime settings. Every field is optional; only what you send is changed.

Settings are written through either way, but a running worker keeps serving the build it already has. Pass `redeploy: true` to rebuild immediately, or call `POST /workers/{worker}/actions` with `deploy` later.



## OpenAPI

````yaml PATCH /workers/{worker}
openapi: 3.0.3
info:
  title: CloudBlast API
  description: >-
    The CloudBlast V2 API provides a modern RESTful interface for managing your
    cloud infrastructure programmatically. All responses follow a consistent `{
    "data": ... }` or `{ "error": ... }` format.
  version: 2.0.0
servers:
  - url: https://console.cloudblast.io/api/v2
    description: Production
security:
  - bearerAuth: []
paths:
  /workers/{worker}:
    patch:
      tags:
        - Workers
      summary: Update a worker
      description: >-
        Updates build and runtime settings. Every field is optional; only what
        you send is changed.


        Settings are written through either way, but a running worker keeps
        serving the build it already has. Pass `redeploy: true` to rebuild
        immediately, or call `POST /workers/{worker}/actions` with `deploy`
        later.
      operationId: updateWorker
      parameters:
        - $ref: '#/components/parameters/WorkerIdentifier'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateWorkerRequest'
      responses:
        '200':
          description: Updated worker
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Worker'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthenticated'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          description: Worker has not been provisioned yet.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: WORKER_STATE_CONFLICT
                  message: Worker has not been provisioned yet.
        '422':
          $ref: '#/components/responses/ValidationError'
components:
  parameters:
    WorkerIdentifier:
      name: worker
      in: path
      required: true
      schema:
        type: string
        format: uuid
      description: Worker UUID, as returned in the `uuid` field.
      example: 7c9e6679-7425-40de-944b-e07fc1f90ae7
  schemas:
    UpdateWorkerRequest:
      type: object
      description: Every field is optional. Only what you send is changed.
      properties:
        name:
          type: string
          maxLength: 191
        git_repository:
          type: string
          maxLength: 500
        git_source:
          type: string
          enum:
            - public
            - github
            - template
            - database
        git_branch:
          type: string
          maxLength: 191
          nullable: true
        build_pack:
          type: string
          enum:
            - nixpacks
            - static
            - dockerfile
        ports_exposes:
          type: string
          maxLength: 64
          nullable: true
        base_directory:
          type: string
          maxLength: 255
          nullable: true
        publish_directory:
          type: string
          maxLength: 255
          nullable: true
        install_command:
          type: string
          maxLength: 1000
          nullable: true
        build_command:
          type: string
          maxLength: 1000
          nullable: true
        start_command:
          type: string
          maxLength: 1000
          nullable: true
        is_spa:
          type: boolean
        redeploy:
          type: boolean
          default: false
          description: Rebuild straight away so the new settings take effect.
    Worker:
      type: object
      properties:
        uuid:
          type: string
          format: uuid
          description: Worker handle. Use this as the `{worker}` path parameter.
          example: 7c9e6679-7425-40de-944b-e07fc1f90ae7
        name:
          type: string
          example: api-worker
        status:
          type: string
          description: >-
            Lifecycle state. `provisioning` means the first build is running;
            `failed` means it did not come up and can be retried with a `deploy`
            action.
          enum:
            - pending
            - provisioning
            - active
            - suspended
            - abuse_suspended
            - cancelled
            - deleting
            - failed
          example: active
        runtime_status:
          type: string
          nullable: true
          description: Container state, such as `running`, `starting` or `exited`.
          example: running
        runtime_status_at:
          type: string
          format: date-time
          nullable: true
          description: When the container state was last read.
        provisioned:
          type: boolean
          description: False until the first build has produced an application.
          example: true
        last_deployment_status:
          type: string
          nullable: true
          description: >-
            Status of the most recent build, such as `queued`, `in_progress`,
            `finished` or `failed`.
          example: finished
        last_deployment_at:
          type: string
          format: date-time
          nullable: true
        last_error:
          type: string
          nullable: true
          description: >-
            Why the last action failed, in plain language. `null` when the
            worker is healthy.
        fqdn:
          type: string
          nullable: true
          description: Hostname the worker is served on, once it has one.
          example: api-worker.workers.cloudblast.io
        location_id:
          type: integer
          description: Worker location, from `GET /workers/locations`.
          example: 1
        git_source:
          type: string
          enum:
            - public
            - github
            - template
            - database
          example: public
        git_repository:
          type: string
          description: >-
            Repository URL, or the template id for a `template` or `database`
            worker.
          example: https://github.com/example/app
        git_branch:
          type: string
          nullable: true
          description: Branch that is built.
          example: main
        build_pack:
          type: string
          enum:
            - nixpacks
            - static
            - dockerfile
          example: nixpacks
        ports_exposes:
          type: string
          nullable: true
          description: Port the container listens on.
          example: '3000'
        base_directory:
          type: string
          nullable: true
          description: Directory inside the repository the build runs from.
        publish_directory:
          type: string
          nullable: true
          description: Directory served for a `static` build.
        install_command:
          type: string
          nullable: true
          description: Overrides the detected install step.
        build_command:
          type: string
          nullable: true
          description: Overrides the detected build step.
        start_command:
          type: string
          nullable: true
          description: Overrides the detected start command.
        is_spa:
          type: boolean
          description: >-
            Serve a static build as a single-page app, routing unknown paths to
            the index.
          example: false
        limits:
          type: object
          description: >-
            Hard container caps, stamped at creation from the account level. A
            worker keeps the limits it was created with even after the account
            levels up.
          properties:
            cpu:
              type: number
              nullable: true
              description: Cores
              example: 1
            memory_mb:
              type: integer
              nullable: true
              example: 1024
            disk_mb:
              type: integer
              nullable: true
              example: 5120
        usage:
          type: object
          description: Last measured consumption. `null` before anything has been measured.
          properties:
            cpu_percent:
              type: number
              nullable: true
              example: 3.5
            memory_mb:
              type: integer
              nullable: true
              example: 184
            disk_mb:
              type: integer
              nullable: true
              example: 612
        billing_type:
          type: string
          description: Workers are billed by measured usage, charged hourly.
          enum:
            - hourly
          example: hourly
        suspended_at:
          type: string
          format: date-time
          nullable: true
        suspension_reason:
          type: string
          nullable: true
          description: Why the worker was suspended, when it was.
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        location:
          $ref: '#/components/schemas/WorkerLocation'
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: Machine-readable error code
            message:
              type: string
              description: Human-readable error message
          required:
            - code
            - message
    WorkerLocation:
      type: object
      properties:
        id:
          type: integer
          description: Pass as `location_id` when deploying.
          example: 1
        name:
          type: string
          example: Frankfurt
        short_code:
          type: string
          example: fra
        description:
          type: string
          nullable: true
          example: Germany
        out_of_stock:
          type: boolean
          description: >-
            True when no node in this location can currently take another
            worker.
          example: false
  responses:
    BadRequest:
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthenticated:
      description: Authentication failed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: UNAUTHENTICATED
              message: >-
                Missing or invalid Authorization header. Use: Authorization:
                Bearer <token>
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: NOT_FOUND
              message: Server not found.
    ValidationError:
      description: Validation failed
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: object
                properties:
                  code:
                    type: string
                    example: VALIDATION_ERROR
                  message:
                    type: string
                    example: The given data was invalid.
                  details:
                    type: object
                    additionalProperties:
                      type: array
                      items:
                        type: string
                    example:
                      name:
                        - The name field is required.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API token from your CloudBlast account settings. Pass as `Authorization:
        Bearer <token>`.

````