WHM API.
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/
https://{host}:{port}/json-api/
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/delete_hook
- A server running WHM.
https://whm-server.tld:2087/json-api/delete_hook
- 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/delete_hook?id=HzEpGvT6QGUYwxuX3hWB8AUq'{ "metadata": { "command": "delete_hook", "reason": "OK", "result": 1, "version": 1 } }
The script hook's ID.
Note:
To retrieve a hook's ID, use the WHM API 1 list_hooks function.
The absolute file path to the script that runs after the hook script to check the results.
Whether the hook script is enabled.
1— Enabled.0— Disabled.
Whether to escalate privileges to run the hook script as root.
1— Escalate privileges.0— Do not escalate privileges.
Note:
- This parameter only applies to script hooks and not module hooks.
- Module hooks cannot escalate privileges.
The type of function that the script hook launches.
script— Runs a script.module— Calls a function in a module.
The hook script's absolute file path or its module::subroutine invocation.
The absolute file path to the script that rolls back the hook script.
The condition when the hook script executes.
pre— The script runs before the function.post— The script runs after the function.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/edit_hook
- A server running WHM.
https://whm-server.tld:2087/json-api/edit_hook
- 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/edit_hook?id=HzEpGvT6QGUYwxuX3hWB8AUq&check=%2Fscripts%2Fpostcourier-authlibup&enabled=1&escalateprivs=0&exectype=script&hook=%2Fscripts%2Fpostcourier-authlibup¬es=Note.&rollback=%2Fscripts%2Fpostcourier-authlibup&stage=post&weight=100'{ "metadata": { "command": "edit_hook", "reason": "OK", "result": 1, "version": 1 } }
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/list_hooks
- A server running WHM.
https://whm-server.tld:2087/json-api/list_hooks
- 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/list_hooks{ "data": { "categories": [ … ] }, "metadata": { "command": "list_hooks", "reason": "OK", "result": 1, "version": 1 } }