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

# Delete an alerts index

Authentication: required

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

## Paths

- `DELETE` `/api/detection_engine/index`
- `DELETE` `/s/{space_id}/api/detection_engine/index`

#### 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.

## Description

Permanently deletes the Elastic Security alerts backing index in the current space, including the alerts
stored in it. Use with caution; prefer lifecycle policies or the UI when available.
Call `GET /api/detection_engine/index` first to confirm the index that will be removed.

## Responses

#### `200`

Successful response

`application/json`

- `acknowledged` (boolean)
#### `401`

Unsuccessful authentication response

`application/json`

- `error` (string)
- `message` (string)
- `statusCode` (integer)
#### `403`

Not enough permissions response

`application/json`

- `message` (string)
- `status_code` (integer)
#### `404`

Index does not exist response

`application/json`

- `message` (string)
- `status_code` (integer)
#### `500`

Internal server error response

`application/json`

- `message` (string)
- `status_code` (integer)
## Code examples

#### Console

```console
DELETE kbn:/api/detection_engine/index
```

#### curl

```curl
curl -X DELETE "${KIBANA_URL}/api/detection_engine/index" \
  -H "Authorization: ApiKey ${API_KEY}"
```

## Response examples

#### Acknowledged

`application/json`

```json
{
  "acknowledged": true
}
```

#### Unauthorized

`application/json`

```json
{
  "error": "Unauthorized",
  "message": "[security_exception\n\tRoot causes:\n\t\tsecurity_exception: unable to authenticate user [elastic] for REST request [/_security/_authenticate]]: unable to authenticate user [elastic] for REST request [/_security/_authenticate]",
  "statusCode": 401
}
```

#### Forbidden

`application/json`

```json
{
  "message": "API [DELETE /api/detection_engine/index] is unauthorized for the current user. The user needs alerts management permissions for the space.",
  "status_code": 403
}
```

#### Not found

`application/json`

```json
{
  "message": "The Elastic Security alerts index to delete was not found.",
  "status_code": 404
}
```

#### Server error

`application/json`

```json
{
  "message": "Internal Server Error",
  "status_code": 500
}
```

