> ## 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 one owned workflow run's sanitized audit and optional action receipt

> Returns the authenticated owner's run, steps and up to 500 lifecycle audit events. Inputs, outputs, context, raw errors and connector material are excluded. The optional receipt is present only when the run's card is terminal and has persisted evidence and approval. Missing cards and cards without a receipt omit it; other receipt read failures return 503. A foreign run id answers like an unknown one. Query parameters are refused. The response is private and must not be cached.



## OpenAPI

````yaml /homelab/reference/api/openapi.yaml get /v1/ril/workflow-runs/{runId}
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:
  /v1/ril/workflow-runs/{runId}:
    get:
      tags:
        - Inventory
        - RIL
      summary: >-
        Read one owned workflow run's sanitized audit and optional action
        receipt
      description: >-
        Returns the authenticated owner's run, steps and up to 500 lifecycle
        audit events. Inputs, outputs, context, raw errors and connector
        material are excluded. The optional receipt is present only when the
        run's card is terminal and has persisted evidence and approval. Missing
        cards and cards without a receipt omit it; other receipt read failures
        return 503. A foreign run id answers like an unknown one. Query
        parameters are refused. The response is private and must not be cached.
      operationId: getRILWorkflowRun
      parameters:
        - name: runId
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Sanitized workflow history and its action receipt when available
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: '#/components/schemas/RILWorkflowRunAudit'
                  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'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
components:
  schemas:
    RILWorkflowRunAudit:
      type: object
      additionalProperties: false
      required:
        - run
        - steps
        - events
      properties:
        run:
          type: object
          additionalProperties: false
          required:
            - run_id
            - type
            - status
            - current_step
            - created_at
            - updated_at
          properties:
            run_id:
              type: string
            type:
              type: string
            status:
              type: string
              enum:
                - pending
                - running
                - suspended
                - completed
                - failed
                - compensating
                - cancelled
            current_step:
              type: integer
            server_id:
              type: string
            card_id:
              type: string
            started_at:
              type: string
              format: date-time
            finished_at:
              type: string
              format: date-time
            created_at:
              type: string
              format: date-time
            updated_at:
              type: string
              format: date-time
        steps:
          type: array
          items:
            type: object
            additionalProperties: false
            required:
              - step_index
              - name
              - status
              - attempt
            properties:
              step_index:
                type: integer
              name:
                type: string
              status:
                type: string
                enum:
                  - pending
                  - running
                  - completed
                  - failed
                  - skipped
                  - compensated
              attempt:
                type: integer
              started_at:
                type: string
                format: date-time
              finished_at:
                type: string
                format: date-time
        events:
          type: array
          maxItems: 500
          items:
            type: object
            additionalProperties: false
            required:
              - id
              - action
              - resource_type
              - resource_id
              - created_at
            properties:
              id:
                type: integer
                format: int64
              action:
                type: string
              resource_type:
                type: string
              resource_id:
                type: string
              details:
                type: object
                additionalProperties: true
                description: Sanitized lifecycle state metadata only.
              created_at:
                type: string
                format: date-time
        receipt:
          $ref: '#/components/schemas/RILActionStepReceipt'
          description: >-
            Omitted until the run's card has a terminal receipt with persisted
            evidence and approval.
    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.
    RILActionStepReceipt:
      type: object
      additionalProperties: false
      description: >-
        Persisted proof of one approved governed action; contains no replayable
        credential.
      required:
        - api_version
        - action_card_id
        - execution_id
        - trace_id
        - approval
        - execution
        - verification
        - evidence
      properties:
        api_version:
          type: string
          const: homelab.ril-action-step-receipt/v1
        action_card_id:
          type: string
        execution_id:
          type: string
        trace_id:
          type: string
        approval:
          type: object
          additionalProperties: false
          required:
            - receipt_ref
            - receipt_hash
            - decision_id
            - class
            - approved_at
          properties:
            receipt_ref:
              type: string
              description: AI Platform approval receipt reference (approval:<receipt id>).
            receipt_hash:
              type: string
            decision_id:
              type: string
              description: >-
                Gateway Decision id or the person approval's audit correlation
                id.
            class:
              type: string
              enum:
                - owner-step-up
                - break-glass
                - agent-equipment
            approved_at:
              type: string
              format: date-time
        execution:
          type: object
          additionalProperties: false
          required:
            - step
            - status
            - executions
            - completions
            - exactly_once
            - request_digest
            - evidence_id
            - executor_ref
            - target_ref
          properties:
            step:
              type: string
              const: execution
            status:
              type: string
              enum:
                - succeeded
                - failed
            executions:
              type: integer
              format: int64
              minimum: 0
              description: Number of durable transitions into executing.
            completions:
              type: integer
              format: int64
              minimum: 0
              description: Number of durable transitions into completed or failed.
            exactly_once:
              type: boolean
              description: True only when executions and completions both equal one.
            request_digest:
              type: string
            evidence_id:
              type: string
            executor_ref:
              type: string
            target_ref:
              type: string
            started_at:
              type: string
              format: date-time
            completed_at:
              type: string
              format: date-time
        verification:
          type: object
          additionalProperties: false
          required:
            - step
            - kind
            - status
            - runtime_state_observed
            - checks
            - evaluated_at
          properties:
            step:
              type: string
              const: verification
            kind:
              type: string
            status:
              type: string
              enum:
                - passed
                - failed
            runtime_state_observed:
              type: boolean
            checks:
              type: array
              minItems: 1
              maxItems: 16
              items:
                $ref: '#/components/schemas/RILVerificationCheck'
            evaluated_at:
              type: string
              format: date-time
        evidence:
          $ref: '#/components/schemas/RILActionEvidence'
    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.)
    RILVerificationCheck:
      type: object
      additionalProperties: false
      required:
        - id
        - status
      properties:
        id:
          type: string
        status:
          type: string
          enum:
            - passed
            - failed
    RILActionEvidence:
      type: object
      additionalProperties: false
      description: >-
        The unchanged public-safe stackkit.ril-action-evidence/v1 record wrapped
        by the step receipt.
      required:
        - api_version
        - evidence_id
        - evidence_sink_ref
        - action_card_id
        - execution_id
        - trace_id
        - tenant_id
        - stack_id
        - primitive_id
        - primitive_contract_hash
        - resolved_plan_hash
        - request_digest
        - executor_ref
        - target_ref
        - status
        - verification
        - recovery
        - summary_codes
        - evaluated_at
      properties:
        api_version:
          type: string
          const: stackkit.ril-action-evidence/v1
        evidence_id:
          type: string
        evidence_sink_ref:
          type: string
        action_card_id:
          type: string
        execution_id:
          type: string
        trace_id:
          type: string
        tenant_id:
          type: string
        stack_id:
          type: string
        primitive_id:
          type: string
        primitive_contract_hash:
          type: string
        resolved_plan_hash:
          type: string
        request_digest:
          type: string
        executor_ref:
          type: string
        target_ref:
          type: string
        status:
          type: string
          enum:
            - succeeded
            - failed
        verification:
          type: object
          additionalProperties: false
          required:
            - kind
            - status
            - runtime_state_observed
            - checks
          properties:
            kind:
              type: string
            status:
              type: string
              enum:
                - passed
                - failed
            runtime_state_observed:
              type: boolean
            checks:
              type: array
              minItems: 1
              maxItems: 16
              items:
                $ref: '#/components/schemas/RILVerificationCheck'
        recovery:
          type: object
          additionalProperties: false
          required:
            - kind
            - status
          properties:
            kind:
              type: string
              enum:
                - none
                - primitive
                - manual
            status:
              type: string
              enum:
                - not-required
                - required
                - manual-required
                - recovered
            primitive_ref:
              type: string
        summary_codes:
          type: array
          minItems: 1
          maxItems: 16
          items:
            type: string
        protected_diagnostic_ref:
          type: string
          description: Opaque reference; never inline diagnostics.
        evaluated_at:
          type: string
          format: date-time
  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'
    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.