cPanel Mod Security API

The ModSecurity module for UAPI.

GitHub OpenAPI
Business capability
Cybersecurity Management BC-620

Operations 44

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

GET /ModSecurity/disable_all_domains Turn off ModSecurity for every domain · Disable ModSecurity for all domains #
Ask an LLM
“How do I disable ModSecurity across all of a cPanel account's domains at once?”
“Can I switch off the web application firewall for every site on an account in one call?”
Tell an agent
Disable ModSecurity for all domains on this account.
Turn off the web application firewall across every site.
GET /ModSecurity/disable_domains Turn off ModSecurity for selected domains · Disable ModSecurity for selected domains #
Ask an LLM
“How do I disable ModSecurity on just some of my domains?”
“Can I switch off the firewall for specific domains without affecting the others?”
Tell an agent
Disable ModSecurity for domains {domains}.
Turn off the web application firewall on {domains} only.
GET /ModSecurity/enable_all_domains Turn on ModSecurity for all domains · Enable ModSecurity for all domains #
Ask an LLM
“How do I re-enable ModSecurity on every domain at once?”
“Can I switch the web application firewall back on for all sites in one call?”
Tell an agent
Enable ModSecurity for all domains on this account.
Turn the web application firewall back on for every site.
GET /ModSecurity/enable_domains Turn on ModSecurity for selected domains · Enable ModSecurity for selected domains #
Ask an LLM
“How do I re-enable ModSecurity on just some of my domains?”
“Can I switch the firewall back on for specific domains only?”
Tell an agent
Enable ModSecurity for domains {domains}.
Turn the web application firewall back on for {domains} only.
GET /ModSecurity/has_modsecurity_installed Check whether ModSecurity is installed · Return ModSecurity installation status #
Ask an LLM
“Is ModSecurity installed on this server?”
“How do I confirm the web application firewall is available?”
Tell an agent
Check whether ModSecurity is installed.
Tell me if the web application firewall is available on this server.
GET /ModSecurity/list_domains List ModSecurity status for each domain · Return ModSecurity domains' status #
Ask an LLM
“What is the ModSecurity status of each of my domains?”
“Which of my sites have the web application firewall enabled?”
Tell an agent
List ModSecurity status for every domain.
Show which sites have the web application firewall on or off.
GET /modsec_add_rule Add a rule to a ModSecurity staging file · Add staged ModSecurity rule #
Ask an LLM
“How do I stage a new ModSecurity rule without deploying it?”
“Can I add a rule to a configuration file before deploying it?”
Tell an agent
Add rule {rule} to the {config} staging file.
Stage a new ModSecurity rule {rule} in {config}.
GET /modsec_add_vendor Add a vendor rule set to the server · Add ModSecurity vendor rules #
Ask an LLM
“How do I add a vendor rule set from a YAML metadata URL?”
“Can I enable a vendor rule set when I add it?”
Tell an agent
Add the vendor rule set from {url}.
Add vendor rules from {url} and set enabled to {enabled}.
GET /modsec_assemble_config_text Add text to a ModSecurity config file · Add ModSecurity configuration file text #
Ask an LLM
“How do I append text to a ModSecurity configuration file?”
“Can I add text to a config file without deploying it right away?”
Tell an agent
Add {text} to {config}.
Append {text} to {config} with final set to {final}.
GET /modsec_batch_settings Set several global ModSecurity settings at once · Run ModSecurity batch settings #
Ask an LLM
“How do I turn on several global ModSecurity settings in one request?”
“Can I change multiple ModSecurity configuration directives at once?”
Tell an agent
Set global ModSecurity setting {setting_id} to {state}.
Batch-update ModSecurity settings {setting_id} with state {state}.
GET /modsec_check_rule Validate a ModSecurity rule · Validate ModSecurity rule #
Ask an LLM
“How do I check that a ModSecurity rule is valid before adding it?”
“Can I test a rule's syntax before staging it?”
Tell an agent
Validate ModSecurity rule {rule}.
Check that {rule} is a valid ModSecurity rule.
GET /modsec_clone_rule Copy a ModSecurity rule with a new ID · Save ModSecurity rule copy #
Ask an LLM
“How do I duplicate an existing ModSecurity rule?”
“Can I save a copy of a rule with a new rule ID?”
Tell an agent
Clone rule {id} from {config}.
Copy the existing rule {id} in {config} as a new rule.
GET /modsec_deploy_all_rule_changes Deploy all staged ModSecurity rule changes · Enable all staged ModSecurity rule changes #
Ask an LLM
“How do I deploy every staged ModSecurity rule change at once?”
“Does deploying all rule changes restart Apache automatically?”
Tell an agent
Deploy all staged ModSecurity rule changes.
Apply every pending rule change and restart Apache.
GET /modsec_deploy_rule_changes Deploy staged changes to one ModSecurity config file · Enable staged ModSecurity rule changes #
Ask an LLM
“How do I deploy staged changes to a single ModSecurity configuration file?”
“Can I apply rule changes to one config file without touching the others?”
Tell an agent
Deploy staged changes to {config}.
Apply the pending rule changes in {config} and restart Apache.
GET /modsec_deploy_settings_changes Deploy staged changes to modsec2.cpanel.conf · Enable staged ModSecurity configuration files #
Ask an LLM
“How do I deploy the staged changes to the global ModSecurity settings file?”
“Can I push the staged modsec2.cpanel.conf changes to the live config?”
Tell an agent
Deploy the staged changes to modsec2.cpanel.conf.
Apply the pending global ModSecurity settings.
GET /modsec_disable_rule Disable a ModSecurity rule · Disable ModSecurity rule #
Ask an LLM
“How do I disable a specific rule in a ModSecurity config file?”
“Can I turn off one rule without touching the rest of the config?”
Tell an agent
Disable rule {id} in {config}.
Turn off the {id} rule in {config}.
GET /modsec_disable_vendor Disable a vendor rule set · Disable ModSecurity vendor rules #
Ask an LLM
“How do I disable a vendor's rule set without touching its config files?”
“Can I turn off a vendor rule set while keeping its config files enabled?”
Tell an agent
Disable vendor rule set {vendor_id}.
Turn off the {vendor_id} vendor rule set.
GET /modsec_disable_vendor_configs Disable a vendor's config files · Disable ModSecurity vendor configuration files #
Ask an LLM
“How do I disable all of a vendor's configuration files?”
“Can I turn off a vendor's config files without disabling the rule set?”
Tell an agent
Disable all configuration files for vendor {vendor_id}.
Turn off the {vendor_id} vendor config files.
GET /modsec_disable_vendor_updates Disable automatic updates for a vendor · Disable ModSecurity vendor updates #
Ask an LLM
“How do I stop a vendor's rule set from updating automatically?”
“Can I disable automatic updates for one vendor only?”
Tell an agent
Disable automatic updates for vendor {vendor_id}.
Turn off auto-updates for the {vendor_id} vendor.
GET /modsec_discard_all_rule_changes Discard all staged ModSecurity rule changes · Remove all staged ModSecurity rule changes #
Ask an LLM
“How do I throw away every staged ModSecurity rule change at once?”
“Can I clear all pending rule changes without deploying them?”
Tell an agent destructive · confirm first
Discard all staged ModSecurity rule changes.
Throw away every pending rule change.
GET /modsec_discard_rule_changes Discard staged ModSecurity rule changes · Remove staged ModSecurity rule changes #
Ask an LLM
“How do I throw away the changes I staged to a ModSecurity config file?”
“Can I remove the staged changes for one vendor's rules?”
Tell an agent destructive · confirm first
Discard staged changes for {config}.
Remove the {config}.STAGE file so changes to {config} are lost.
GET /modsec_edit_rule Stage edits to a ModSecurity rule · Update staged ModSecurity rule #
Ask an LLM
“How do I change a single rule in a ModSecurity config file without touching the live file?”
“Can I stage a new rule text for a rule ID?”
Tell an agent
Stage rule {rule} for rule {id} in {config}.
Edit the {config} rule {id} to {rule}.
GET /modsec_enable_vendor Enable a vendor's rule set · Enable ModSecurity vendor rules #
Ask an LLM
“How do I turn on a vendor's rule set for ModSecurity?”
“Can I enable a vendor's rule set without touching its config files?”
Tell an agent
Enable vendor {vendor_id}'s rule set.
Turn on the {vendor_id} rule set.
GET /modsec_enable_vendor_configs Enable a vendor's config files · Enable ModSecurity vendor configuration files #
Ask an LLM
“How do I enable all the configuration files a vendor ships?”
“Can I activate a vendor's config files so they are loaded?”
Tell an agent
Enable the {vendor_id} config files.
Load every configuration file from vendor {vendor_id}.
GET /modsec_enable_vendor_updates Enable a vendor's automatic updates · Enable ModSecurity vendor updates #
Ask an LLM
“How do I get automatic updates for a vendor's rules?”
“Can I turn on automatic updates for a vendor?”
Tell an agent
Enable automatic updates for vendor {vendor_id}.
Turn on vendor {vendor_id} rule updates.
GET /modsec_get_config_text Get a ModSecurity config file's contents · Return ModSecurity configuration file #
Ask an LLM
“What does a particular ModSecurity config file contain?”
“Can I read one vendor config file's text?”
Tell an agent
Show the contents of {config}.
Get the text of ModSecurity config {config}.
GET /modsec_get_configs List all ModSecurity config files · Return all ModSecurity configuration files #
Ask an LLM
“Which ModSecurity config files are on the server?”
“Where are the vendor config files stored?”
Tell an agent
List all ModSecurity configuration files.
Show every vendor config file in the modsec_vendor_configs directory.
GET /modsec_get_configs_with_changes_pending List config files with staged changes · Return staged ModSecurity configuration files #
Ask an LLM
“Which ModSecurity config files have changes waiting to be committed?”
“What config files have a .STAGE file?”
Tell an agent
List ModSecurity config files with staged changes.
Show the config files that have pending changes.
GET /modsec_get_log Get ModSecurity audit log entries · Return ModSecurity logs #
Ask an LLM
“What did ModSecurity block in the audit log?”
“Can I pull the ModSecurity log from the MySQL database?”
Tell an agent
Get the ModSecurity audit log.
Show the last 1000 ModSecurity log entries.
GET /modsec_get_rules Get rules from ModSecurity config files · Return ModSecurity rules #
Ask an LLM
“What rules are in a particular ModSecurity config file?”
“Can I list only the SecRule and SecAction directives from a config?”
Tell an agent
Get the rules from {config}.
List only SecRule and SecAction directives from {config}.
GET /modsec_get_settings Get the server's ModSecurity settings · Return ModSecurity configuration #
Ask an LLM
“What are the server-wide ModSecurity settings?”
“Where are the global ModSecurity configuration settings stored?”
Tell an agent
Show the server's ModSecurity settings.
Get the global ModSecurity configuration from modsec2.conf.
GET /modsec_get_vendors List configured ModSecurity vendors · Return ModSecurity vendors #
Ask an LLM
“Which ModSecurity vendors are configured on the server?”
“What vendors have their rules enabled?”
Tell an agent
List the configured ModSecurity vendors.
Show every vendor that ships ModSecurity rules.
GET /modsec_is_installed Check if the ModSecurity module is installed · Return ModSecurity module status #
Ask an LLM
“Is the ModSecurity module installed on this cPanel server right now?”
“Why would the ModSecurity installed check stop working after I disable the Web Server role?”
Tell an agent
Return the ModSecurity module installation status for this server.
Run the module status check to see if ModSecurity™ is installed.
GET /modsec_make_config_active Add a config file include to make it active · Add ModSecurity configuration file include #
Ask an LLM
“How do I make a ModSecurity config file active?”
“Can I add an include for a config file so it is loaded?”
Tell an agent
Add an include for {config} so it is active.
Make the {config} config file active by including it.
GET /modsec_make_config_inactive Remove a config file include to make it inactive · Remove ModSecurity configuration file include #
Ask an LLM
“How do I stop a ModSecurity config file from being loaded?”
“Can I remove an include for a config file?”
Tell an agent destructive · confirm first
Remove the include for {config} so it is inactive.
Make the {config} config file inactive.
GET /modsec_preview_vendor Preview a vendor's rule metadata · Return ModSecurity vendor rule metadata #
Ask an LLM
“What does a vendor's rule metadata file contain?”
“Can I preview a vendor's rule set before enabling it?”
Tell an agent
Preview the rule metadata at {url}.
Show the vendor rule metadata from {url}.
GET /modsec_remove_rule Remove a rule from a config file · Remove ModSecurity rule #
Ask an LLM
“How do I remove a single rule from a ModSecurity config file?”
“Can I delete a rule by its ID?”
Tell an agent destructive · confirm first
Remove rule {id} from {config}.
Delete the {config} rule {id}.
GET /modsec_remove_setting Remove a global ModSecurity setting · Remove ModSecurity configuration #
Ask an LLM
“How do I remove a global ModSecurity directive?”
“Can I delete a setting by its ID?”
Tell an agent destructive · confirm first
Remove global setting {setting_id}.
Delete the {setting_id} setting from modsec2.conf.
GET /modsec_remove_vendor Remove a ModSecurity vendor · Remove ModSecurity vendor #
Ask an LLM
“How do I remove a vendor and all its rules?”
“Does removing a vendor also remove its config files and metadata?”
Tell an agent destructive · confirm first
Remove vendor {vendor_id}.
Delete every rule, config and metadata file for {vendor_id}.
GET /modsec_report_rule Submit a rule error report to a vendor · Export ModSecurity rule error report #
Ask an LLM
“How do I report a false positive rule to its vendor?”
“Can I send a rule error report with a message and row IDs?”
Tell an agent
Report rows {row_ids} to {email} with message {message} as {type}.
Submit a {type} error report for rule {row_ids} to {email}: {message}.
GET /modsec_set_config_text Replace a ModSecurity config file · Update ModSecurity configuration file #
Ask an LLM
“How do I overwrite the contents of a ModSecurity config file?”
“Can I stage new config text for a ModSecurity file before deploying it?”
Tell an agent
Set the contents of ModSecurity config {config} to {text}.
Replace the {config} config file with {text}.
GET /modsec_set_setting Change a global ModSecurity setting · Update ModSecurity configuration #
Ask an LLM
“How do I turn a global ModSecurity setting on or off?”
“Can I change a ModSecurity directive's state through the API?”
Tell an agent
Set ModSecurity setting {setting_id} to {state}.
Change the global ModSecurity directive {setting_id} to {state}.
GET /modsec_undisable_rule Re-enable a disabled ModSecurity rule · Enable ModSecurity rule #
Ask an LLM
“How do I re-enable a rule I disabled in ModSecurity?”
“Can I turn a disabled rule back on for a config file?”
Tell an agent
Enable rule {id} in ModSecurity config {config}.
Re-enable disabled rule {id} for {config}.
GET /modsec_update_vendor Update a ModSecurity vendor ruleset · Update ModSecurity vendor ruleset #
Ask an LLM
“How do I pull the latest vendor ruleset for ModSecurity?”
“Can I refresh a vendor's rule set from a metadata URL?”
Tell an agent
Update the vendor ruleset from {url}.
Pull the newest vendor rule set using metadata at {url}.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/cpanel:cpanel-modsecurity-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

cpanel-modsecurity-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Cpanel Mod Security API
  version: 11.137.9999.106
  contact:
    email: cs@cpanel.net
    name: WebPros International, LLC
    url: https://cpanel.net/support/
  license:
    name: cPanel License
    url: https://cpanel.net/legal-notices/
  termsOfService: https://cpanel.net/legal-notices/
  x-api-evangelist-provenance: 'Harvested verbatim from cPanel''s developer portal on 2026-09-05 via the MCP tool get-full-api-description at https://api.docs.cpanel.net/mcp. ONE mechanical change was made before storage: example values containing PEM private-key or certificate blocks, and AWS-access-key-shaped example strings, were replaced with REDACTED_* placeholders so the file can be stored in a public git repository without tripping secret scanning. No path, operation, parameter, schema or description was altered, added or removed.'
  description: 'Operations tagged ModSecurity across 2 of this provider''s published API definitions: cpanel-uapi-openapi.yml, cpanel-whm-api-openapi.yml. Each path carries the servers of the definition it was published in.'
servers:
- description: A server running cPanel.
  url: https://{host}:{port}/execute
  variables:
    host:
      default: cpanel-server.tld
      description: The hostname of a server running cPanel.
    port:
      default: '2083'
      description: The cPanel port.
- description: A server running WHM.
  url: https://{host}:{port}/json-api
  variables:
    host:
      default: whm-server.tld
      description: The hostname of a server running WHM.
    port:
      default: '2087'
      description: The WHM port.
security:
- BasicAuth: []
tags:


# --- truncated at 32 KB (263 KB total) ---
# Full source: https://artifacts.apis.io/cpanel/openapi/cpanel-modsecurity-api-openapi.yml