Update script hook
This function edits a script hook.
Request
- Base URLhttps://whm-server.tld:2087/json-api
- AuthHTTP basic
Query parameters
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 script hook's notes.
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.
The script hook's priority in the hook's stage, where a lower value runs before a higher value.
Response
HTTP Request was successful.
Example response
{
"metadata": {
"command": "edit_hook",
"reason": "OK",
"result": 1,
"version": 1
}
}Changes
No recorded changes to this operation across all 5 revisions of this API.