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
idstringrequiredThe VPS ID (
vps_…).Example
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" ] } ]}{ "available": false, "unavailableReason": "vm_not_running", "unavailableMessage": "The server is stopped. Start it before reviewing or changing SSH access.", "loginUser": "root", "checkedAt": "2026-08-13T10:00:00.000Z", "revision": null, "entries": [], "savedKeys": [ { "id": "ssh_01hxa3b4c5d6e7f8g9h0j1k2m3", "name": "Laptop", "fingerprint": "SHA256:exampleFingerprint", "active": false, "activeEntryIds": [] } ]}Response fields
availablebooleanTrue when the file was read from the running VPS. When false,
entries is empty and nothing can be changed.unavailableReasonstring or nullWhy 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 nullA sentence you can show to a person. Null when
available is true.loginUserstringThe user whose
~/.ssh/authorized_keys was read. The VPS’s default login user, usually root.checkedAtstringWhen the file was read.
revisionstring or nullVersion of the file. Send it as
revision to PATCH. Null when available is false.entriesarray of objectEvery public key line in the file, including keys added inside the VPS.
idstringID of this line in the file. It changes when the line or its position changes. Use it in
removeEntryIds.keyTypestringKey algorithm.
fingerprintstringSHA256 fingerprint of the public key.
commentstring or nullComment at the end of the key line.
restrictedbooleanTrue when the line has OpenSSH options that limit the key.
restrictionsarray of stringThe 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 nullThe saved SSH key on your account with the same public key. Null when the key is not saved on the account.
savedKeyNamestring or nullName of that saved key.
savedKeysarray of objectThe SSH keys saved on your account and whether each one is in the file.
idstringSaved SSH key ID. Use it in
addSshKeyIds.namestringName of the saved key.
fingerprintstring or nullSHA256 fingerprint of the key.
activebooleanTrue when the key is in the file now.
activeEntryIdsarray of stringThe
entries[].id values that hold this key.Errors
Errors are Problem Details with a stable code. Branch on the code, not on the text.
| 400 | Invalid request. The response body is an RFC 7807 Problem Details document. |
| 401 | Unauthorized. Authentication is required. |
| 403 | Forbidden. The caller lacks a required scope or does not own the resource. |
| 404 | Not found. The resource does not exist or is not owned by the caller; code is vps_not_found. |
| 429 | Rate limited. Retry after the limit resets. 429 responses include Retry-After seconds plus X-RateLimit-* headers. |
| 500 | Internal error. Retry later or contact support if the issue persists. |