---
title: "Run ModSecurity batch settings"
method: GET
path: "/modsec_batch_settings"
tags: ["ModSecurity", "Server Settings"]
---

# Run ModSecurity batch settings

`GET /modsec_batch_settings`

This function adds, updates, and removes global ModSecurity™ configuration directives.
The function modifies these directives in the `/usr/local/apache/conf/modsec2.cpanel.conf`
file.

**Important:**

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

This function **only** supports the following ModSecurity™ configuration directives:

<table>
  <tr><th>setting_id</th><th>Documentation</th></tr>
  <tr><td>0</td><td><a href="https://github.com/SpiderLabs/ModSecurity/wiki/Reference-Manual-%28v2.x%29#secauditengine">SecAuditEngine</a></td></tr>
  <tr><td>1</td><td><a href="https://github.com/SpiderLabs/ModSecurity/wiki/Reference-Manual-%28v2.x%29#secconnengine">SecConnEngine</a></td></tr>
  <tr><td>2</td><td><a href="https://github.com/SpiderLabs/ModSecurity/wiki/Reference-Manual-%28v2.x%29#secruleengine">SecRuleEngine</a></td></tr>
  <tr><td>3</td><td><a href="https://github.com/SpiderLabs/ModSecurity/wiki/Reference-Manual-%28v2.x%29#secdisablebackendcompression">SecDisableBackendCompression</a></td></tr>
  <tr><td>4</td><td><a href="https://github.com/SpiderLabs/ModSecurity/wiki/Reference-Manual-%28v2.x%29#secgeolookupdb">SecGeoLookupDb</a></td></tr>
  <tr><td>5</td><td><a href="https://github.com/SpiderLabs/ModSecurity/wiki/Reference-Manual-%28v2.x%29#secgsblookupdb">SecGsbLookupDb</a></td></tr>
  <tr><td>6</td><td><a href="https://github.com/SpiderLabs/ModSecurity/wiki/Reference-Manual-%28v2.x%29#secguardianlog">SecGuardianLog</a></td></tr>
  <tr><td>7</td><td><a href="https://github.com/SpiderLabs/ModSecurity/wiki/Reference-Manual-%28v2.x%29#sechttpblkey">SecHttpBlKey</a></td></tr>
  <tr><td>8</td><td><a href="https://github.com/SpiderLabs/ModSecurity/wiki/Reference-Manual-%28v2.x%29#secpcrematchlimit">SecPcreMatchLimit</a></td></tr>
  <tr><td>9</td><td><a href="https://github.com/SpiderLabs/ModSecurity/wiki/Reference-Manual-%28v2.x%29#secpcrematchlimitrecursion">SecPcreMatchLimitRecursion</a></td></tr>
</table>

## Query parameters

- `setting_id` integer, required
- `state` union, required
  - 'On' | 'Off'
  - 'On' | 'Off' | 'DetectionOnly'
  - 'On' | 'Off' | 'RelevantOnly'
  - string
  - integer
- `remove` 1 | 0

## Response `200`

HTTP Request was successful.

- object
  - `data` object
    - `updated_settings` object[] — An array of objects that contains the configuration setting's information.
      - `default` integer — The setting's default value. **Note:** The `modsec2.cpanel.conf` file defines this value.
      - `description` string — The setting's description.
      - `directive` string — The setting's Apache configuration directive.
      - `engine` 1 | 0 — Whether the setting is an engine directive. * `1` — Engine directive. * `0` — Normal directive.
      - `name` string — The setting's name.
      - `radio_options` object[] — An array of objects that contain the setting's options display information.
        - `name` string — The option's display name.
        - `option` string — The option.
      - `setting_id` integer — The setting ID.
      - `state` string — The setting's current state, as set by the `state` parameter's input value.
      - `type` string — 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 — The URL of the setting's entry in the ModSecurity reference manual.
  - `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)
