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

# Run the creation wizard to found, join or extend a StackKit deployment

> Persists one wizard run for the authenticated owner. A found run creates the deployment and its first server, a join run adds a Node and an extend run adds use cases; the first run in a Homelab founds it and later first-run requests are coerced to expansions. The kombify-cloud transport orders a billed managed server, the hypervisor transport creates a guest on the owner's hypervisor and connect-remote enrolls over SSH. Join, extend, managed and hypervisor runs require `X-Idempotency-Key`; a replay with the same key and request returns the original outcome.



## OpenAPI

````yaml /homelab/reference/api/openapi.yaml post /api/v1/wizard/runs
openapi: 3.1.0
info:
  title: kombify-Homelab API
  description: >
    REST API for kombify-Homelab -- the hybrid cloud control plane for homelabs.


    kombify-Homelab manages infrastructure through a spec-driven architecture:

    validate YAML specs via CUE, generate OpenTofu configurations, and manage

    nodes through a gRPC agent protocol.


    ## Authentication


    Authenticated endpoints accept an OIDC/JWKS bearer token or an API key

    where documented. Self-hosted Homelab defaults to Pocket ID as identity

    provider. SaaS routes enter through the edge with Auth0 as the platform

    identity provider. PocketBase session exchange remains legacy migration

    compatibility only.


    ## Response Format


    **Success:** `{ "data": <object>, "meta": { "total": int, "page": int,
    "per_page": int } }`


    **Error:** `{ "error": { "code": "<ERROR_CODE>", "message": "...",
    "details": <any> } }`


    ## Pagination


    List endpoints accept `page` (default: 1) and `per_page` (default: 20, max:
    100) query parameters.
  version: 1.0.0
  contact:
    name: kombify
    url: https://kombify.io
  license:
    name: Apache-2.0 AND GPL-3.0
    url: https://github.com/kombifyio/Homelab/blob/main/LICENSE
servers:
  - url: https://api.kombify.io/v1/homelab
    description: >-
      Production canonical (via Cloudflare edge gateway, strip-prefix). Clients
      MUST use this projection. The Gateway strips /v1/homelab and re-adds
      /api/v1 at the origin, so it resolves the /api/v1/* paths below cleanly.
  - url: http://localhost:5260
    description: Local development
  - url: https://homelab.kombify.io
    description: Production (direct, no Gateway prefix)
  - url: https://api.kombify.io/v1/orchestrator
    description: >-
      Legacy StackKit-Orchestrator projection of the same origin. RETAINED for
      backward compatibility with existing consumers only. Do NOT use for mobile
      or new clients: combined with the /api/v1/* paths it double-resolves
      (yielding /v1/orchestrator/api/v1/...). Prefer /v1/homelab.
security:
  - bearerAuth: []
tags:
  - name: Health
    description: Health checks and service info (no auth required)
  - name: Instance
    description: Local instance identity and enrollment metadata
  - name: Stacks
    description: Stack lifecycle management (create, provision, deploy, destroy)
  - name: Stacks - Specs
    description: Access persisted specification chain (intent, requirements, unified)
  - name: Stacks - Import/Export
    description: Import and export StackKits stack-spec.yaml configurations
  - name: Stacks - Drift
    description: Infrastructure drift detection and resolution
  - name: Unifier
    description: Spec validation, analysis, unification, and IaC generation pipeline
  - name: StackKits
    description: Infrastructure template catalog
  - name: Add-ons
    description: Add-on detection and registry
  - name: Workers
    description: Worker node registration and management
  - name: Servers
    description: Canonical server lifecycle, connection, and health state
  - name: Inventory
    description: >-
      Owner-scoped sanitized server and service read models for UI, API, and MCP
      clients
  - name: Agents
    description: Connected gRPC agent management and commands
  - name: Jobs
    description: Background job monitoring and SSE streaming
  - name: Discovery
    description: Network device discovery and SSH testing
  - name: Features
    description: Feature flags (read-only; managed centrally via the kombify Admin API)
  - name: Monthly Runtime
    description: Provider-free user API for subscription-backed stack runtime control
  - name: Runtime
    description: Recent runtime/deploy logs (job/deploy progress + container tail)
  - name: Wallet
    description: >-
      Redacted recovery-item wallet with biometric/platform-reauth-gated reveal.
      List responses strip secret/totp; reveal requires a fresh trusted-reauth
      HMAC proof (5-minute window) and is audited server-side.
  - name: Trust
    description: Pairing tokens for worker enrollment
  - name: Client Binding
    description: >-
      Short-lived HTTPS pairing for a second client and normal OIDC account
      handoff
  - name: Tunnel
    description: Cloudflare tunnel management for NAT traversal
  - name: Backups
    description: Database backup management (admin only)
  - name: Auth
    description: Authentication mode and SSO configuration
  - name: Metrics
    description: Prometheus-compatible instance metrics for admin/infra scrapers
  - name: Internal
    description: >-
      Internal SaaS-only APIs, including servicecall-protected executor
      contracts
paths:
  /api/v1/wizard/runs:
    post:
      tags:
        - Stacks
        - Jobs
      summary: Run the creation wizard to found, join or extend a StackKit deployment
      description: >-
        Persists one wizard run for the authenticated owner. A found run creates
        the deployment and its first server, a join run adds a Node and an
        extend run adds use cases; the first run in a Homelab founds it and
        later first-run requests are coerced to expansions. The kombify-cloud
        transport orders a billed managed server, the hypervisor transport
        creates a guest on the owner's hypervisor and connect-remote enrolls
        over SSH. Join, extend, managed and hypervisor runs require
        `X-Idempotency-Key`; a replay with the same key and request returns the
        original outcome.
      operationId: createWizardRun
      parameters:
        - name: X-Idempotency-Key
          in: header
          required: true
          description: >-
            Stable attempt key, at most 256 characters. The handler accepts a
            missing key only for found runs on the install-command or
            connect-remote transport.
          schema:
            type: string
            minLength: 1
            maxLength: 256
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              required:
                - intent
              properties:
                intent:
                  type: object
                  additionalProperties: false
                  required:
                    - schema
                    - run_kind
                    - name
                    - kit_assignment
                  description: >-
                    Closed wizard intent (homelab.wizard-intent/v1). The backend
                    projects it onto the pinned StackKits kit seed; owner
                    identity never travels here.
                  properties:
                    schema:
                      type: string
                      const: homelab.wizard-intent/v1
                    run_kind:
                      type: string
                      enum:
                        - first-run
                        - expansion
                    homelab_id:
                      type: string
                    name:
                      type: string
                      minLength: 1
                      description: Display name of the StackKit deployment.
                    domain_base:
                      type: string
                    goals:
                      type: array
                      items:
                        type: string
                      description: >-
                        Selected use-case slugs from the released StackKits
                        catalog.
                    server:
                      type: object
                      additionalProperties: false
                      properties:
                        existing_server_id:
                          type: string
                          description: >-
                            Already enrolled, unassigned canonical server,
                            connected through Guard: the first installation of a
                            found run, or the new node of a join run where the
                            pinned StackKits release declares multi-node join
                            for the kit (install-command transport only).
                        roles:
                          type: array
                          items:
                            type: string
                            description: >-
                              controller, worker, storage or edge; the legacy
                              names foundation, standalone, main and
                              control-plane map to controller.
                        purpose:
                          type: string
                        transport:
                          type: string
                          enum:
                            - install-command
                            - connect-remote
                            - hypervisor
                            - kombify-cloud
                          description: >-
                            Provisioning lane; empty means install-command.
                            kombify-cloud orders a billed managed server.
                        environment_class:
                          type: string
                          enum:
                            - local
                            - cloud
                        site_ref:
                          type: string
                    kit_assignment:
                      type: object
                      additionalProperties: false
                      required:
                        - mode
                      properties:
                        mode:
                          type: string
                          enum:
                            - found
                            - join
                            - extend
                          description: >-
                            found creates a deployment (kit_slug required); join
                            adds a Node and extend adds use cases to
                            kit_deployment_id.
                        kit_slug:
                          type: string
                          enum:
                            - basement-kit
                            - cloud-kit
                            - modern-homelab
                        kit_deployment_id:
                          type: string
                    use_case_access:
                      type: object
                      propertyNames:
                        pattern: ^[a-z][a-z0-9-]*$
                      additionalProperties:
                        $ref: '#/components/schemas/WizardUseCaseAccessDecision'
                      description: >-
                        Desired private reach and audience per selected
                        canonical use-case slug. Local owner or household access
                        is projected for native Photos and Documents workloads
                        at home with enforceable application policies. Selected
                        people, remote reach and unsupported workloads remain
                        blocked. Runs save unsupported decisions before
                        returning 409 wizard_desired_projection_blocked;
                        previews return the same blocked reason without saving.
                        Explicit mode inherit withdraws the saved decision;
                        omitting a key preserves it.
                    access:
                      type: object
                      additionalProperties: false
                      properties:
                        mode:
                          type: string
                          enum:
                            - local
                            - remote-private
                        publications:
                          type: array
                          items:
                            type: object
                            additionalProperties: false
                            required:
                              - service_id
                              - exposure
                            properties:
                              service_id:
                                type: string
                              exposure:
                                type: string
                                const: public
                    household:
                      type: object
                      additionalProperties: false
                      properties:
                        profile:
                          type: string
                          enum:
                            - solo
                            - shared
                        planned_people:
                          type: array
                          maxItems: 50
                          items:
                            type: object
                            additionalProperties: false
                            required:
                              - client_ref
                            properties:
                              client_ref:
                                type: string
                              name:
                                type: string
                                maxLength: 200
                              email:
                                type: string
                                maxLength: 320
                    use_case_settings:
                      type: object
                      additionalProperties:
                        type: object
                      description: >-
                        Setting decisions per selected use-case slug, as the
                        StackKits catalog declares them.
                    use_case_capabilities:
                      type: object
                      additionalProperties:
                        type: object
                        additionalProperties:
                          type: string
                      description: >-
                        Capability option id (or "off") per capability id, per
                        selected use-case slug.
                    use_case_setup_answers:
                      type: object
                      maxProperties: 128
                      additionalProperties:
                        type: object
                        maxProperties: 128
                        additionalProperties:
                          type: array
                          maxItems: 128
                          items:
                            type: string
                            maxLength: 128
                    backup:
                      type: object
                      additionalProperties: false
                      properties:
                        offsite:
                          type: boolean
                          description: >-
                            Off-site object backup; available only when founding
                            a cloud-kit deployment.
                    layout_recommendation:
                      type: object
                      additionalProperties: false
                      required:
                        - id
                        - proposal_digest
                      description: >-
                        Accepts a shown layout recommendation (join and extend
                        runs only).
                      properties:
                        id:
                          type: string
                        proposal_digest:
                          type: string
                          pattern: '^sha256:'
                owner:
                  type: object
                  additionalProperties: false
                  description: >-
                    Owner bootstrap options for a first run; ignored on
                    expansion runs.
                  properties:
                    owner_bootstrap_mode:
                      type: string
                      enum:
                        - auto
                        - custom
                        - none
                    owner_source:
                      type: string
                      enum:
                        - local
                        - cloud
                        - cloud-linked
                    owner_email:
                      type: string
                    owner_username:
                      type: string
                    owner_display_name:
                      type: string
                managed:
                  type: object
                  additionalProperties: false
                  required:
                    - provider_id
                  description: Managed provider selection for the kombify-cloud transport.
                  properties:
                    provider_id:
                      type: string
                    runtime_offering_id:
                      type: string
                    provider_region:
                      type: string
                    ionos_datacenter:
                      type: string
                remote:
                  type: object
                  additionalProperties: false
                  description: >-
                    SSH target for the connect-remote transport. The credential
                    is a Wallet node access item; this contract accepts no
                    plaintext password.
                  properties:
                    host:
                      type: string
                    port:
                      type: integer
                      minimum: 1
                      maximum: 65535
                    user:
                      type: string
                    auth_method:
                      type: string
                      enum:
                        - ssh-key
                        - password
                    ssh_key_label:
                      type: string
                      description: >-
                        Label of a stored SSH key; only on deployments that read
                        the built-in wallet.
                    ssh_wallet_item_id:
                      type: string
                      pattern: ^itm_[a-z2-7]{26}$
                    use_sudo:
                      type: boolean
                substrate:
                  type: object
                  additionalProperties: false
                  description: >-
                    Guest placement on the owner's connected hypervisor;
                    required for, and only valid with, the hypervisor transport.
                  required:
                    - server_id
                    - profile_id
                    - storage
                    - bridge
                    - cpu
                    - memory_mib
                    - disk_gib
                  properties:
                    server_id:
                      type: string
                    profile_id:
                      type: string
                      description: Ubuntu guest profile id.
                    storage:
                      type: string
                    bridge:
                      type: string
                    cpu:
                      type: integer
                      minimum: 2
                    memory_mib:
                      type: integer
                      minimum: 2048
                    disk_gib:
                      type: integer
                      minimum: 32
                    appliance:
                      type: object
                      additionalProperties: false
                      required:
                        - profile_id
                        - storage
                        - bridge
                        - cpu
                        - memory_mib
                        - disk_gib
                      properties:
                        profile_id:
                          type: string
                        storage:
                          type: string
                        bridge:
                          type: string
                        cpu:
                          type: integer
                        memory_mib:
                          type: integer
                        disk_gib:
                          type: integer
                    accelerator:
                      type: object
                      required:
                        - address
                      properties:
                        address:
                          type: string
                        root_port:
                          type: string
                        subtree:
                          type: string
                        thunderbolt_unique_id:
                          type: string
                services:
                  type: array
                  items:
                    type: string
      responses:
        '202':
          description: >-
            Wizard run accepted or replayed; provisioning or pairing continues
            as a job
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      run_id:
                        type: string
                      run_kind:
                        type: string
                      requested_run_kind:
                        type: string
                      coerced:
                        type: boolean
                      homelab_id:
                        type: string
                      kit_assignment_mode:
                        type: string
                        enum:
                          - found
                          - join
                          - extend
                      kit_slug:
                        type: string
                      stack_id:
                        type: string
                      server_id:
                        type: string
                      node_id:
                        type: string
                      name:
                        type: string
                      job_id:
                        type: string
                      state:
                        type: string
                        enum:
                          - provisioning
                          - awaiting_pairing
                      auto_deploy:
                        type: boolean
                      operations_url:
                        type: string
                      pairing_job_id:
                        type: string
                      planned_server_id:
                        type: string
                      operation_id:
                        type: string
                      appliance:
                        type: object
                      unmapped_goals:
                        type: array
                        items:
                          type: string
                      unmapped_purpose:
                        type: string
                      release_version:
                        type: string
                      idempotent_replay:
                        type: boolean
                      bootstrap_token:
                        type: string
                        description: >-
                          Short-lived owner-spec bootstrap bearer; present only
                          when issued.
                      bootstrap_token_expires_at:
                        type: string
                        format: date-time
                      owner_spec_endpoint:
                        type: string
                      owner_spec_scopes:
                        type: array
                        items:
                          type: string
                  meta:
                    $ref: '#/components/schemas/ResponseMeta'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '422':
          $ref: '#/components/responses/ValidationError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
components:
  schemas:
    WizardUseCaseAccessDecision:
      description: >-
        Desired access only, never an identity grant. The Owner retains access;
        StackKits must resolve person references through its identity authority.
        Server-side validation is authoritative for reference bounds and
        selected goals.
      oneOf:
        - type: object
          additionalProperties: false
          required:
            - mode
          properties:
            mode:
              type: string
              const: inherit
        - type: object
          additionalProperties: false
          required:
            - mode
            - audience
          properties:
            mode:
              type: string
              enum:
                - local
                - remote-private
            audience:
              type: string
              enum:
                - owner
                - household
            person_refs:
              type: array
              maxItems: 0
        - type: object
          additionalProperties: false
          required:
            - mode
            - audience
            - person_refs
          properties:
            mode:
              type: string
              enum:
                - local
                - remote-private
            audience:
              type: string
              const: selected
            person_refs:
              type: array
              minItems: 1
              maxItems: 50
              uniqueItems: true
              items:
                type: string
                minLength: 1
                maxLength: 200
    ResponseMeta:
      type: object
      properties:
        total:
          type: integer
        page:
          type: integer
        per_page:
          type: integer
        managed_runtime_inventory_complete:
          type: boolean
          description: >-
            True only when the managed RuntimeLease authority was configured and
            read successfully for this inventory response.
        worker_inventory_sha256:
          type: string
          pattern: ^[0-9a-f]{64}$
          description: >-
            Stable digest of the complete worker identity, attachment,
            freshness, and managed RuntimeLease authority snapshot used for
            pagination.
        managed_runtime_active_lease_ids:
          type: array
          items:
            type: string
          description: >-
            Canonically sorted IDs of visible managed RuntimeLeases classified
            as active for inventory and cleanup. This visibility projection is
            not capacity reservation or release authority.
        managed_runtime_inactive_lease_ids:
          type: array
          items:
            type: string
          description: >-
            Canonically sorted IDs of visible managed RuntimeLeases classified
            as cancelled or archived for inventory and cleanup. Inactive state
            does not prove provider absence or release managed-server capacity.
        managed_runtime_lease_generation_digests:
          type: array
          items:
            type: object
            required:
              - lease_id
              - resource_generation_digest
            properties:
              lease_id:
                type: string
              resource_generation_digest:
                type: string
                pattern: ^[0-9a-f]{64}$
          description: >-
            Canonically sorted opaque bindings from each visible managed
            RuntimeLease ID to its exact provider-resource generation. Missing
            coverage makes destructive inventory proof invalid while leaving
            ordinary dashboard inventory readable.
        managed_runtime_duplicate_lease_ids:
          type: array
          items:
            type: string
          description: >-
            Managed RuntimeLease IDs represented by multiple persisted worker
            rows before UI projection deduplication; must be empty for
            destructive inventory proof.
        managed_runtime_attachment_conflict_lease_ids:
          type: array
          items:
            type: string
          description: >-
            Canonically sorted caller-visible managed RuntimeLease IDs with a
            conflicting tenant-wide worker attachment; must be empty for
            destructive inventory proof and never exposes foreign private lease
            or worker details.
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              enum:
                - INTERNAL_ERROR
                - NOT_FOUND
                - BAD_REQUEST
                - UNAUTHORIZED
                - FORBIDDEN
                - CONFLICT
                - VALIDATION_ERROR
                - RATE_LIMITED
                - SERVICE_UNAVAILABLE
                - METHOD_NOT_ALLOWED
            message:
              type: string
            details:
              description: Additional error context (validation errors, etc.)
  responses:
    BadRequest:
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Authentication required
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Forbidden:
      description: Insufficient permissions
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Conflict:
      description: Request conflicts with existing state
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    ValidationError:
      description: Request failed semantic validation
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    ServiceUnavailable:
      description: Required control-plane persistence or dependency is unavailable
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        OIDC/JWKS bearer token. Self-hosted defaults to Pocket ID; SaaS uses
        Auth0 through the edge. PocketBase JWT is legacy migration compatibility
        only.

````

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