Skip to main content
POST
Add an SSH connection
Explicit host-access consent and a non-secret idempotency_key are required. Same key/body replays for 24 hours, including after credential rotation. Changed bodies, expired keys and deleted connections conflict. Keep credentials in a caller-side secret manager, never prompts or command history. REST only. Requires an API key with ssh:write, which is never granted by default: select it explicitly when creating the key.

Server setup requirements

Reason’s hosted connector initiates SSH from Reason’s cloud, not from your browser or computer. Configure the server before saving a connection:
  1. Use a Linux server or a Mac (macOS on Apple silicon or Intel) with an x64 or arm64 CPU. Windows is not supported by this automatic installation flow. SSH devices run headlessly; they do not provide desktop streaming or interactive desktop control.
  2. Provide a public hostname or IP address and an SSH port reachable from Reason’s cloud. Private LAN, localhost, and Tailscale-only addresses are not supported, so a Mac or server behind a home router needs a public address or port forward. A successful SSH connection from your own computer does not prove cloud reachability. Reason may connect from more than one address. Configure the host’s firewall and any upstream network rules according to your organization’s security policy; do not disable the firewall.
  3. Enable SSH and authorize the supplied SSH user with a password or private key. Prefer a dedicated, least-privileged account and key. The account needs a private, writable home directory, disk space for the worker, and permission to read, write, and execute within its workspace. Root or administrator access is not required.
  4. Allow outbound HTTPS for the CLI download and the worker’s connection to Reason. On Linux, the host needs bash, curl, getent, stat, readlink, and timeout. With systemd, a non-root user needs lingering enabled by the administrator. Without systemd, use Reconnect after the host restarts or the worker stops; such a worker also does not update itself, and Reconnect installs the current release. On macOS, the stock system tools are sufficient and the account does not need to sign in to the desktop. The worker runs as a per-user launchd agent, so use Reconnect after the Mac restarts, and keep the Mac from sleeping while it should accept work. With systemd or launchd, the worker checks for a new Reason release every six hours and restarts on it after finishing its current work.
  5. Save the connection, then connect to probe the SSH host key. Compare the fingerprint with a trusted source before choosing Trust & install, for example by running ssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pub on the host through a console you already trust. Reason installs and enrolls the worker only after that verification.
For example, an administrator can prepare a dedicated user on a systemd host, replacing the public key:
On a Mac, turn on Remote Login in System Settings > General > Sharing. Then an administrator can prepare the account from Terminal, replacing the public key. The dseditgroup line is needed only when Remote Login allows only specific users:

Run a Session on the host

Once the connection is connected, its device_id is the enrolled Device (a different ID from the connection). Read GET /v3/organizations/{orgId}/devices/{device_id} and use a root’s id as root_id, then create a Session with devices:use:
GET the Session to read back its target.

Remove the host software

Deleting a connection deletes its credentials and revokes its Device; the worker files stay on the host. To remove them, run if [ "$(uname -s)" = Darwin ]; then for label in com.reasonmachines.ssh-updater.<connection_id> com.reasonmachines.ssh-worker.<connection_id> so.reason.ssh-updater.<connection_id> so.reason.ssh-worker.<connection_id> so.ara.ssh-updater.<connection_id> so.ara.ssh-worker.<connection_id>; do launchctl bootout user/$(id -u)/$label 2>/dev/null; rm -f ~/Library/LaunchAgents/$label.plist; done; else systemctl --user disable --now reason-ssh-<connection_id>-update.timer; systemctl --user disable --now reason-ssh-<connection_id>.service; rm -f ~/.config/systemd/user/reason-ssh-<connection_id>.service ~/.config/systemd/user/reason-ssh-<connection_id>-update.service ~/.config/systemd/user/reason-ssh-<connection_id>-update.timer; systemctl --user daemon-reload; fi; rm -rf ~/.reason-ssh/<connection_id> as the SSH user. For root, use systemctl without --user and the units in /etc/systemd/system. The workspace is left in place: by default the shared ~/.reason/workspace, which other Reason workers on the host also use. If setup fails, inspect the connection’s error_code: ssh_host_blocked means the address is not permitted; ssh_dns_failed means name resolution failed; ssh_authentication_failed means the credentials were rejected; ssh_platform_unsupported means the operating system or architecture is unsupported. A connected setup receipt is not proof that the Device remains online; check its current Device status. Scope: ssh:write

Authorizations

Authorization
string
header
required

Your Reason API key from Settings › API keys. New keys use reason_; legacy ara_ keys remain accepted. Keys are capability-scoped: run, mcp:read, mcp:write, secrets:read, secrets:write, sessions:read, sessions:debug, devices:read, devices:write, devices:use, computers:read, computers:write, ssh:write, knowledge:read, memory:read, memory:write, skills:read, skills:write, pages:read, pages:write, repos:read, repos:write, reviews:read, reviews:write, deployment:read, analytics:read, org:read, org:write, attachments:read, attachments:write, guardrails:read, guardrails:write, network:read, network:write, automations:read, automations:write, agent_auth:read. devices:write, devices:use, computers:read, computers:write, ssh:write, network:read and network:write are opt-in, excluded from default keys. computers:read lists visible cloud and connected computers without waking them or granting execution access. devices:read discovers local Device targets; devices:use separately consents to local execution, so a discover-and-run local workflow needs both. devices:write manages enrollment and device grants; computers:write creates or deletes cloud computers; ssh:write manages retained SSH access. network:read reads the saved workspace network policy; network:write replaces custom allowed hosts and requires a current organization owner/admin. Legacy project PATCH requests containing network_allowed_hosts also require network:write plus their existing run scope and project management permission; saved project hosts do not affect current session egress. Only owners/admins can mint or manage keys with network:write; keys cannot grant themselves more authority. See /docs/network-policies for replacement semantics and runtime applicability. mcp:write manages MCP server configuration only; it does not authorize remote MCP-tool execution. sessions:read reads sessions, including the assistant, reasoning and tool activity in their events. sessions:debug is privileged: only for organization owners/admins, it expands session events to the full diagnostic projection (diagnostic event kinds, status text and raw event metadata).

Scopes

ssh:write

Path Parameters

orgId
string
required

Organization id or slug. Resolve it with GET /v3/self.

Body

application/json
name
string
required
Required string length: 1 - 160
host
string
required
Required string length: 1 - 253
Pattern: ^[a-zA-Z0-9.:_-]+$
username
string
required

SSH username, up to 64 characters, or Railway's sbx:: routing selector.

Required string length: 1 - 77
authentication
object
required
idempotency_key
string
required

Persist one non-secret key per logical request. Retry the identical body/key for up to 24 hours. Expired or deleted request keys return 409; reconnect intentionally with a fresh key.

Required string length: 1 - 160
Pattern: ^[A-Za-z0-9._:-]+$
port
integer
default:22
Required range: 1 <= x <= 65535
workspace_path
string

Optional absolute remote workspace path. Omit to use the installer's private default workspace.

Required string length: 1 - 1024

Response

Original saved receipt replayed.

connection
object
required
replayed
boolean
required