Rename a saved SSH key
PATCH /api/v2/ssh-keys/{id}
Changes the name of an SSH key saved on your Hostup account. The key itself and its ID stay the same. To use a different key, save the new one with POST /api/v2/ssh-keys and delete the old one.
Authentication: An API key with the scope write:account. About keys and scopes
Request
Path parameters
idstringrequiredThe saved SSH key ID (
ssh_…).Body
namestringrequiredThe new name, up to 100 characters.
Example
curl -X PATCH "https://cloud.hostup.se/api/v2/ssh-keys/ssh_01hxa3b4c5d6e7f8g9h0j1k2m3" \ -H "Authorization: Bearer $HOSTUP_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "production-deploy-key" }'Responses
200 The renamed key.
{ "id": "ssh_01hxa3b4c5d6e7f8g9h0j1k2m3", "name": "production-deploy-key", "publicKey": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIE9wZW5BUElFeGFtcGxlS2V5TWF0ZXJpYWwxMjM0 ops@example.com", "fingerprint": "SHA256:8pQ3ExampleFingerprintForDocsOnly", "keyType": "ed25519", "createdAt": "2026-04-27T12:34:56.000Z", "actions": { "canRename": { "allowed": true, "reason": null }, "canDelete": { "allowed": true, "reason": null } }}Response fields
idstringdisplayIdstringAn 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 ssh_key_not_found. |
| 429 | Too many requests. Wait the number of seconds in Retry-After before you try again. |
| 500 | Internal error. Retry later or contact support if the issue persists. |