Get your free beta license ↗
API operation · security group
DELETE

/security/modsec/rules/{id}

First published 19 Nov 20260.2.30Unchanged since publication

Delete a custom ModSecurity rule

Who may call it
AdministratorResellerCustomer
Token scope, any of
securityall
Answers200 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

Run as root on the server

Parameters

idpath ·integer, 1 to 89999Required
Number of the custom rule to delete.

Example

See the API overview for how to set $API and $TOKEN.
Request
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

3 errors, each a status and a sentence
400A rule is named by its number
400Say which rule: --rule NUMBER
401Authentication required
Generated from release 0.2.35 (current) · the API’s own descriptionThis entry has been unchanged since it was first published in release 0.2.30 on 19 Nov 2026.
urbestack.com/docs/api/delete-security-modsec-rules-id/