---
title: "Add a server over SSH: log in with the given credentials, install `temps` if needed, pair the server and start its agent. Runs in the background; follow it with `GET /nodes/ssh/enrollments/{enrollment_id}`."
method: POST
path: "/nodes/ssh/enrollments"
tags: ["Nodes"]
---

# Add a server over SSH: log in with the given credentials, install \`temps\` if needed, pair the server and start its agent. Runs in the background; follow it with \`GET /nodes/ssh/enrollments/{enrollment_id}\`.

`POST /nodes/ssh/enrollments`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/nodes/ssh/enrollments`
- Auth: HTTP bearer

## Request body

- NodeSshEnrollmentCreateRequest: Add a server over SSH.
  - `credentials` union, required: How to log in to the server. Used for this enrollment only, never stored. Its `Debug` never prints the credentials.
    - object: The user's password; also used for `sudo` if it asks for one.
      - `method` 'password', required
      - `password` string, required
    - object: An OpenSSH or PEM private key, with its passphrase if it has one.
      - `method` 'private_key', required
      - `passphrase` string, nullable
      - `private_key` string, required
    - object: The SSH agent of the control plane's `temps serve` process.
      - `method` 'agent', required
  - `host` string, required: Hostname or IP address.
  - `host_key_fingerprint` string, required: The host-key fingerprint the operator confirmed (from `POST /nodes/ssh/host-key`). The enrollment stops if the server presents another key.
  - `name` string, nullable: Name the node registers under. Defaults to `worker-<random>`.
  - `node_address` string, nullable: The server's public address for WireGuard, `ip` or `ip:port`, when it is not the address SSH connects to.
  - `port` integer, nullable: SSH port (default 22).
  - `user` string, required: User to log in as: root, or a user with sudo.

## Response `202`

Enrollment started

- NodeSshEnrollmentResponse: An "add server over SSH" as the Worker Nodes page shows it.
  - `agent_mode` string, nullable: `service` (systemd unit) or `detached` (started without a service manager: it does not come back after a reboot).
  - `auth_method` string, required: `password`, `private_key` or `agent`.
  - `created_at` string, required
  - `error` string, nullable: Why it failed, and what to do.
  - `finished_at` string, nullable
  - `host` string, required
  - `host_key_fingerprint` string, required
  - `id` integer, required
  - `log` string, required: What it did, with the server's output (its last 64 KiB).
  - `name` string, required
  - `node_id` integer, nullable
  - `pairing_id` integer, nullable: The pairing it runs on the server.
  - `ssh_address` string, required
  - `ssh_user` string, required
  - `status` string, required: `running`, `succeeded` or `failed`.
  - `step` string, required: What it is doing, or was doing when it stopped.

## Other responses

- `400`: Invalid host, user, fingerprint or name
- `401`: Unauthorized
- `403`: Insufficient permissions
- `409`: The mesh is off or not ready, or too many enrollments are running
- `428`: Re-authentication required
- `500`: Internal server error

## Changes

- **2026-10-05** `4b228ebed583`: 1 info
  - endpoint added
- **2026-10-05** `63a80791dc58`: 1 breaking
  - api path removed without deprecation
- **2026-10-04** `0af240880dca`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/nodes/ssh/enrollments/post.md)

---

[API](https://skmtc.dev/gotempsh/apis/temps.md) - [All operations](https://skmtc.dev/gotempsh/apis/temps/llms.txt) - [OpenAPI document](https://skmtc.dev/gotempsh/apis/temps/revisions/3b040526eb43?raw)
