Remove Exception Rules

Deletes multiple exception rules from the specified detection scenario in bulk. To clean up all expired exception rules at once, use the Remove Expired Exception Rules API.

Required Permissions

Requires the ADMIN role or higher.

HTTP Request

DELETE /api/sonar/exception-rules
cURL Example
curl -H "Authorization: Bearer <API_KEY>" \
     -d type="stream" \
     -d scenario_guid="a1b2c3d4-e5f6-7890-abcd-ef1234567890" \
     -d guids="b2c3d4e5-f6a7-8901-bcde-f12345678901" \
     -X DELETE \
     https://HOSTNAME/api/sonar/exception-rules
Request Parameters
KeyRequiredTypeDescriptionNote
typeYesStringScenario typeOne of stream or batch. Case-insensitive
scenario_guidYesStringScenario GUID36-character GUID
guidsYesList of stringsList of exception rule GUIDsComma (,) separated GUID list

Success Response

{
  "failures": []
}
  • failures (Array of objects): List of exception rules that failed to be deleted. An empty array if all rules were deleted
    • id (String): GUID of the exception rule that failed to be deleted
    • reason (String): Failure reason. scenario-not-found if the scenario itself does not exist (in which case every GUID in guids is included in the failure list), or exception-rule-not-found if the exception rule cannot be found in that scenario
Some exception rules failed to be deleted

HTTP status code 200

{
  "failures": [
    {
      "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "reason": "exception-rule-not-found"
    }
  ]
}

Error Responses

Required parameter is missing

HTTP status code 400

{
  "error_code": "null-argument",
  "error_msg": "guids should be not null"
}
scenario_guid or guids is not in valid GUID format

HTTP status code 400

{
  "error_code": "invalid-param-type",
  "error_msg": "guids should be guid type."
}
type value is not stream or batch

HTTP status code 400

{
  "error_code": "invalid-argument",
  "error_msg": "No enum constant com.logpresso.sonar.api.exceptionrule.ExceptionRuleType.FOO"
}
No permission

HTTP status code 500

{
  "error_code": "illegal-state",
  "error_msg": "no-permission"
}