WHM API.
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/
https://{host}:{port}/json-api/
Request
This function installs an SSH key from the cPanel Customer Portal.
Note:
This function is not available through the command line. You must call it as a request body.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/ticket_grant
- A server running WHM.
https://whm-server.tld:2087/json-api/ticket_grant
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
'https://api.docs.cpanel.net/_mock/specifications/whm.openapi/ticket_grant?secure_id=rofh411bv8&server_num=1&ticket_id=999999999&ssh_username=username'{ "data": { "auth_status": "AUTHED", "auth_time": 1477338450, "chain_status": "ACTIVE", "csf_wl_status": "ACTIVE", "host_access_wl_status": "ACTIVE", "hulk_wl_status": "ACTIVE", "non_fatals": [], "server_name": "example", "server_num": 1, "ssh_username": "username", "ticket_id": 999999999, "ticket_status": "OPEN" }, "metadata": { "command": "ticket_grant", "reason": "OK", "result": 1, "version": 1 } }
Request
This function removes cPanel Support's SSH keys and removes closed support tickets. You can view closed support tickets in WHM's Grant cPanel Support Access interface (WHM >> Home >> Support >> Grant cPanel Support Access).
Note:
This function is not available through the command line. You must call it as a request body.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/ticket_remove_closed
- A server running WHM.
https://whm-server.tld:2087/json-api/ticket_remove_closed
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/ticket_remove_closed{ "data": { "chain_status": "ACTIVE", "csf_wl_status": "ACTIVE", "host_access_wl_status": "INACTIVE", "hulk_wl_status": "ACTIVE", "non_fatals": [], "revoked_keys": 9 }, "metadata": { "command": "ticket_remove_closed", "reason": "OK", "result": 1, "version": 1 } }
Request
This function removes a cPanel Customer Portal SSH key from the server.
Note:
This function is not available through the command line. You must call it as a request body.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/ticket_revoke
- A server running WHM.
https://whm-server.tld:2087/json-api/ticket_revoke
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
'https://api.docs.cpanel.net/_mock/specifications/whm.openapi/ticket_revoke?server_num=1&ssh_username=username&ticket_id=999999999'{ "data": { "chain_status": "ACTIVE", "csf_wl_status": "ACTIVE", "host_access_wl_status": "ACTIVE", "hulk_wl_status": "ACTIVE", "non_fatals": [], "revoked_keys": 1, "server_num": 2, "ssh_username": "username", "ticket_id": 999999999 }, "metadata": { "command": "ticket_revoke", "reason": "OK", "result": 1, "version": 1 } }