# POST /security/modsec/disabled-rules

First published 19 Nov 2026 (release 0.2.30) · Unchanged since publication

UrbeStack release 0.2.35 API operation in the security group.

Disable ModSecurity detection rules server-wide

- Who may call it: administrator
- Token scope, any of: security, all
- Answers: 201 Created

Supply rules or rule. If both are present, the API uses rules. A missing or empty list, more than 200 numbers, or a rule number in an invalid format returns 400. Rules that total scores or block requests based on them, size limits, and custom rules are ineligible.

When UrbeStack manages ModSecurity, it tests Apache's updated configuration before reloading Apache. If Apache rejects the configuration, UrbeStack restores the previous configuration and discards the change. The response lists the rules disabled server-wide.

## As a command

- [urbestack-modsec-disabled-rule-add](https://urbestack.com/docs/commands/urbestack-modsec-disabled-rule-add.md): Turns off ModSecurity detection rules for one domain or for the whole server.

## Request body

JSON.

- `rule` (integer): Single detection rule number of up to 8 digits, supplied in place of rules.
- `rules` (array of integer): Array of 1 to 200 detection rule numbers, each up to 8 digits. Detection rules recognize attacks and add to a request's score.

## Example

Set $API to the base URL and $TOKEN to the token, as the [API overview](https://urbestack.com/docs/api.md) shows.

```
curl -sS -X POST "$API/security/modsec/disabled-rules" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "rule": 1,
    "rules": [
      1
    ]
  }'
```

Response, 201 Created:

```
{
  "apache": "text",
  "changed": 1,
  "counts": {
    "by_administrators": 1,
    "by_owners": 1,
    "domains": 1,
    "gone": 1,
    "server": 1,
    "total": 1
  },
  "files_changed": 1,
  "groups": [
    {
      "by_administrators": 1,
      "by_owners": 1,
      "domains": 1,
      "gone": true,
      "group": "text",
      "message": "text",
      "rule": 1,
      "score": 1,
      "server": true,
      "severity": "text"
    }
  ],
  "limit": 1,
  "max_per_domain": 1,
  "offset": 1,
  "rules": [
    {
      "at": "text",
      "by": "owner",
      "by_name": "text",
      "domain": "example.com",
      "gone": true,
      "group": "text",
      "id": 1,
      "message": "text",
      "owner": "text",
      "paranoia_level": 1,
      "rule": 1,
      "score": 1,
      "severity": "critical"
    }
  ],
  "total": 1
}
```

## Errors

- 400: --as is owner or administrator
- 400: --rules takes rule numbers separated by commas
- 400: A rule is named by its number
- 400: Domain name required
- 400: Domain name too long
- 400: Invalid domain name
- 400: Rule <id> is not one of the rule set's detection rules, the ones that recognize an attack and add to a request's score; only those can be turned off here
- 400: Say which rules: one number or several
- 400: Up to 200 rules at a time
- 400: rules is a list of rule numbers, up to 200
- 401: Authentication required
- 403: A rule is turned off for every domain by an administrator
- 404: Domain '<domain>' not found
