---
type: api
title: Delete an alert
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4641/api/doc/kibana/v8/operation/operation-legarydeletealert
resource: https://www.elastic.co/elastic/docs-builder/docs/4641/api/doc/kibana/v8/operation/operation-legarydeletealert
products:
  - Kibana
---

# Delete an alert

deprecated

Authentication: required

- Server: `https://{kibana_url}`

## Paths

- `DELETE` `/api/alerts/alert/{alertId}`
- `DELETE` `/s/{space_id}/api/alerts/alert/{alertId}`

#### Path parameters

- `space_id` (string) — optional
  An identifier for the space. If `space_id` is not provided in the URL, the default space is used. Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.
- `alertId` (string) — required
  The identifier for the alert.
  Example: `41893910-6bca-11eb-9e0d-85d233e3ee35`

## Description

Deprecated in 7.13.0. Use the delete rule API instead. WARNING: After you delete an alert, you cannot recover it.

## Header parameters

- `kbn-xsrf` (string) — required
  Cross-site request forgery protection

## Responses

#### `204`

Indicates a successful call.

#### `401`

Authorization information is missing or invalid.

`application/json`

- `error` (enum)
  Values: `Unauthorized`
- `message` (string)
- `statusCode` (enum)
  Values: `401`
## Code examples

#### Console

```console
DELETE kbn:/api/alerts/alert/41893910-6bca-11eb-9e0d-85d233e3ee35
```

#### curl

```curl
curl -X DELETE "${KIBANA_URL}/api/alerts/alert/41893910-6bca-11eb-9e0d-85d233e3ee35" \
  -H "kbn-xsrf: true" \
  -H "Authorization: ApiKey ${API_KEY}"
```

## Response examples

#### 401

`application/json`

Generated from the API spec. Values are representative. Unions use the first variant; deeply nested or large bodies may omit fields.

```json
{
  "error": "Unauthorized",
  "message": "string",
  "statusCode": 401
}
```

