# DELETE /security/modsec/rules/{id}

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

UrbeStack release 0.2.35 API operation in the security group.

Delete a custom ModSecurity rule

- Who may call it: administrator
- Token scope, any of: security, all
- Answers: 200 OK

UrbeStack tests Apache's configuration after removing the rule from the configuration and before reloading Apache. If the test fails, UrbeStack discards the deletion and returns Apache's error. A malformed rule number returns 400.

## As a command

- [urbestack-modsec-rule-del](https://urbestack.com/docs/commands/urbestack-modsec-rule-del.md): Deletes a custom ModSecurity rule.

## Parameters

- `id` (path, integer, 1 to 89999, required): Number of the custom rule to delete.

## 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 DELETE "$API/security/modsec/rules/1" \
  -H "Authorization: Bearer $TOKEN"
```

Response, 200 OK:

```
{
  "apache": "text",
  "deleted": true,
  "files_changed": 1,
  "rule": 1
}
```

## Errors

- 400: A rule is named by its number
- 400: Say which rule: --rule NUMBER
- 401: Authentication required
