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

# Generate worker join command and cloud-init

> Returns a join token, bootstrap command template, and cloud-init config for adding a worker node to a KaaS cluster. The token is short-lived.



## OpenAPI

````yaml /openapi.json post /v1/clusters/{id}/worker_bootstrap
openapi: 3.1.0
info:
  title: CNAP API
  version: 1.0.0
  description: >-
    Public API for managing CNAP workspaces, clusters, templates, products, and
    deployments.


    Authenticate with a Personal Access Token via the `Authorization: Bearer
    cnap_pat_...` header.


    Workspace-scoped endpoints require the `X-Workspace-Id` header.
servers:
  - url: https://api.cnap.tech
    description: Production
security: []
paths:
  /v1/clusters/{id}/worker_bootstrap:
    post:
      tags:
        - Clusters
      summary: Generate worker join command and cloud-init
      description: >-
        Returns a join token, bootstrap command template, and cloud-init config
        for adding a worker node to a KaaS cluster. The token is short-lived.
      parameters:
        - schema:
            type: string
            description: Cluster ID
          required: true
          description: Cluster ID
          name: id
          in: path
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                expiry_seconds:
                  type: integer
                  minimum: 60
                  maximum: 86400
                  default: 3600
                  description: Token expiry in seconds (default 3600, max 86400)
      responses:
        '200':
          description: Worker bootstrap info
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkerBootstrap'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Cluster not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - BearerAuth: []
components:
  schemas:
    WorkerBootstrap:
      type: object
      properties:
        token:
          type: string
          description: Short-lived join token
        expires_at:
          type: number
          description: Token expiry (unix seconds)
        token_placeholder:
          type: string
          description: Placeholder string in templates
        cmd_template:
          type: string
          description: Bootstrap command with token placeholder
        cmd:
          type: string
          description: Bootstrap command with real token (ready to run)
        cloud_init_template:
          type: string
          description: Cloud-init YAML with token placeholder
        cloud_init:
          type: string
          description: Cloud-init YAML with real token (ready to use)
      required:
        - token
        - expires_at
        - token_placeholder
        - cmd_template
        - cmd
        - cloud_init_template
        - cloud_init
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: not_found
            message:
              type: string
              example: Resource not found
            param:
              type: string
              description: The request field that caused the error
              example: name
            suggestion:
              type: string
              example: Run `cnap clusters list` to see available clusters
            details: {}
          required:
            - code
            - message
      required:
        - error
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Personal Access Token (cnap_pat_...) or OAuth2 JWT. Create tokens at
        https://cnap.tech/account/tokens

````