List web hosting SSH keys
GET /api/v2/shared-hosting/{accountId}/ssh-keys
List the SSH keys on a web hosting account, with the command to log in. authorized: true means the key can log in over SSH and SFTP now. An imported key that is not authorized cannot. Authorize it with POST /api/v2/shared-hosting/{accountId}/ssh-keys/{fingerprint}/actions/authorize. These keys are separate from the SSH keys you use for VPS. On an account that is not on cPanel the list is empty and actions.canAdd is closed.
Authentication: An API key with the scopes read:hosting and console:services. About keys and scopes
Request
Path parameters
accountIdstringrequiredThe web hosting account ID (
acct_…).Example
curl "https://cloud.hostup.se/api/v2/shared-hosting/acct_01hxa3b4c5d6e7f8g9h0j1k2m3/ssh-keys" \ -H "Authorization: Bearer $HOSTUP_API_KEY"Responses
200 The account’s SSH keys.
{ "sshKeys": [ { "id": "ssh_01hxa3b4c5d6e7f8g9h0j1k2m3", "name": "deploy-key", "fingerprint": "SHA256:mKqU+0K8OhKmA8bBQi9Rz0Q5l7/g160hIP+rJYSTNj4", "type": "ssh-ed25519", "bits": 256, "comment": "alex@example.com", "publicKey": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8g alex@example.com", "authorized": true } ], "sshCommand": "ssh exampleuser@server.example.net", "actions": { "canAdd": { "allowed": true, "reason": null } }}Response fields
sshKeysarray of objectThe keys on the account.
idstringThe SSH key ID (
ssh_…).namestringThe key’s name on the account.
fingerprintstringSHA-256 fingerprint of the public key.
typestringKey type, such as
ssh-ed25519 or ssh-rsa.bitsnumber or nullKey length in bits.
commentstring or nullThe comment at the end of the public key.
publicKeystringThe full public key.
authorizedbooleanTrue when the key can log in over SSH and SFTP.
sshCommandstring or nullThe command to log in over SSH. Null on an account that is not on cPanel.
actionsobjectWhat you can do now.
canAddobjectWhether a key can be added.
allowedbooleanreasonstring 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. |
| 409 | Conflict. code is account_suspended, account_not_eligible_cpanel. |
| 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. |
| 502 | The keys could not be read right now (upstream_failed). |