Replace the saved SSH keys on a VPS
POST /api/v2/vps/{id}/actions/reset-ssh-keys
Replace the saved SSH keys on a VPS with the keys you list. This endpoint is deprecated. Use GET /api/v2/vps/{id}/ssh-access and PATCH on the same path to list and change each access entry.
Only the lines that came from the previous saved selection are changed in the server’s authorized keys file. Every other key and its options stay as they are. When the file cannot be read, for example because the VPS is stopped, the call returns 409 and nothing changes. Start the VPS and try again. When the file changes while the call runs, it also returns 409 and nothing is overwritten. The call is refused with 403 when the VPS has reached its bandwidth limit.
Authentication: An API key with the scope write:vm. About keys and scopes
Request
Path parameters
idstringrequiredvps_…).Body
sshKeyIdsarray of stringrequiredssh_…) from GET /api/v2/vps/{id}/ssh-keys. Send [] to remove the saved keys only.Example
curl -X POST "https://cloud.hostup.se/api/v2/vps/vps_01hxa3b4c5d6e7f8g9h0j1k2m3/actions/reset-ssh-keys" \ -H "Authorization: Bearer $HOSTUP_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "sshKeyIds": [ "ssh_01hxa3b4c5d6e7f8g9h0j1k2m3" ] }'curl -X POST "https://cloud.hostup.se/api/v2/vps/vps_01hxa3b4c5d6e7f8g9h0j1k2m3/actions/reset-ssh-keys" \ -H "Authorization: Bearer $HOSTUP_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "sshKeyIds": [] }'Responses
200 The saved keys are replaced on the running server.
{ "accepted": true, "keyCount": 1, "effect": "immediate", "managementScope": "saved_key_selection", "unmanagedKeysPreserved": true}Response fields
acceptedbooleankeyCountintegereffectstringimmediate: the keys were written to the running VPS and checked. next_boot: they take effect at the next boot. One of immediate, next_boot.managementScopestringsaved_key_selection.unmanagedKeysPreservedbooleanauthorized_keys, with or without options, are still there. False when the change waits for the next boot and this is not checked yet.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; code is vps_not_found. |
| 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. |