Skip to content

List the SSH keys that can log in to a VPS

GET /api/v2/vps/{id}/ssh-access

Reads ~/.ssh/authorized_keys of the login user on the running VPS and lists every public key in it. Keys added inside the VPS are included. Each line shows its OpenSSH options as restrictions. The key material and option values are not returned. The file is read through the guest agent. When it cannot be read, for example while the VPS is stopped, available is false, entries is empty and unavailableReason says why. Change the list with PATCH /api/v2/vps/{id}/ssh-access.

Authentication: An API key with the scope read:vm. About keys and scopes

Request

Path parameters

idstringrequired
The VPS ID (vps_…).

Example

GET /api/v2/vps/{id}/ssh-access
curl "https://cloud.hostup.se/api/v2/vps/vps_01hxa3b4c5d6e7f8g9h0j1k2m3/ssh-access" \
-H "Authorization: Bearer $HOSTUP_API_KEY"

Responses

200 The keys in the file or the reason it could not be read.

{
"available": true,
"unavailableReason": null,
"unavailableMessage": null,
"loginUser": "root",
"checkedAt": "2026-08-13T10:00:00.000Z",
"revision": "9b74c9897bac770ffc029102a200c5de6e2c7e1c4f2a3b8d0e5f6a7b8c9d0e1f",
"entries": [
{
"id": "ak_5b2d8a4c6e0f1b3d5a7c9e1f3a",
"keyType": "ssh-ed25519",
"fingerprint": "SHA256:exampleFingerprint",
"comment": "alex@laptop",
"restricted": false,
"restrictions": [],
"savedKeyId": "ssh_01hxa3b4c5d6e7f8g9h0j1k2m3",
"savedKeyName": "Laptop"
},
{
"id": "ak_3f9a1c7e5b2d8a4c6e0f1b3d5a",
"keyType": "ssh-ed25519",
"fingerprint": "SHA256:exampleFingerprint",
"comment": "deploy-bot",
"restricted": true,
"restrictions": [
"forced_command",
"pty_disabled",
"port_forwarding_disabled"
],
"savedKeyId": null,
"savedKeyName": null
}
],
"savedKeys": [
{
"id": "ssh_01hxa3b4c5d6e7f8g9h0j1k2m3",
"name": "Laptop",
"fingerprint": "SHA256:exampleFingerprint",
"active": true,
"activeEntryIds": [
"ak_5b2d8a4c6e0f1b3d5a7c9e1f3a"
]
}
]
}
Response fields
availableboolean
True when the file was read from the running VPS. When false, entries is empty and nothing can be changed.
unavailableReasonstring or null
Why the file could not be read. vps_not_ready: setup is not finished. vm_not_running: the VPS is stopped. guest_exec_disabled: commands inside the VPS are turned off. guest_agent_unavailable: the guest agent does not answer. unsupported_guest: the file could not be read from this operating system. Null when available is true. One of vps_not_ready, vm_not_running, guest_exec_disabled, guest_agent_unavailable, unsupported_guest.
unavailableMessagestring or null
A sentence you can show to a person. Null when available is true.
loginUserstring
The user whose ~/.ssh/authorized_keys was read. The VPS’s default login user, usually root.
checkedAtstring
When the file was read.
revisionstring or null
Version of the file. Send it as revision to PATCH. Null when available is false.
entriesarray of object
Every public key line in the file, including keys added inside the VPS.
idstring
ID of this line in the file. It changes when the line or its position changes. Use it in removeEntryIds.
keyTypestring
Key algorithm.
fingerprintstring
SHA256 fingerprint of the public key.
commentstring or null
Comment at the end of the key line.
restrictedboolean
True when the line has OpenSSH options that limit the key.
restrictionsarray of string
The options on the line. forced_command is command=, source_restricted is from=, expires is expiry-time=, restricted is restrict. custom_options covers any other option. The values of the options are not returned.
savedKeyIdstring or null
The saved SSH key on your account with the same public key. Null when the key is not saved on the account.
savedKeyNamestring or null
Name of that saved key.
savedKeysarray of object
The SSH keys saved on your account and whether each one is in the file.
idstring
Saved SSH key ID. Use it in addSshKeyIds.
namestring
Name of the saved key.
fingerprintstring or null
SHA256 fingerprint of the key.
activeboolean
True when the key is in the file now.
activeEntryIdsarray of string
The entries[].id values that hold this key.

Errors

Errors are Problem Details with a stable code. Branch on the code, not on the text.

400Invalid request. The response body is an RFC 7807 Problem Details document.
401Unauthorized. Authentication is required.
403Forbidden. The caller lacks a required scope or does not own the resource.
404Not found. The resource does not exist or is not owned by the caller; code is vps_not_found.
429Rate limited. Retry after the limit resets. 429 responses include Retry-After seconds plus X-RateLimit-* headers.
500Internal error. Retry later or contact support if the issue persists.