Skip to content

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

idstringrequired
The saved SSH key ID (ssh_…).

Body

namestringrequired
The new name, up to 100 characters.

Example

PATCH /api/v2/ssh-keys/{id}
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.

Response 200
{
"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
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 ssh_key_not_found.
429Too many requests. Wait the number of seconds in Retry-After before you try again.
500Internal error. Retry later or contact support if the issue persists.