Home Assistant's Supervisor API Said 401, So We Used Key-Only SSH Instead
Long-lived tokens cannot call Home Assistant's Supervisor endpoints, by design. We gave automation a narrower, auditable route: a key-only SSH add-on with its own dedicated key, and a clear map of what each channel can and cannot do.

Key Architectural Takeaways
- Long-lived tokens cover entities, config entries and websocket actions but never the Supervisor API.
- A dedicated key-only SSH add-on gives file and CLI access, and a separate key keeps it isolated from the fleet-wide key.
- Know what each channel cannot do: an add-on's own configuration tab was not reachable remotely.
The challenge
We wanted automation to be able to manage the smart-home setup without a person re-bootstrapping access for every task. The first attempt used a long-lived access token. Calls to the main API worked. Every call to the Supervisor's endpoints returned a clean 401.
What was going on
This is structural, not a permissions slip. Home Assistant core blocks Supervisor calls for bearer tokens entirely, so no scope or admin flag on the token changes the answer. We recorded the diagnosis plainly rather than burning time on it.
The access model we built
- Long-lived token (REST and websocket) — Can do: Entities, states, config entries and flows, entity registry, dashboards, areas, service calls; Cannot do: Anything under the Supervisor API
- Terminal and SSH add-on (key-only) — Can do: Read and write the config directory, run the
haCLI to install, start, stop and restart add-ons, view logs; Cannot do: Edit an add-on's own options - A person at the UI — Can do: An add-on's Configuration tab, such as plugin lists and "show in sidebar"; Cannot do: n/a
The SSH add-on was installed and started by a person at the console, configured for key authentication only (no password), with a dedicated keypair used only for this host. It is deliberately separate from the fleet-wide administration key, so revoking one never affects the other.
Proof it works
Through that channel we installed a community component by cloning it to a temporary directory and copying the real files into the config directory, which matches how the community package manager lays them down. We then restarted Core and confirmed it was back by polling the web port until it returned 200. The SSH command itself timed out during the restart, which is expected, because Core takes longer than a short command timeout.
A control that did its job
Installing third-party code onto a live instance was held by the tooling's own safety check on the first attempt. The broader request "give automation access" and the narrower "install this component" are different approvals, and we proceeded only after an explicit go-ahead for the second. We record that here as a pattern: new classes of action get their own confirmation.
Verification
Key-only SSH to the add-on succeeded, the config directory was writable, and the component installed and loaded after the restart.
Takeaway
Map your access channels by what each one cannot do, not just what it can. The gaps tell you where a human is still required, and writing them down stops the next session from rediscovering them.