Update script hook

This function edits a script hook.

SecurityBasicAuth
Request
query Parameters
id
required
string

The script hook's ID.

Note:

To retrieve a hook's ID, use the WHM API 1 list_hooks function.

Example: id=HzEpGvT6QGUYwxuX3hWB8AUq
check
string

The absolute file path to the script that runs after the hook script to check the results.

Example: check=/scripts/postcourier-authlibup
description
string

The hook script's description.

Example: description=TestHook
enabled
integer

Whether the hook script is enabled.

  • 1 — Enabled.
  • 0 — Disabled.
Enum: 0 1
Example: enabled=1
exectype
string

The type of function that the script hook launches.

  • script — Runs a script.
  • module — Calls a function in a module.
Enum: "script" "module"
Example: exectype=script
hook
string

The hook script's absolute file path or its module::subroutine invocation.

Example: hook=/scripts/postcourier-authlibup
notes
string

The script hook's notes.

Example: notes=Note.
rollback
string

The absolute file path to the script that rolls back the hook script.

Example: rollback=/scripts/postcourier-authlibup
stage
string

The condition when the hook script executes.

  • pre — The script runs before the function.
  • post — The script runs after the function.
Enum: "pre" "post"
Example: stage=post
weight
integer >= 1

The script hook's priority in the hook's stage, where a lower value runs before a higher value.

Example: weight=100
Responses
200

HTTP Request was successful.

Response Schema: application/json
object
get/edit_hook
Request samples
whmapi1 --output=jsonpretty \
  edit_hook \
  id='HzEpGvT6QGUYwxuX3hWB8AUq'
Response samples
application/json
{
  • "metadata": {
    • "command": "edit_hook",
    • "reason": "OK",
    • "result": 1,
    • "version": 1
    }
}