---
title: "Return script hooks list"
method: GET
path: "/list_hooks"
tags: ["Script Hooks", "Scripts Hooks"]
---

# Return script hooks list

`GET /list_hooks`

This function lists the server's script hooks.

## Response `200`

HTTP Request was successful.

- object
  - `data` object
    - `categories` object[] — An array of objects containing hook categories.
      - `category` string — The script hook's category.
      - `events` object[] — An array of objects containing events.
        - `event` string — The event that triggers the script hook.
        - `stage_order` string[] — When the hook script will execute. It is possible for a hook script to have both values. * `pre` — The script runs before the function. * `post` — The script runs after the function.
        - `stages` object[] — An array of objects containing stage information.
          - `actions` object[] — An array of objects containing information about hook script actions.
            - `blocking` 1 | 0 — Whether the script hook has a blocking contest. * `1` — Blocking contest. * `0` — No blocking contest.
            - `category` string — The script hook's category.
            - `check` string, nullable — The absolute file path to the script that runs after the hook script to check the results.
            - `description` string, nullable — The hook script's description.
            - `enabled` 0 | 1 — Whether the hook script is enabled. * `1` — Enabled. * `0` — Disabled.
            - `escalateprivs` 0 | 1 — Whether the hook script will run with escalated root privileges. * `1` — Runs with escalated privileges. * `0` — Does not run with escalated privileges.
            - `event` string — The event that triggers the script hook.
            - `exectype` 'script' | 'module' — The type of function that the script hook launches. * `script` — A script function. * `module` — A Perl module function.
            - `hook` string — The absolute file path to the hook script.
            - `id` string — The script hook's ID.
            - `rollback` string, nullable — The absolute file path to the script that can roll back the hook script.
            - `stage` string — When the hook script will execute. * `pre` — The script runs before the function. * `post` — The script runs after the function.
            - `weight` integer — The priority of the script hook, where lower values run before higher values.
          - `attributes` object — A list of hook script attributes.
            - `blocking` 1 | 0 — Whether the script hook contains a blocking context. * `1` — Blocking context. * `0` — No blocking context.
            - `escalateprivs` 1 | 0 — Whether the hook script will run with escalated root privileges. * `1` — Runs with escalated privileges. * `0` — Does not run with escalated privileges.
          - `description` string — The hook script's description.
          - `stage` string — When the hook script will execute. * `pre` — The script runs before the function. * `post` — The script runs after the function.
  - `metadata` object
    - `command` string — The method name called.
    - `reason` string — The reason the API function failed when the `metadata.result` field is `0`. This field may display a success message when a function succeeds.
    - `result` 1 | 0 — * `1` - Success. * `0` - Failed. Check the `reason` field for more details.
    - `version` integer — The version of the API function.

---

[API](https://skmtc.net/cpanel/apis/whm-api.md) · [All operations](https://skmtc.net/cpanel/apis/whm-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/cpanel/whm-api/revisions/3da41671c02c/schema)
