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

# Deploy, Start, Stop, Restart

> Carries out a runtime action:

- `deploy`: build the current commit and roll it out. On a worker that was never provisioned this queues the first build instead.
- `start` / `stop`: bring the containers up or down without rebuilding.
- `restart`: stop and start in one step.

All four are asynchronous. The response only says the action was accepted; poll `GET /workers/{worker}/status` to watch it land.



## OpenAPI

````yaml POST /workers/{worker}/actions
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}/actions:
    post:
      tags:
        - Workers
      summary: Deploy, start, stop or restart
      description: >-
        Carries out a runtime action:


        - `deploy`: build the current commit and roll it out. On a worker that
        was never provisioned this queues the first build instead.

        - `start` / `stop`: bring the containers up or down without rebuilding.

        - `restart`: stop and start in one step.


        All four are asynchronous. The response only says the action was
        accepted; poll `GET /workers/{worker}/status` to watch it land.
      operationId: workerAction
      parameters:
        - $ref: '#/components/parameters/WorkerIdentifier'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WorkerActionRequest'
      responses:
        '202':
          description: Action accepted
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/WorkerActionResult'
        '401':
          $ref: '#/components/responses/Unauthenticated'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          description: Worker is not in an active state.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: WORKER_STATE_CONFLICT
                  message: Worker is not in an active state.
        '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:
    WorkerActionRequest:
      type: object
      required:
        - action
      properties:
        action:
          type: string
          enum:
            - deploy
            - start
            - stop
            - restart
          example: deploy
        force:
          type: boolean
          default: false
          description: '`deploy` only: rebuild even when the commit has not moved.'
    WorkerActionResult:
      type: object
      properties:
        action:
          type: string
          enum:
            - deploy
            - start
            - stop
            - restart
          example: deploy
        status:
          type: string
          description: 'Always `initiated`: the action was accepted, not completed.'
          enum:
            - initiated
          example: initiated
        result:
          type: object
          description: >-
            What the platform acknowledged, such as a build identifier. Shape
            varies by action.
          additionalProperties: true
    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
  responses:
    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>`.

````