Authorize a web hosting SSH key
POST /api/v2/shared-hosting/{accountId}/ssh-keys/{fingerprint}/actions/authorize
Let an SSH key that is on the web hosting account but not authorized log in over SSH and SFTP. Use it for a key imported without authorization, for example in cPanel. A key added with POST /api/v2/shared-hosting/{accountId}/ssh-keys is authorized already. A key that is already authorized returns 200 without a change. The account must be active and on cPanel.
Authentication: An API key with the scopes write:hosting and console:services. About keys and scopes
Request
Path parameters
accountIdstringrequiredThe web hosting account ID (
acct_…).fingerprintstringrequiredThe SSH key ID (
ssh_…).Example
curl -X POST "https://cloud.hostup.se/api/v2/shared-hosting/acct_01hxa3b4c5d6e7f8g9h0j1k2m3/ssh-keys/ssh_01hxa3b4c5d6e7f8g9h0j1k2m3/actions/authorize" \ -H "Authorization: Bearer $HOSTUP_API_KEY" \ -H "Content-Type: application/json"Responses
200 The key is authorized.
{ "name": "deploy-key", "fingerprint": "SHA256:mKqU+0K8OhKmA8bBQi9Rz0Q5l7/g160hIP+rJYSTNj4", "authorized": true}Response fields
namestringThe key’s name on the account.
fingerprintstringThe key’s fingerprint.
authorizedbooleanAlways true.
Errors
Errors are Problem Details with a stable code. Branch on the code, not on the text.
| 400 | {fingerprint} is not a valid SSH key ID (invalid_request). |
| 401 | Unauthorized. Authentication is required. |
| 403 | Forbidden. The caller lacks a required scope or does not own the resource. |
| 404 | No such key on this account (ssh_key_not_found). |
| 409 | The account is not on cPanel (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 key could not be looked up or authorized right now (upstream_failed). |