Daemons

Provision or re-provision daemon

Changed on

Creates a daemon record on the server before the daemon is installed and mints an API key bound to it 1:1. Returns the daemon record and that key, which is shown only once and must be configured on the daemon.

When daemon_id is supplied the existing record is reused instead of creating a new one, giving a legacy daemon (one with no bound key) a pathway to a dedicated key without losing its host, discovery jobs, or history. Re-provisioning always mints a fresh key.

Install commands are not built here — fetch them from the install-command endpoint, which builds them idempotently and fills in the key this returns. That keeps a display-only regenerate (an OS switch, an advanced-setting change) from re-minting the key.

post/api/v1/daemons/provision

Request

  • Base URL
    https://app.scanopy.net
  • URL
    https://app.scanopy.net/api/v1/daemons/provision
  • Auth
    • API key in header Authorization
    • or API key in cookie session_id

Request body

daemon_idstring uuid nullable

Mint a fresh 1:1 key for this existing daemon instead of creating a new record, keeping its host, discovery jobs and history. Used to give a legacy daemon (no bound key) a dedicated one. When set, name/site_id/mode/url are ignored — those come from the existing record.

Only accepted for a daemon that has never checked in or has no bound key; a live provisioned daemon is refused, since it has no way to learn the new key.

Note: install commands are not generated here — call the install-command endpoint, which builds them idempotently and fills in the key this response returns.

mode'server_poll' | 'daemon_poll'

Daemon operating mode that determines the communication pattern.

  • DaemonPoll (formerly "Pull"): Daemon makes outbound connections to the server. The daemon registers itself and polls for work. Best for daemons behind NAT/firewall.

  • ServerPoll (formerly "Push"): Server makes connections to the daemon. Server polls daemon for status and discovery results. Best for DMZ deployments where daemon cannot make outbound connections.

namestring nullable

Human-readable name for the daemon. Required unless daemon_id is set, in which case the existing record's name is kept.

os'linux' | 'macos' | 'windows' | 'freebsd'

Operating system a daemon is installed on, as picked when it is created.

site_idstring uuid nullable

Site this daemon will be associated with. Required unless daemon_id is set, in which case the existing record's site is kept.

urlstring nullable

Reachable URL where the server can dial the daemon. Required for ServerPoll, unused for DaemonPoll (the daemon dials out instead).

Response

Daemon provisioned successfully

errorstring nullable

Not sent on a successful response. Failure messages arrive in an ApiErrorResponse.

successboolean required

Always true on a successful response.

Example response

{
  "data": {
    "daemon": {
      "url": "https://daemon.example.com:60073",
      "version": "0.17.7"
    }
  },
  "meta": {
    "api_version": 1,
    "server_version": "0.19.4"
  }
}

Changes

    • info

      added the required property /// to the response with the status

    • breaking

      removed subschema #2: Network from the / request property oneOf list

    • breaking

      removed the required property ////// from the response with the status

    • warning

      removed the request property

    • info

      added the new optional request property

    • info

      added subschema #2: Site to the / request property oneOf list

    • info

      added the required property ////// to the response with the status