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

# homelab api stacks

> Generated reference for the homelab api stacks commands

> [!NOTE]
>
> Generated from the Homelab v0.49.2 release (source `2614eaba28d8`). For an installed version, `homelab api <command> --help` is authoritative.

## homelab api stacks create

Create a StackKit deployment in the owner's Homelab.

Creates an internal StackKit deployment under the authenticated B2C
owner's singleton Homelab from the canonical StackKits stack-spec
payload supplied as `stack_spec`. The legacy `/stacks` route and
`stack_id` response field identify that deployment; they do not create
or select a second Homelab product. One Homelab instance can serve
many owners, each with their own Homelab. Legacy
`user_config`/kombination payloads remain accepted at this compatibility
boundary. Wizard clients should send a stable `X-Idempotency-Key`;
retries with the same key and payload return the original deployment,
planned server, and provisioning job.

```bash theme={null}
homelab api stacks create [flags]
```

> [!WARNING]
>
> Requires confirmation: This operation creates the StackKit deployment and starts provisioning, which can order billed servers. Pass `--yes` or answer the prompt; a non-interactive run without `--yes` stops before any request with exit code 9.

| | |
| - | - |
| HTTP | `POST /api/v1/stacks` |
| Changes state | Yes |
| MCP tool | `create_stack` |

| Argument | Type | Description |
| - | - | - |
| `--x-idempotency-key` | string | Stable wizard-attempt key. Maximum 256 characters. |
| `--mode` | string | Wizard mode. One of `easy`, `techie`. |
| `--name` | string | Stack name. |
| `--options` | object | — |
| `--provider` | string | Infrastructure provider (direct format). |
| `--services` | string\[] | Service names (direct format). |
| `--stack-spec` | object | Canonical StackKits stack-spec.yaml shape generated by the creation wizard. When present, this is the source of truth for provisioning and is stored as the stack user\_config for compatibility. |
| `--user-config` | object | Legacy structured configuration, including older kombination-style payloads. New wizard clients should send stack\_spec. |
| `--user-config-format` | string | One of `json`, `yaml`. |
| `--user-config-raw` | string | Raw YAML/JSON string. |
| `--body` | json | JSON request body (`application/json`) as a literal, `@path` or `-` for stdin. |

## homelab api stacks deploy

Roll out one StackKit deployment (unify + IaC + tofu apply).

```bash theme={null}
homelab api stacks deploy <stack-id> [flags]
```

| | |
| - | - |
| HTTP | `POST /api/v1/stacks/{id}/deploy` |
| Changes state | Yes |
| MCP tool | `deploy_stack` |

| Argument | Type | Description |
| - | - | - |
| `<stack-id>` | string | **Required.** Stack ID. |

## homelab api stacks destroy

Decommission one StackKit deployment and its infrastructure.

Removes the stack through its nodes: StackKits removes every applied workload on the server that runs it, then the control plane releases the stack. When a server holding the stack was deleted, the node cannot answer; the request is then refused with `server_absence_confirmation_required` and the offline servers, and is sent again with `offline_removal.confirm_server_ids` naming exactly those servers. The control plane accepts that confirmation only for a server it can prove offline (no heartbeat for longer than the stale window), without a lease and not operated by kombify or a provider: leased and provider-operated servers are proven absent by their provider. A confirmed server is never dispatched to; its agent credential is revoked and the server is retired. A server that reported recently is removed through its node.

```bash theme={null}
homelab api stacks destroy <stack-id> [flags]
```

> [!WARNING]
>
> Requires confirmation: This operation decommissions all infrastructure of the StackKit deployment. Pass `--yes` or answer the prompt; a non-interactive run without `--yes` stops before any request with exit code 9.

| | |
| - | - |
| HTTP | `POST /api/v1/stacks/{id}/destroy` |
| Changes state | Yes |
| MCP tool | `destroy_stack` |

| Argument | Type | Description |
| - | - | - |
| `<stack-id>` | string | **Required.** Stack ID. |
| `--offline-removal` | object | — |
| `--body` | json | JSON request body (`application/json`) as a literal, `@path` or `-` for stdin. |

## homelab api stacks drift check

Trigger drift check.

Rate limited to once per 5 minutes (unless force=true)

```bash theme={null}
homelab api stacks drift check <stack-id> [flags]
```

| | |
| - | - |
| HTTP | `POST /api/v1/stacks/{id}/drift/check` |
| Changes state | Yes |
| MCP tool | `check_drift` |

| Argument | Type | Description |
| - | - | - |
| `<stack-id>` | string | **Required.** Stack ID. |
| `--force` | boolean | Default `false`. |
| `--body` | json | JSON request body (`application/json`) as a literal, `@path` or `-` for stdin. |

## homelab api stacks drift details

Get detailed drift information with affected resources.

```bash theme={null}
homelab api stacks drift details <stack-id> [flags]
```

| | |
| - | - |
| HTTP | `GET /api/v1/stacks/{id}/drift/details` |
| Changes state | No |
| MCP tool | `get_drift_details` |

| Argument | Type | Description |
| - | - | - |
| `<stack-id>` | string | **Required.** Stack ID. |

## homelab api stacks drift resolve

Trigger drift resolution (re-apply).

Precondition -- stack must have status "drifted"

```bash theme={null}
homelab api stacks drift resolve <stack-id> [flags]
```

> [!WARNING]
>
> Requires confirmation: This operation re-applies the stack spec to its servers and overwrites drifted changes. Pass `--yes` or answer the prompt; a non-interactive run without `--yes` stops before any request with exit code 9.

| | |
| - | - |
| HTTP | `POST /api/v1/stacks/{id}/drift/resolve` |
| Changes state | Yes |
| MCP tool | `resolve_drift` |

| Argument | Type | Description |
| - | - | - |
| `<stack-id>` | string | **Required.** Stack ID. |

## homelab api stacks drift status

Get current drift status.

```bash theme={null}
homelab api stacks drift status <stack-id> [flags]
```

| | |
| - | - |
| HTTP | `GET /api/v1/stacks/{id}/drift/status` |
| Changes state | No |
| MCP tool | `get_drift_status` |

| Argument | Type | Description |
| - | - | - |
| `<stack-id>` | string | **Required.** Stack ID. |

## homelab api stacks export

Export stack as stack-spec.yaml.

Returns StackKits stack-spec YAML or JSON depending on Accept header

```bash theme={null}
homelab api stacks export <stack-id> [flags]
```

| | |
| - | - |
| HTTP | `GET /api/v1/stacks/{id}/export` |
| Changes state | No |
| MCP tool | `export_stack` |

| Argument | Type | Description |
| - | - | - |
| `<stack-id>` | string | **Required.** Stack ID. |

## homelab api stacks identity activate-owner

Issue the activation link for the owner account of a stack's identity service.

Asks the StackKits identity runtime of the owned stack for a link that activates the owner's own account on the stack. The body must carry `owner_approved: true`; any other body is 400 `owner_approval_required`. The response includes the activation URL, which is a one-time sign-in link: hand it to the owner and do not log it. Answers 409 when the pinned StackKits runtime cannot issue activations or issuing fails.

```bash theme={null}
homelab api stacks identity activate-owner <stack-id> [flags]
```

| | |
| - | - |
| HTTP | `POST /api/v1/stacks/{id}/identity/owner-activation` |
| Changes state | Yes |
| MCP tool | `issue_stack_owner_activation` |

| Argument | Type | Description |
| - | - | - |
| `<stack-id>` | string | **Required.** Stack ID. |
| `--owner-approved` | boolean | **Required.** One of `true`. |
| `--body` | json | JSON request body (`application/json`) as a literal, `@path` or `-` for stdin. |

## homelab api stacks identity invite-household

Invite one planned household member to a stack's identity service.

Invites one person of the household plan to the owned stack. The person must match the persisted Wizard intent (`client_ref`, e-mail and display name), the owner must already be active on the stack, and the body must carry `owner_approved: true`. The body is decoded strictly. The response includes the member's activation URL when one exists.

```bash theme={null}
homelab api stacks identity invite-household <stack-id> [flags]
```

| | |
| - | - |
| HTTP | `POST /api/v1/stacks/{id}/identity/household-invitations` |
| Changes state | Yes |
| MCP tool | `invite_stack_household_member` |

| Argument | Type | Description |
| - | - | - |
| `<stack-id>` | string | **Required.** Stack ID. |
| `--client-ref` | string | **Required.** Reference of the planned person in the Wizard household intent. |
| `--display-name` | string | — |
| `--email` | string | **Required.** |
| `--owner-approved` | boolean | **Required.** One of `true`. |
| `--username` | string | **Required.** |
| `--body` | json | JSON request body (`application/json`) as a literal, `@path` or `-` for stdin. |

## homelab api stacks import

Import stack-spec.yaml as a StackKit deployment.

Imports YAML or JSON as a deployment under the authenticated owner's Homelab.

```bash theme={null}
homelab api stacks import [flags]
```

| | |
| - | - |
| HTTP | `POST /api/v1/stacks/import` |
| Changes state | Yes |
| MCP tool | `import_stack` |

| Argument | Type | Description |
| - | - | - |
| `--body` | json | **Required.** JSON request body (`application/json`) as a literal, `@path` or `-` for stdin. |

## homelab api stacks intent

Get persisted kombination.yaml (byte-exact, base64).

```bash theme={null}
homelab api stacks intent <stack-id> [flags]
```

| | |
| - | - |
| HTTP | `GET /api/v1/stacks/{id}/intent` |
| Changes state | No |
| MCP tool | `get_stack_intent` |

| Argument | Type | Description |
| - | - | - |
| `<stack-id>` | string | **Required.** Stack ID. |

## homelab api stacks jobs abandon

Retire a rollout that is still marked running but has stopped reporting.

Releases the execution claim of one stale rollout job of an owned stack so that the stack can be retried with `retry-rollout`. Only a job that stopped reporting can be abandoned; any other job answers 409 `abandon_job_conflict` with the guard that refused. The body is empty and no command is sent to a server.

```bash theme={null}
homelab api stacks jobs abandon <stack-id> <job-id> [flags]
```

| | |
| - | - |
| HTTP | `POST /api/v1/stacks/{id}/jobs/{jobId}/abandon` |
| Changes state | Yes |
| MCP tool | `abandon_stale_stack_job` |

| Argument | Type | Description |
| - | - | - |
| `<stack-id>` | string | **Required.** Stack ID. |
| `<job-id>` | string | **Required.** |

## homelab api stacks list

List the owner's StackKit deployments.

Returns every StackKit deployment beneath the authenticated owner's
singleton B2C Homelab. `kit_deployment_id`, `homelab_id`, and
`stackkit_id` are the product identities; legacy identifiers remain
compatibility aliases on this route while consumers migrate.

```bash theme={null}
homelab api stacks list [flags]
```

| | |
| - | - |
| HTTP | `GET /api/v1/stacks` |
| Changes state | No |
| MCP tool | `list_kit_deployments` |

## homelab api stacks managed-runtimes add

Add one managed Node through native provider control.

Creates or resumes one deterministic Add-Server job for the exact
owned StackKit deployment. The standard `Idempotency-Key` is mandatory.
Replaying the same key with the same canonical request returns the original
job, lease, runtime-server, resource-generation, and provider-operation
correlations; reusing it with different intent fails with 409.

The raw key is never persisted or returned. A lost response or an
uncertain native-admission outcome remains resumable only with the
same key. HTTP acceptance means native admission is durable and
provider reconciliation is pending; it never claims that the VM is
already provisioned or healthy. Fresh admission atomically reserves
the authenticated tenant/owner capacity slot with the lease generation
and provider operation. When authoritative native admission finds that
bounded capacity full, it persists a non-retryable 403 outcome and
replaying that denied job returns the same outcome. Exact replays of an
already committed admission reuse its existing reservation. This version
has no automatic reservation release: terminal or local decommission
state alone does not free a slot. Lease inventory and feature-delivery
flags never authorize or deny capacity.
Hosted fresh admission also requires the v2-signed commercial runtime
and provider entitlements plus the signed `cloud.runtime.credits`
`managed_servers` mode/limit decision; feature flags alone never grant
provider capacity. Self-host OSS uses its construction-fixed static
release-manifest policy instead of a SaaS entitlement dependency.

```bash theme={null}
homelab api stacks managed-runtimes add <stack-id> [flags]
```

> [!WARNING]
>
> Requires confirmation: This operation orders an additional managed server for the StackKit deployment and is billed. Pass `--yes` or answer the prompt; a non-interactive run without `--yes` stops before any request with exit code 9.

| | |
| - | - |
| HTTP | `POST /api/v1/stacks/{id}/managed-runtimes` |
| Changes state | Yes |
| MCP tool | `add_managed_runtime_server` |

| Argument | Type | Description |
| - | - | - |
| `<stack-id>` | string | **Required.** Stack ID. |
| `--ionos-datacenter` | string | IONOS datacenter alias for provider\_region; ignored for other canonical providers. |
| `--node-role` | string | One of `foundation`, `worker`, `storage`. Default `"worker"`. |
| `--provider-id` | string | **Required.** Canonical executable provider identifier; historical display aliases are rejected. One of `centron`, `ionos`. |
| `--provider-region` | string | Provider region. For IONOS this is normalized to the canonical datacenter identifier. |
| `--runtime-offering-id` | string | Canonical managed-runtime offering. Omission uses the stack's snapshotted effective default. |
| `--services` | string\[] | Service keys; duplicates and order are semantically insignificant. |
| `--stackkit` | string | StackKit foundation requested for this server. |
| `--body` | json | JSON request body (`application/json`) as a literal, `@path` or `-` for stdin. |

## homelab api stacks operations

Get the post-configuration operations read model for one owned StackKit deployment.

Returns the exact owner- and tenant-scoped read model used by the Homelab operations dashboard. `approved_servers` records operator approval; `connected_servers` is stricter and counts only assigned, approved Nodes with freshness-qualified canonical Guard heartbeat, connection, and health evidence. The operation is read-only and never starts rollout, provisioning, or provider work.

```bash theme={null}
homelab api stacks operations <stack-id> [flags]
```

| | |
| - | - |
| HTTP | `GET /api/v1/stacks/{id}/operations` |
| Changes state | No |
| MCP tool | `get_stack_operations` |

| Argument | Type | Description |
| - | - | - |
| `<stack-id>` | string | **Required.** Stack ID. |

## homelab api stacks owner-spec

Fetch the owner bootstrap spec for a StackKit deployment.

StackKit admin-bootstrap endpoint for fetching local owner fields and
the recovery passphrase hash. This route accepts only the short-lived
bootstrap bearer token returned by `createStack`; it does not use the
normal browser/session bearer token.

```bash theme={null}
homelab api stacks owner-spec <stack-id> [flags]
```

| | |
| - | - |
| HTTP | `GET /api/v1/stacks/{id}/owner-spec` |
| Changes state | No |
| MCP tool | `get_stack_owner_spec` |

| Argument | Type | Description |
| - | - | - |
| `<stack-id>` | string | **Required.** Stack ID. |

## homelab api stacks pipeline-status

Get complete pipeline status for all spec phases.

```bash theme={null}
homelab api stacks pipeline-status <stack-id> [flags]
```

| | |
| - | - |
| HTTP | `GET /api/v1/stacks/{id}/pipeline-status` |
| Changes state | No |
| MCP tool | `get_pipeline_status` |

| Argument | Type | Description |
| - | - | - |
| `<stack-id>` | string | **Required.** Stack ID. |

## homelab api stacks provision

Start provisioning an existing StackKit deployment.

```bash theme={null}
homelab api stacks provision <stack-id> [flags]
```

> [!WARNING]
>
> Requires confirmation: This operation starts provisioning the StackKit deployment, which can order billed servers. Pass `--yes` or answer the prompt; a non-interactive run without `--yes` stops before any request with exit code 9.

| | |
| - | - |
| HTTP | `POST /api/v1/stacks/{id}/provision` |
| Changes state | Yes |
| MCP tool | `provision_stack` |

| Argument | Type | Description |
| - | - | - |
| `<stack-id>` | string | **Required.** Stack ID. |
| `--body` | json | JSON request body (`application/json`) as a literal, `@path` or `-` for stdin. |

## homelab api stacks prune-orphans

Review or apply owner-scoped test-residue cleanup.

Two-phase cleanup for control-plane projections only. A `dry_run`
returns the exact authenticated-owner E2E/runtime-cloud candidates and
a stable revision-bound digest. `apply` recomputes the plan and accepts
only that exact digest. This route never decommissions a lease, calls a
provider, destroys infrastructure, or enqueues lifecycle work.

```bash theme={null}
homelab api stacks prune-orphans [flags]
```

> [!WARNING]
>
> Requires confirmation: This operation deletes the reviewed orphaned control-plane records when mode is apply. Pass `--yes` or answer the prompt; a non-interactive run without `--yes` stops before any request with exit code 9.

| | |
| - | - |
| HTTP | `POST /api/v1/stacks/prune-orphans` |
| Changes state | Yes |
| MCP tool | `review_or_apply_orphan_projection_cleanup` |

| Argument | Type | Description |
| - | - | - |
| `--digest` | string | Required for apply; copied unchanged from the reviewed dry-run. |
| `--mode` | string | **Required.** One of `dry_run`, `apply`. |
| `--stack-id` | string | Optional exact deployment scope used by E2E cleanup. |
| `--body` | json | JSON request body (`application/json`) as a literal, `@path` or `-` for stdin. |

## homelab api stacks relocations abort

Abort a workload relocation and resume the source.

Stops a relocation that has not finished and resumes the workloads on the source server, whose data was kept. The body must carry `owner_approved: true`. A relocation that already moved cannot be aborted (409), and an abort stays fenced until the nodes verify the state.

```bash theme={null}
homelab api stacks relocations abort <stack-id> <job-id> [flags]
```

| | |
| - | - |
| HTTP | `POST /api/v1/stacks/{id}/relocations/{jobId}/abort` |
| Changes state | Yes |
| MCP tool | `abort_workload_relocation` |

| Argument | Type | Description |
| - | - | - |
| `<stack-id>` | string | **Required.** Stack ID. |
| `<job-id>` | string | **Required.** |
| `--owner-approved` | boolean | **Required.** One of `true`. |
| `--body` | json | JSON request body (`application/json`) as a literal, `@path` or `-` for stdin. |

## homelab api stacks relocations resolve

Verify both nodes of an interrupted move and settle its outcome.

Re-reads the transfer proof from the source and destination nodes of one relocation and records the verified outcome (`moved` or `aborted`). It is used when a move stopped between transfer and verification. The body is empty. While the nodes cannot both prove the exact transfer the answer is 409 and the relocation stays fenced.

```bash theme={null}
homelab api stacks relocations resolve <stack-id> <job-id> [flags]
```

| | |
| - | - |
| HTTP | `POST /api/v1/stacks/{id}/relocations/{jobId}/resolve` |
| Changes state | Yes |
| MCP tool | `resolve_workload_relocation` |

| Argument | Type | Description |
| - | - | - |
| `<stack-id>` | string | **Required.** Stack ID. |
| `<job-id>` | string | **Required.** |

## homelab api stacks relocations start

Move installed applications or Coolify resources from one owned stack's server to another.

Starts a verified move from the source server (this stack, `source_agent_id`) to a destination server of another owned stack. With `engine: native` it moves one installed `use_case` or one application (`workloads`): the destination adds it, receives the encrypted data straight from the source and reads its health and data back before the source is retired; the source stays stopped with its data until then and runs again when the move stops. With the Coolify engine (default) select either whole `projects` or individual `resource_uuids`; the transfer secret stays in Wallet custody (`wallet_item_id`) and domain switches go only to test domains. Needs exactly one Idempotency-Key; a replay returns the same job. Refused with 409 when a target holds locked services or server maintenance runs.

```bash theme={null}
homelab api stacks relocations start <stack-id> [flags]
```

| | |
| - | - |
| HTTP | `POST /api/v1/stacks/{id}/relocations` |
| Changes state | Yes |
| MCP tool | `start_workload_relocation` |

| Argument | Type | Description |
| - | - | - |
| `<stack-id>` | string | **Required.** Stack ID. |
| `--destination-agent-id` | string | **Required.** Guard agent of the destination server; must differ from the source. |
| `--destination-stack-id` | string | **Required.** |
| `--domain-switches` | string\[] | — |
| `--engine` | string | native moves installed applications; coolify (default) moves Coolify projects or resources. One of `coolify`, `native`. |
| `--owner-approved` | boolean | **Required.** One of `true`. |
| `--projects` | string\[] | Whole Coolify projects to move. Mutually exclusive with resource\_uuids. |
| `--resource-uuids` | string\[] | Individual Coolify resources to move. Mutually exclusive with projects. |
| `--source-agent-id` | string | **Required.** Guard agent of the source server in this stack. |
| `--use-case` | string | engine native: the installed use case to move with all its applications. Mutually exclusive with workloads. |
| `--wallet-item-id` | string | Coolify engine only: Wallet item id (itm\_...) of the transfer secret; never the secret itself. |
| `--workloads` | string\[] | engine native: one installed application (workload ref) to move. Mutually exclusive with use\_case. |
| `--body` | json | JSON request body (`application/json`) as a literal, `@path` or `-` for stdin. |

## homelab api stacks repair

Repair one degraded component of a completed rollout on its existing server.

A rollout whose stack core applied completes degraded when an
independent component could not finish; the component is recorded in
the stack's `degraded_components` and repaired automatically. This
operation starts that repair now. `public_tls` installs the managed
kombify.me origin certificate (ADR-0047) on the stack's server; its
hostnames come from the degraded rollout, never from the request.
Answers 409 `component_repair_not_needed` when nothing is degraded.

```bash theme={null}
homelab api stacks repair <stack-id> [flags]
```

| | |
| - | - |
| HTTP | `POST /api/v1/stacks/{id}/repair` |
| Changes state | Yes |
| MCP tool | `repair_stack_component` |

| Argument | Type | Description |
| - | - | - |
| `<stack-id>` | string | **Required.** Stack ID. |
| `--component` | string | **Required.** One of `public_tls`. |
| `--body` | json | JSON request body (`application/json`) as a literal, `@path` or `-` for stdin. |

## homelab api stacks requirements

Get requirements spec (Phase 1 output).

```bash theme={null}
homelab api stacks requirements <stack-id> [flags]
```

| | |
| - | - |
| HTTP | `GET /api/v1/stacks/{id}/requirements` |
| Changes state | No |
| MCP tool | `get_stack_requirements` |

| Argument | Type | Description |
| - | - | - |
| `<stack-id>` | string | **Required.** Stack ID. |

## homelab api stacks resume-enrollment

Resume one overdue managed Node wait on its exact existing VM.

Authenticated, idempotent recovery for a persisted `waiting_enrollment`,
`waiting_provider_provision`, or `waiting_canonical_guard` job whose
`next_resume_at` has been overdue beyond the bounded grace period. The
server validates the owned StackKit deployment, source job, wait reason,
exact lease, active foundation role, and canonical Node as one operation. It
atomically retires the exact source wait, creates or rehydrates one
deterministic replacement deploy bound to the same lease and Node,
and replays that job on later calls. Before handler entry,
queue workers atomically acquire the durable `tenant/stack` compatibility
execution claim; this serializes different jobs for the same StackKit
deployment across Homelab
replicas. The claim remains durable `running` until the handler exits,
including during cancellation. This endpoint never invokes provider VM
creation or selects a newer VM. A replacement found durable `running`
after a crash remains fail-closed, is reported as the same job, and is
never duplicated automatically; runtime-action reconciliation remains a
separate operator concern.

```bash theme={null}
homelab api stacks resume-enrollment <stack-id> [flags]
```

| | |
| - | - |
| HTTP | `POST /api/v1/stacks/{id}/resume-enrollment` |
| Changes state | Yes |
| MCP tool | `resume_stack_enrollment` |

| Argument | Type | Description |
| - | - | - |
| `<stack-id>` | string | **Required.** Stack ID. |
| `--job-id` | string | **Required.** Persisted source job currently projected as waiting\_enrollment. |
| `--lease-id` | string | **Required.** Exact managed foundation lease already bound to the source job. |
| `--body` | json | JSON request body (`application/json`) as a literal, `@path` or `-` for stdin. |

## homelab api stacks resume-remote-enrollment

Retry SSH enrollment of a connect-remote StackKit deployment.

Re-runs the Guard enrollment over the SSH connection persisted for a connect-remote deployment without rerunning the StackKit rollout. The deployment must belong to the authenticated owner and use the connect-remote transport; the credential comes from the Wallet node access item already bound to it, or from `ssh_wallet_item_id` when the connection should be rebound first. A plaintext password is never accepted by this contract.

```bash theme={null}
homelab api stacks resume-remote-enrollment <stack-id> [flags]
```

| | |
| - | - |
| HTTP | `POST /api/v1/stacks/{id}/resume-remote-enrollment` |
| Changes state | Yes |
| MCP tool | `resume_remote_enrollment` |

| Argument | Type | Description |
| - | - | - |
| `<stack-id>` | string | **Required.** Stack ID. |
| `--ssh-wallet-item-id` | string | Wallet node access item to rebind the stack's persisted SSH connection to before the retry. |
| `--body` | json | JSON request body (`application/json`) as a literal, `@path` or `-` for stdin. |

## homelab api stacks retry-rollout

Retry one failed StackKit deployment rollout on its exact existing managed VM.

Validates the owned failed deploy, its exact active foundation lease,
and canonical Node in one server-side operation. The deterministic
durable replacement bypasses provider VM creation, wins a durable
`tenant/stack` compatibility execution claim before handler entry, and is
replayed on repeated calls to this operation. The claim serializes different
jobs for the same StackKit deployment across replicas and remains
fail-closed as `running` after a process crash until operator reconciliation.

```bash theme={null}
homelab api stacks retry-rollout <stack-id> [flags]
```

| | |
| - | - |
| HTTP | `POST /api/v1/stacks/{id}/retry-rollout` |
| Changes state | Yes |
| MCP tool | `retry_stack_rollout` |

| Argument | Type | Description |
| - | - | - |
| `<stack-id>` | string | **Required.** Stack ID. |
| `--candidate-spec` | object | Optional canonical StackSpec repairing missing route, access and data dependencies of already admitted modules. The pinned CLI validates it; revision CAS and candidate digest bind retries. Applied installations must use their existing change-set authority. |
| `--current-spec-hash` | string | Normalized current node intent hash for an exact failed INIT whose immutable retry lineage proves a prior failed APPLY on this runtime. Required only for that partial INIT recovery; rejected on other paths. This is solely the CLI atomic CAS precondition, never authorization. Obtain through the pinned CLI resolve on the same current canonical node document. The durable receipt seals this value and lineage against changed replay. |
| `--lease-id` | string | **Required.** Exact active managed foundation lease bound to the failed job. |
| `--owner-approved` | boolean | Required true when supplying a canonical initial-rollout repair candidate. |
| `--source-job-id` | string | **Required.** Exact failed deploy job used as immutable retry evidence. |
| `--body` | json | JSON request body (`application/json`) as a literal, `@path` or `-` for stdin. |

## homelab api stacks routing ensure

Ensure the desired routing overlay for one exact StackKit deployment and Node.

Atomically persists an idempotent, revisioned routing overlay without mutating the user's immutable intent. server\_id is always exact and mandatory. lease\_id is mandatory for managed runtimes and omitted for a local/Basement runtime which has no lease. For a managed target, a true ensure\_rollout request dispatches the existing deploy pipeline only after proving that its selected active foundation lease and canonical Node equal this exact target. The API never reports the resulting job as already applied. The overlay is consumed only while deriving StackKits artifacts and this path never creates or selects a replacement VM.

```bash theme={null}
homelab api stacks routing ensure <stack-id> [flags]
```

| | |
| - | - |
| HTTP | `PUT /api/v1/stacks/{id}/routing` |
| Changes state | Yes |
| MCP tool | `ensure_stack_routing` |

| Argument | Type | Description |
| - | - | - |
| `<stack-id>` | string | **Required.** Stack ID. |
| `--if-match` | string | Optional optimistic-concurrency routing revision, for example `"3"`. |
| `--domain` | string | **Required.** Normalized custom domain; schemes, paths, ports, and wildcards are rejected. |
| `--ensure-rollout` | boolean | Request reconciliation without implying that it has already been dispatched or applied. Default `false`. |
| `--expectations` | object | Omission preserves expectations for the same domain/server/lease. An explicit empty object clears optional DNS and TLS pins. |
| `--lease-id` | string | Exact RuntimeLease for a managed target. Omit for a local/Basement ServerRuntime that genuinely has no lease; invented leases are rejected. |
| `--mode` | string | **Required.** One of `custom-domain`. |
| `--provenance` | object | **Required.** |
| `--server-id` | string | **Required.** Exact canonical ServerRuntime target belonging to the stack and owner. For a managed lease this is the server\_id exposed by the operations/ worker projection. If that read-model row is not present yet, Homelab may create only this deterministic ID from the validated exact lease. |
| `--body` | json | JSON request body (`application/json`) as a literal, `@path` or `-` for stdin. |

## homelab api stacks routing get

Read desired and observed routing state for one StackKit deployment.

Returns the tenant- and owner-bound routing overlay for the exact StackKit deployment. Desired state and observed/applied state are reported separately so clients never infer a successful DNS, TLS, or StackKit rollout from persistence alone.

```bash theme={null}
homelab api stacks routing get <stack-id> [flags]
```

| | |
| - | - |
| HTTP | `GET /api/v1/stacks/{id}/routing` |
| Changes state | No |
| MCP tool | `get_stack_routing` |

| Argument | Type | Description |
| - | - | - |
| `<stack-id>` | string | **Required.** Stack ID. |

## homelab api stacks routing targets

List explicit primary routing targets for one StackKit deployment.

Read-only discovery backed by active RuntimeLease authority. Returns every owner-visible foundation/control-plane target and never selects one, creates a canonical Node (`ServerRuntime`) projection, or mutates the StackKit deployment. Callers must send the complete server\_id and lease\_id tuple to a routing mutation.

```bash theme={null}
homelab api stacks routing targets <stack-id> [flags]
```

| | |
| - | - |
| HTTP | `GET /api/v1/stacks/{id}/routing/targets` |
| Changes state | No |
| MCP tool | `list_stack_routing_targets` |

| Argument | Type | Description |
| - | - | - |
| `<stack-id>` | string | **Required.** Stack ID. |

## homelab api stacks stackkit run

Queue an owned node's typed Advanced or backup operation.

Uses the same tenant- and owner-scoped dispatcher as the operator UI. The node executes through its authenticated channel, current release pin, native Advanced catalog and issued operation capability. Homelab never executes Terramate, apply, rollback, backup or restore itself. A mutation requires owner\_approved; service locks and active server maintenance are checked before enqueue. This is the owner's console route (operator panel, Guard update approval, acceptance journeys) with the owner's own confirmation in `owner_approved`; it has no MCP tool. The agent entry for an update and a backup run is the governed action card of `run_managed_service_action` (`update`, `backup`), whose Decision the agent's equipment answers. Direct backup\_run and backup\_configure remain Basement-only; managed kits keep their schedule and sealed target-renewal authority. backup\_configure derives the node's target and plan from existing custody and accepts no credential fields. advanced\_change\_set requires candidate\_spec; rollback requires an exact rollback\_target\_ref; restore\_drill may reuse a snapshot\_anchor\_id. ai\_provider lets Private AI offer an external OpenAI-compatible provider: the kombify Wallet seals the item wallet\_item\_id (the provider's API key) to the node, which must be listed as a host target of that item, the node binds it to ai\_provider\_base\_url, and a drift reconcile applies the setting. ai\_provider\_disable removes it. ssh\_trust\_recipient and ssh\_trust\_apply let the server trust the owner's kombify Wallet SSH CA: ssh\_trust\_recipient has the node answer the owner's recipient\_challenge with its owner-signed recipient statement and returns it with the host target the owner lists on the CA item; the owner then asks the Wallet for the ssh-ca-trust delivery and ssh\_trust\_apply hands its sealed\_delivery to the node, which installs TrustedUserCAKeys and the principals of each local user. Restore activation requires exactly one Idempotency-Key header, while other operations have no replay guarantee. Acceptance is not execution success; read the returned job and its scoped result to observe effects.

```bash theme={null}
homelab api stacks stackkit run <stack-id> [flags]
```

> [!WARNING]
>
> Requires confirmation: This operation can change the node deployment, replace its services or restore its data; approve the selected operation and exact target before dispatch. Pass `--yes` or answer the prompt; a non-interactive run without `--yes` stops before any request with exit code 9.

| | |
| - | - |
| HTTP | `POST /api/v1/stacks/{id}/stackkit/operations` |
| Changes state | Yes |
| MCP tool | None |

| Argument | Type | Description |
| - | - | - |
| `<stack-id>` | string | **Required.** Stack ID. |
| `--activation-operation-id` | string | — |
| `--agent-id` | string | **Required.** |
| `--ai-provider-base-url` | string | https base URL of the OpenAI-compatible provider API for ai\_provider. |
| `--ai-provider-disable` | boolean | Remove the external provider instead of setting it. |
| `--candidate-spec` | object | Canonical candidate StackSpec validated by the pinned node executor; required for advanced\_change\_set. |
| `--operation-dry-run` | boolean | — |
| `--offline` | boolean | — |
| `--operation` | string | **Required.** One of `plan`, `apply`, `verify`, `upgrade`, `drift_detect`, `drift_reconcile`, `advanced_change_set`, `rollback`, `restore_drill`, `backup_run`, `backup_configure`, `backup_status`, `backup_restore`, `backup_restore_activate`, `backup_restore_recover`, `ai_provider`, `ssh_trust_recipient`, `ssh_trust_apply`. |
| `--owner-approved` | boolean | — |
| `--recipient-challenge` | string | The owner's fresh challenge the node's recipient statement answers; ssh\_trust\_recipient only. |
| `--restore-plan-hash` | string | — |
| `--restore-result-id` | string | — |
| `--rollback-target-ref` | string | Exact executor-state snapshot or change-set digest. |
| `--sealed-delivery` | string | The kombify Wallet's sealed ssh-ca-trust, ssh-ca-revoke or ssh-host-certificate envelope (JSON text, public material only); ssh\_trust\_apply only. |
| `--snapshot-anchor-id` | string | — |
| `--stackkit` | string | Optional execution binding; normally derived from the stack's managed rollout. |
| `--target-release` | string | — |
| `--wallet-item-id` | string | kombify Wallet item holding the provider's API key for ai\_provider. |
| `--wallet-item-rotate` | boolean | Deliver a rotated item that replaces the version the node holds. |
| `--body` | json | JSON request body (`application/json`) as a literal, `@path` or `-` for stdin. |

## homelab api stacks unified

Get unified spec (Phase 2 output).

```bash theme={null}
homelab api stacks unified <stack-id> [flags]
```

| | |
| - | - |
| HTTP | `GET /api/v1/stacks/{id}/unified` |
| Changes state | No |
| MCP tool | `get_stack_unified` |

| Argument | Type | Description |
| - | - | - |
| `<stack-id>` | string | **Required.** Stack ID. |

## homelab api stacks use-cases configure

Change the configuration of one installed use-case workload.

Authors a native configuration change for one installed catalog workload (compute, storage and accelerator profiles, public settings, secret references) against the baseline named by `expected_spec_hash`, saves the candidate and queues the StackKit lifecycle jobs that apply it. The `Idempotency-Key` makes a retry replay the original acceptance. Refused with 409 while the stack is busy, a service is locked, a server is in maintenance, or the baseline changed.

```bash theme={null}
homelab api stacks use-cases configure <stack-id> <workload> [flags]
```

| | |
| - | - |
| HTTP | `POST /api/v1/stacks/{id}/use-cases/{workload}/configure` |
| Changes state | Yes |
| MCP tool | `configure_use_case` |

| Argument | Type | Description |
| - | - | - |
| `<stack-id>` | string | **Required.** Stack ID. |
| `<workload>` | string | **Required.** Installed catalog workload slug. |
| `--accelerator-profile` | string | — |
| `--compute-profile` | string | — |
| `--expected-spec-hash` | string | **Required.** Native baseline hash read from the use-case configuration view. |
| `--secret-refs` | object | Existing secret references by catalog key. Values are `secret://` references, never secret material. |
| `--settings` | object | Public catalog settings by key; each value is a string, boolean or number. |
| `--storage-profile` | string | — |
| `--body` | json | JSON request body (`application/json`) as a literal, `@path` or `-` for stdin. |

## homelab api stacks use-cases remove

Remove one workload or a whole use case from a StackKit deployment.

Retires an installed workload, or every installed workload of a catalog use case, through the native resolver against the baseline named by `expected_spec_hash`, and queues the StackKit lifecycle jobs. The workload stops running but its data is retained (`data_disposition: retain`). The `Idempotency-Key` makes a retry replay the original acceptance; refused with 409 while the stack is busy, a service is locked or a server is in maintenance.

```bash theme={null}
homelab api stacks use-cases remove <stack-id> [flags]
```

| | |
| - | - |
| HTTP | `POST /api/v1/stacks/{id}/use-cases/remove` |
| Changes state | Yes |
| MCP tool | `remove_use_case` |

| Argument | Type | Description |
| - | - | - |
| `<stack-id>` | string | **Required.** Stack ID. |
| `--expected-spec-hash` | string | **Required.** Native baseline hash read from the use-case configuration view. |
| `--selector-kind` | string | **Required.** One of `workload`, `use_case`. |
| `--selector-ref` | string | **Required.** Workload slug or catalog use-case id; no surrounding whitespace. |
| `--body` | json | JSON request body (`application/json`) as a literal, `@path` or `-` for stdin. |

## homelab api stacks validate-import

Validate spec without importing.

```bash theme={null}
homelab api stacks validate-import [flags]
```

| | |
| - | - |
| HTTP | `POST /api/v1/stacks/import/validate` |
| Changes state | Yes |
| MCP tool | `validate_import` |

| Argument | Type | Description |
| - | - | - |
| `--body` | json | **Required.** JSON request body (`application/json`) as a literal, `@path` or `-` for stdin. |

## homelab api stacks verify-chain

Verify spec hash chain integrity.

```bash theme={null}
homelab api stacks verify-chain <stack-id> [flags]
```

| | |
| - | - |
| HTTP | `GET /api/v1/stacks/{id}/verify-chain` |
| Changes state | No |
| MCP tool | `verify_spec_chain` |

| Argument | Type | Description |
| - | - | - |
| `<stack-id>` | string | **Required.** Stack ID. |

## homelab api stacks workers assign

Assign an approved worker server to an owned stack.

Binds one approved, connected worker of the owner to one owned stack through the canonical server runtime. A worker that is not approved yet, or that already belongs to another stack, answers 409; assigning it to the stack it already belongs to is a no-op. The body is empty.

```bash theme={null}
homelab api stacks workers assign <stack-id> <worker-id> [flags]
```

| | |
| - | - |
| HTTP | `POST /api/v1/stacks/{id}/workers/{workerId}/assign` |
| Changes state | Yes |
| MCP tool | `assign_worker_to_stack` |

| Argument | Type | Description |
| - | - | - |
| `<stack-id>` | string | **Required.** Stack ID. |
| `<worker-id>` | string | **Required.** |


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