Delete a rule

DELETE /api/alerting/rule/{ruleId}

To delete a rule, you must have all privileges for the appropriate Kibana features, depending on the consumer and rule_type_id of the rule you're deleting. For example, the Management > Stack Rules feature, Analytics > Discover or Machine Learning features, Observability, or Security features. WARNING: After you delete a rule, you cannot recover it. If the API key that is used by the rule was created automatically, it is deleted.

Headers

  • kbn-xsrf string Required

    Cross-site request forgery protection

Path parameters

  • ruleId string Required

    An identifier for the rule.

Responses

  • Indicates a successful call.

  • 401 application/json; Elastic-Api-Version=2023-10-31

    Authorization information is missing or invalid.

    Hide response attributes Show response attributes object
  • 404 application/json; Elastic-Api-Version=2023-10-31

    Object is not found.

    Hide response attributes Show response attributes object
DELETE /api/alerting/rule/{ruleId}
curl \
 -X DELETE https://localhost:5601/api/alerting/rule/ac4e6b90-6be7-11eb-ba0d-9b1c1f912d74 \
 -H "kbn-xsrf: string"
Response examples (401)
{
  "error": "Unauthorized",
  "message": "string",
  "statusCode": 401
}
Response examples (404)
{
  "error": "Not Found",
  "message": "Saved object [alert/caaad6d0-920c-11ed-b36a-874bd1548a00] not found",
  "statusCode": 404
}