# POST /domains/{name}/modsec/disabled-rules

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

UrbeStack release 0.2.35 API operation in the domains group.

Disable ModSecurity detection rules for a domain

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

Supply rules for multiple rule numbers or rule for a single number. If both fields are present, rules takes precedence. The API returns 400 if neither field is present, if rules is supplied in a form other than an array of 1 to 200 entries, or if a selected rule number is invalid.

The domain's owner and the reseller who manages the owner can disable up to 20 rules for the domain. Only rules disabled on the owner's behalf count toward that limit. Administrators have no per-domain limit. Only an administrator can re-enable a rule disabled by an administrator, even if the owner had already disabled it.

When UrbeStack manages ModSecurity, it updates its Apache configuration, tests it, and reloads Apache. If Apache rejects the configuration, UrbeStack restores the previous configuration and discards the changes. The response returns the updated list of disabled rules for the domain.

## 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.

## Parameters

- `name` (path, DomainName, required)

## Request body

JSON.

- `rule` (integer): Single detection rule number of 1 to 8 digits, supplied in place of rules.
- `rules` (array of integer): Array of 1 to 200 detection rule numbers, each 1 to 8 digits. Select rules from the ModSecurity rule set that detect attacks and add to a request's score, excluding rules that total scores, block requests based on scores, or enforce size limits, as well as custom rules.

## 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/domains/example.com/modsec/disabled-rules" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "rule": 1,
    "rules": [
      1
    ]
  }'
```

Response, 201 Created:

```
{
  "apache": "text",
  "by_owner": 1,
  "changed": 1,
  "domain": "example.com",
  "files_changed": 1,
  "left": 1,
  "max": 1,
  "owner": "text",
  "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
