Save an SSH key
POST /api/v2/ssh-keys
Saves an SSH public key on your Hostup account. You can then pick it when you order a VPS or add keys to a VPS with PATCH /api/v2/vps/{id}/ssh-access. Saving a key does not add it to any VPS that already exists.
Accepted key types are ssh-ed25519, ssh-rsa, ecdsa-sha2-nistp256, ecdsa-sha2-nistp384, ecdsa-sha2-nistp521, ssh-dss and the hardware-key types sk-ssh-ed25519@openssh.com and sk-ecdsa-sha2-nistp256@openssh.com. Any other key returns 400 invalid_public_key. A key that is already saved on the account returns 409 duplicate_fingerprint.
Web hosting accounts keep their own keys. Add those with POST /api/v2/shared-hosting/{accountId}/ssh-keys.
Authentication: An API key with the scope write:account. About keys and scopes
Request
Body
namestringrequiredpublicKeystringrequiredExample
curl -X POST "https://cloud.hostup.se/api/v2/ssh-keys" \ -H "Authorization: Bearer $HOSTUP_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "deploy-key", "publicKey": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIE9wZW5BUElFeGFtcGxlS2V5TWF0ZXJpYWwxMjM0 ops@example.com" }'curl -X POST "https://cloud.hostup.se/api/v2/ssh-keys" \ -H "Authorization: Bearer $HOSTUP_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "yubikey", "publicKey": "sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIE9wZW5BUElFeGFtcGxlU2tLZXlNYXRlcmlhbDEyMzQAAAAEc3NoOg== yubikey@laptop" }'Responses
201 The saved key.
{ "id": "ssh_01hxa3b4c5d6e7f8g9h0j1k2m3", "name": "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
idstringdisplayIdstringname and fingerprint instead.namestringpublicKeystringfingerprintstring or nullkeyTypestringrsa, ed25519, ecdsa, dsa, unknown.createdAtstring or nulllastUsedAtstring or nullactionsobjectcanRenameobjectallowedbooleanreasonstring or nullcodestring or nullcanDeleteobjectallowedbooleanreasonstring or nullcodestring or nullErrors
Errors are Problem Details with a stable code. Branch on the code, not on the text.
| 400 | code is invalid_public_key when the key cannot be read. It is invalid_request when name or publicKey is missing or too long. |
| 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. |
| 409 | code is duplicate_fingerprint. The same key is already saved on the account. |
| 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. |
| 502 | Upstream failure. A dependent provider request failed; the Problem Details code is upstream_failed. Retry later or contact support if the issue persists. |