---
title: "Return ModSecurity configuration"
method: GET
path: "/modsec_get_settings"
tags: ["ModSecurity", "Server Settings"]
---

# Return ModSecurity configuration

`GET /modsec_get_settings`

This function retrieves the server's ModSecurity™ configuration settings. The system
stores these settings in the `/usr/local/apache/conf/modsec2.conf` file.

**Important:**

When you disable the [Web Server role](https://go.cpanel.net/serverroles#roles),
the system **disables** this function.

## Response `200`

HTTP Request was successful.

- object
  - `data` object
    - `settings` object[] — An array of objects containing ModSecurity global configuration settings.
      - `default` union — The setting's default value.
        - string
        - integer
      - `description` string — The setting's description. The user's [locale](https://go.cpanel.net/locale) may translate this value.
      - `directive` string — The setting's Apache® configuration directive.
      - `engine` 1 — Whether the setting is an engine directive. If the setting is a normal directive, the function does **not** return this value. * `1` — Engine directive.
      - `missing` 1 — Whether the setting is missing. * `1` — The value is missing.
      - `name` string — The setting's name.
      - `radio_options` object[] — An array of objects containing the options that the client should display, as radio buttons, for this setting in a user interface. **Note:** The function **only** returns this value when the `type` parameter is the `radio` values.
        - `name` string — The setting name to display to the user. The user's [locale](https://go.cpanel.net/locale) may translate this value.
        - `option` string — The setting that the system used to select the setting's state. **Note:** This value is identical to the string that the client sends in as the `state` value when users select the specified setting. In most cases, you should **not** display this value to the user. Instead, display the `name` value.
      - `setting_id` integer — The setting ID.
      - `state` string — The setting's current state, if available.
      - `type` 'text' | 'radio' | 'number' — The form element that the WHM interface uses to display this setting. * `text` — WHM users modify this setting via a text box. * `radio` — WHM users modify this setting via a radio button. * `number` — WHM users modify this setting via a text box that only allows numeric values.
      - `url` string, url — The URL of the setting's entry in the ModSecurity reference manual.
      - `validation` union[] — A list of validators to apply when updating the state. Use these validators to perform frontend validation through your preferred implementation methods. **Note:** The function may represent each validator as either a string or an object. * When the function represents the validator as a string, no arguments exist for the validator. * When the function returns the validator as a object, the API may also include an argument for the validator.
        - union
          - object — An object that contains the validation rule and arguments.
            - `arg` string — The regular expression pattern that is used with the validator identified in the `name` property.
            - `name` 'startsWith' | 'endsWith' — One of the following validators: * `startsWith` - Check if the updated `state` starts with the pattern passed in `arg`.
          - 'path' | 'honeypotAccessKey' | 'positiveInteger' — One of the following validators: * `path` — An instruction to verify whether the user's input is a valid path. * `honeypotAccessKey` — An instruction to verify whether the user's input fits the constraints of an `Http:BL` API access key. * `positiveInteger` — An instruction to verify whether the user's input is a positive integer.
  - `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)
