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

# Read what the last verified apply installed on one server

> The applied state of one owned server: the StackKits release, the apply generation and, per workload, its use case, the selected alternative and its state, as the last verified Apply of this server's node recorded them (a completed rollout or typed Apply whose pinned StackKits result carries the verified Apply summary, or an online Verify by the release recorded for the node, including the Verify dispatched after use-case configuration or removal), bound to the server that held the node then. It never reads the saved spec: what was asked for is the configuration view, not this read. Only `status` `current` may be relied on. `changing` means a lifecycle job of the deployment is running; `stale` means the newest evidence (`evidence_at`, a verified Apply or a clean drift check after it) is older than 24 hours (`expires_at`); `unverified` means a lifecycle change (upgrade, rollback, use-case configuration or removal, drift reconciliation, application update, service start or stop, restore activation, a relocation into the deployment, a failed or degraded rollout) or a detected drift ran after the last verified Apply, or such a job ended without its outcome being recorded (`lifecycle_change_unrecorded`, for example a job abandoned after its process stopped), and `workloads` is empty until an Apply or online Verify of that node verifies again; `unavailable` means no verified Apply was ever recorded for this server's node, the record was taken while another server held the node, the server is in no kit deployment, or its node cannot be told apart. `apply_generation` advances with every change of the record and never repeats for one node: a value held under an older generation is stale. A workload names `use_case` and `alternative` only when the use-case catalog of the same release resolves its applied modules (`resolution` `catalog`); otherwise `resolution` says why. `edition` is `public` or `private` with `edition_status` `recorded` only when the exact applied release records its edition. Otherwise `edition` is null with `edition_status` `not_recorded`; it is never inferred. The response holds no address, credential, token or other server's data and is private and uncached.



## OpenAPI

````yaml /homelab/reference/api/openapi.yaml get /api/v1/servers/{serverId}/applied-state
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 kombify Vault 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 the owner of a self-hosted
      installation
  - name: Internal
    description: >-
      Internal SaaS-only APIs, including servicecall-protected executor
      contracts
paths:
  /api/v1/servers/{serverId}/applied-state:
    get:
      tags:
        - Servers
      summary: Read what the last verified apply installed on one server
      description: >-
        The applied state of one owned server: the StackKits release, the apply
        generation and, per workload, its use case, the selected alternative and
        its state, as the last verified Apply of this server's node recorded
        them (a completed rollout or typed Apply whose pinned StackKits result
        carries the verified Apply summary, or an online Verify by the release
        recorded for the node, including the Verify dispatched after use-case
        configuration or removal), bound to the server that held the node then.
        It never reads the saved spec: what was asked for is the configuration
        view, not this read. Only `status` `current` may be relied on.
        `changing` means a lifecycle job of the deployment is running; `stale`
        means the newest evidence (`evidence_at`, a verified Apply or a clean
        drift check after it) is older than 24 hours (`expires_at`);
        `unverified` means a lifecycle change (upgrade, rollback, use-case
        configuration or removal, drift reconciliation, application update,
        service start or stop, restore activation, a relocation into the
        deployment, a failed or degraded rollout) or a detected drift ran after
        the last verified Apply, or such a job ended without its outcome being
        recorded (`lifecycle_change_unrecorded`, for example a job abandoned
        after its process stopped), and `workloads` is empty until an Apply or
        online Verify of that node verifies again; `unavailable` means no
        verified Apply was ever recorded for this server's node, the record was
        taken while another server held the node, the server is in no kit
        deployment, or its node cannot be told apart. `apply_generation`
        advances with every change of the record and never repeats for one node:
        a value held under an older generation is stale. A workload names
        `use_case` and `alternative` only when the use-case catalog of the same
        release resolves its applied modules (`resolution` `catalog`); otherwise
        `resolution` says why. `edition` is `public` or `private` with
        `edition_status` `recorded` only when the exact applied release records
        its edition. Otherwise `edition` is null with `edition_status`
        `not_recorded`; it is never inferred. The response holds no address,
        credential, token or other server's data and is private and uncached.
      operationId: getServerAppliedState
      parameters:
        - $ref: '#/components/parameters/serverId'
      responses:
        '200':
          description: The applied state of the server, or why there is none
          headers:
            Cache-Control:
              schema:
                type: string
                example: private, no-store
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/ServerAppliedState'
                  meta:
                    $ref: '#/components/schemas/ResponseMeta'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
components:
  parameters:
    serverId:
      name: serverId
      in: path
      required: true
      description: Canonical server runtime ID
      schema:
        type: string
  schemas:
    ServerAppliedState:
      type: object
      description: >-
        What the last verified Apply installed on one server's node
        (homelab.server-applied-state/v1). Only status `current` may be relied
        on.
      required:
        - schema_version
        - server_id
        - status
        - edition
        - edition_status
        - workloads
        - read_at
      properties:
        schema_version:
          type: string
          enum:
            - homelab.server-applied-state/v1
        server_id:
          type: string
        kit_deployment_id:
          type: string
        node_ref:
          type: string
          description: The StackSpec node of the server in its kit deployment.
        status:
          type: string
          enum:
            - current
            - changing
            - stale
            - unverified
            - unavailable
        reason_code:
          type: string
          description: >-
            Why the status is not `current`: server_not_in_kit_deployment,
            server_node_unbound, no_verified_apply, lifecycle_change_running,
            evidence_expired, lifecycle_change_unrecorded,
            applied_state_of_other_server, server_unbound_at_apply,
            applied_state_not_provisioned, or the record's own reason
            (lifecycle_change_unverified,
            lifecycle_change_verification_unavailable, rollout_not_verified,
            rollout_degraded, kit_deployment_removed, drift_detected,
            workloads_relocated_into, not_in_verified_rollout).
        apply_generation:
          type: integer
          format: int64
          minimum: 1
          description: >-
            Advances with every change of this node's record; absent when no
            record exists.
        recorded_at:
          type: string
          format: date-time
          description: When the record of this node was last written.
        release:
          type: object
          description: >-
            The StackKits release that produced the verified result, as reported
            for it.
          required:
            - version
          properties:
            version:
              type: string
            archive_sha256:
              type: string
            release_index_sha256:
              type: string
        edition:
          type:
            - string
            - 'null'
          enum:
            - public
            - private
            - null
          description: Null until a release record names the edition; never inferred.
        edition_status:
          type: string
          enum:
            - not_recorded
            - recorded
        plan_hash:
          type: string
        apply_result_hash:
          type: string
        applied_at:
          type: string
          format: date-time
        verified_at:
          type: string
          format: date-time
        checked_at:
          type: string
          format: date-time
          description: The last clean drift check after verified_at.
        evidence_at:
          type: string
          format: date-time
        expires_at:
          type: string
          format: date-time
        changing_job_id:
          type: string
          description: >-
            The lifecycle job that is running (changing) or ended unrecorded,
            readable with get_job.
        source:
          type: object
          required:
            - job_id
            - operation
          properties:
            job_id:
              type: string
            operation:
              type: string
        workloads:
          type: array
          description: >-
            The applied workloads of a verified record (current, changing or
            stale); empty otherwise.
          items:
            type: object
            required:
              - workload_ref
              - module_refs
              - state
              - resolution
            properties:
              workload_ref:
                type: string
              use_case:
                type: string
                description: The use-case slug.
              alternative:
                type: string
                description: The selected alternative the applied modules belong to.
              module_refs:
                type: array
                items:
                  type: string
              state:
                type: string
                enum:
                  - applied
              resolution:
                type: string
                enum:
                  - catalog
                  - release_catalog_unavailable
                  - not_a_use_case_workload
                  - alternative_not_resolved
        read_at:
          type: string
          format: date-time
    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:
    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'
    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.