# POST /backups/remote/test

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

UrbeStack release 0.2.35 API operation in the backups group.

Test the remote backup destination

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

UrbeStack creates its SSH key pair if needed and uses it to connect to backups.remote_host on backups.remote_port as backups.remote_user. It creates backups.remote_path and any missing parent directories, then lists the destination's contents, including backup day folders. The response contains the test result in remote.

On the first connection, UrbeStack records the SSH host key in known_hosts and reports its fingerprint. Future transfers require the recorded key. If the test reports a changed host key, verify the change, run urbestack-backup-remote-key with --forget-host, and test again.

The API returns 400 if backups.remote_host, backups.remote_user or backups.remote_path is unset, and 403 if the caller lacks administrator privileges. It returns 502 if the host key has changed, the host does not respond, the remote account rejects UrbeStack's key, or the remote host lacks rsync. The error includes the SSH failure or installation instructions as applicable. Nightly transfers use rsync on both hosts. Configure the destination through PUT /settings/{key}.

## As a command

- [urbestack-backup-remote-test](https://urbestack.com/docs/commands/urbestack-backup-remote-test.md): Tests the remote backup destination, as the Test button does.

## 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/test" \
  -H "Authorization: Bearer $TOKEN"
```

Response, 200 OK:

```
{
  "remote": {
    "days": [
      "text"
    ],
    "entries": 1,
    "fingerprint": "text",
    "free_bytes": 1,
    "host": "text",
    "host_key": {
      "fingerprint": "text",
      "name": "alice",
      "type": "rebuild"
    },
    "path": "public_html/index.php",
    "port": 8443,
    "size_bytes": 1,
    "user": "alice"
  }
}
```

## Errors

- 400: Name the remote host, user and path first
- 401: Authentication required
- 403: Insufficient privileges
