---
title: "Generate daemon install command"
method: GET
path: "/api/v1/daemons/{id}/install-command"
tags: ["Daemons"]
---

# Generate daemon install command

`GET /api/v1/daemons/{id}/install-command`

A pure, idempotent builder — it never mints or persists anything. The api key in an `install`
command is a placeholder (`<API_KEY>`) the caller substitutes from the plaintext it holds; a
`reconfigure` command carries no key at all. Minting is a separate mutation
(`POST /provision`), so regenerating a command here (advanced-setting change, OS switch, the
Details reconfigure view) never rotates the daemon's key.

The server derives the exact command shape from the record: DaemonPoll vs ServerPoll for the
flags, and — for `install` — whether the daemon has checked in (`last_seen`) to decide between
a first-install and a minimal re-key command.

## Path parameters

- `id` string, uuid, required

## Query parameters

- `purpose` 'install' | 'reconfigure', required — What the caller wants the command to do — the one axis that actually varies. `install` brings a daemon up (or re-keys a legacy one): it carries the api-key placeholder, fetches the binary, and spells out the connectivity + advanced config. `reconfigure` adjusts an already-installed daemon in place: no key, no fetch, just the server-held connectivity — `scanopy-daemon install` layers it over the existing `config.json`. There is no third case: re-asserting the record's (correct) values on an installed daemon is harmless, so a first install and a re-key are the same command.
- `log_level` string, nullable
- `log_file` string, nullable
- `heartbeat_interval` integer, nullable
- `bind_address` string, nullable
- `allow_self_signed_certs` boolean, nullable
- `accept_invalid_scan_certs` boolean, nullable
- `interfaces` string, nullable
- `credential_refs` string, nullable

## Response `200`

Install command

- ApiResponseInstallArtifacts
  - `data` object — Everything the UI needs to install (or reconfigure) a daemon, one field per install method so each is a first-class peer with its own content — no method is a special case bolted onto a list. The binary methods are ready-to-paste commands (any api key is the [`API_KEY_PLACEHOLDER`], filled in client-side); docker and msi carry their own structured content.
    - `docker` DockerInstall, required — The docker install method.
      - `compose` string, nullable — A ready-to-run `docker-compose.yml` for a first install. `None` for a reconfigure — the operator keeps their own compose and swaps in `env`, rather than replacing the whole file.
      - `env` string[], required — The `SCANOPY_*` environment variables (`KEY=value`) this daemon is configured with. For a reconfigure these are exactly the vars that changed, so the UI can show them as a swap-in.
    - `freebsd` string, required — Download for FreeBSD.
    - `linux` string, required — Download for Linux.
    - `macos` string, required — Download for macOS.
    - `msi` MsiInstall, required — The Windows MSI install method. The MSI itself is a static release asset the UI links to; only the per-daemon pre-fill data is tenant-specific.
      - `filename` string, required — Filename encoding this daemon's non-secret config. Save or rename the downloaded MSI to this name to pre-fill the installer — parse-filename.js decodes it. The api key is never encoded. Renaming a signed MSI doesn't affect its signature.
      - `omitted_config_keys` string[], required — Config keys that did not fit in `filename` (a filename is capped at 255 characters). Empty for any ordinary config. The MSI falls back to its built-in defaults for these, so the UI should tell the user to set them in the installer — the other methods carry the full config.
    - `windows` string, required — Download for Windows.
  - `error` string, nullable — Human-readable failure message. Omitted on success.
  - `meta` ApiMeta, required — API metadata included in all responses
    - `api_version` integer, required — API version (integer, increments on breaking changes)
    - `server_version` string, required — Server version (semver)
  - `success` boolean, required — `true` when the request succeeded. `false` responses carry `error` instead of `data`.

## Other responses

- `404` — daemon not found

---

[API](https://skmtc.net/scanopy/apis/scanopy-api.md) · [All operations](https://skmtc.net/scanopy/apis/scanopy-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/scanopy/scanopy-api/versions/28e466341947/schema)
