latestOpenAPI 3.0.2cPanel License2026-08-106251554.3 MB

3da41671c02c

SSH Keys and Connections

Delete SSH key

This function function deletes an SSH key from the server.

Warning:

Only the root account can use this function, and it only affects the root keys. To perform this function on a cPanel user account, call the cPanel API 2 SSH::authkey function through the WHM API.

get/deletesshkey

Query parameters

filestring required
Example:/root/.ssh/test

The SSH key file's name.

leave_authorized0 | 1

Whether to authorize the SSH key to access the server.

  • 1 — Leave authorized.
  • 0 — Do not leave authorized.

Response

HTTP Request was successful.

Example response

{
  "data": {
    "file": "/root/.ssh/test"
  },
  "metadata": {
    "command": "deletesshkey",
    "reason": "OK",
    "result": 1,
    "version": 1
  }
}