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
idstringrequiredThe VPS ID (
vps_…).Example
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.
{ "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 objectidstringdisplayIdstringAn older display label on the SSH key list of a VPS. Use
name and fingerprint instead.namestringpublicKeystringfingerprintstring or nullkeyTypestringOne of
rsa, ed25519, ecdsa, dsa, unknown.createdAtstring or nulllastUsedAtstring or nullWhen the key was last used. Present only on the SSH key list of a VPS, when known.
actionsobjectPresent on the account’s SSH key list.
canRenameobjectallowedbooleanreasonstring or nullcodestring or nullA machine-readable code for why the action is blocked.
canDeleteobjectallowedbooleanreasonstring or nullcodestring or nullA 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.
| 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. |