# POST /backups/remote/key

First published 3 Oct 2026 (release 0.1.0) · Unchanged since publication

UrbeStack release 0.2.35 API operation in the backups group.

Get UrbeStack's SSH public key for remote backups

- Who may call it: administrator
- Token scope, any of: backups, all
- Answers: 200 OK

UrbeStack creates its Ed25519 key pair on the first call and returns the same public key on subsequent calls. The response contains public_key, fingerprint and any recorded SSH host key in host_key. The private key stays in UrbeStack's state directory and is accessible only to root.

Add the public key to ~/.ssh/authorized_keys for the account specified by backups.remote_user on backups.remote_host. The API returns 403 if the caller lacks administrator privileges.

## As a command

- [urbestack-backup-remote-key](https://urbestack.com/docs/commands/urbestack-backup-remote-key.md): Shows the public key and fingerprint of UrbeStack's Ed25519 key pair for remote backups, along with any recorded host key.

## Example

Set $API to the base URL and $TOKEN to the token, as the [API overview](https://urbestack.com/docs/api.md) shows.

```
curl -sS -X POST "$API/backups/remote/key" \
  -H "Authorization: Bearer $TOKEN"
```

Response, 200 OK:

```
{
  "fingerprint": "text",
  "host_key": {
    "fingerprint": "text",
    "name": "alice",
    "type": "rebuild"
  },
  "public_key": "text"
}
```

## Errors

- 401: Authentication required
- 403: Insufficient privileges
- 404: No host key is recorded
