Skip to content

List saved SSH keys for a VPS

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

Lists the SSH keys saved on your account, after checking that the VPS is yours. The keys belong to the account. The list is the same for every VPS. GET /api/v2/ssh-keys returns the same keys without a VPS. Install keys with POST /api/v2/vps/{id}/actions/reset-ssh-keys or PATCH /api/v2/vps/{id}/ssh-access. To see which keys can log in to the VPS now, use GET /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-keys
curl "https://cloud.hostup.se/api/v2/vps/vps_01hxa3b4c5d6e7f8g9h0j1k2m3/ssh-keys" \
-H "Authorization: Bearer $HOSTUP_API_KEY"

Responses

200 The saved SSH keys on the account.

Response 200
{
"sshKeys": [
{
"id": "ssh_01hxa3b4c5d6e7f8g9h0j1k2m3",
"displayId": "Laptop",
"name": "Laptop",
"publicKey": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIE9wZW5BUElFeGFtcGxlS2V5TWF0ZXJpYWwxMjM0 alex@example.com",
"fingerprint": "SHA256:8pQ3ExampleFingerprintForDocsOnly",
"keyType": "ed25519",
"createdAt": null,
"lastUsedAt": null
}
]
}
Response fields
sshKeysarray of object
idstring
displayIdstring
An older display label on the SSH key list of a VPS. Use name and fingerprint instead.
namestring
publicKeystring
fingerprintstring or null
keyTypestring
One of rsa, ed25519, ecdsa, dsa, unknown.
createdAtstring or null
lastUsedAtstring or null
When the key was last used. Present only on the SSH key list of a VPS, when known.
actionsobject
Present on the account’s SSH key list.
canRenameobject
allowedboolean
reasonstring or null
codestring or null
A machine-readable code for why the action is blocked.
canDeleteobject
allowedboolean
reasonstring or null
codestring or null
A machine-readable code for why the action is blocked.

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.