Skip to content

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

accountIdstringrequired
The web hosting account ID (acct_…).

Example

GET /api/v2/shared-hosting/{accountId}/ssh-keys
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.

Response 200
{
"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 object
The keys on the account.
idstring
The SSH key ID (ssh_…).
namestring
The key’s name on the account.
fingerprintstring
SHA-256 fingerprint of the public key.
typestring
Key type, such as ssh-ed25519 or ssh-rsa.
bitsnumber or null
Key length in bits.
commentstring or null
The comment at the end of the public key.
publicKeystring
The full public key.
authorizedboolean
True when the key can log in over SSH and SFTP.
sshCommandstring or null
The command to log in over SSH. Null on an account that is not on cPanel.
actionsobject
What you can do now.
canAddobject
Whether a key can be added.
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.
409Conflict. code is account_suspended, account_not_eligible_cpanel.
429Rate limited. Retry after the limit resets. 429 responses include Retry-After seconds plus X-RateLimit-* headers.
500Internal error. Retry later or contact support if the issue persists.
502The keys could not be read right now (upstream_failed).