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

# Delete an alerts index

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

## Paths

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

- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/kibana/v9/authentication#apikeyauth)
- [Basic auth](/elastic/docs-builder/docs/4371/api/doc/kibana/v9/authentication#basicauth)

## Description

Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.

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 /api/detection_engine/index
```

#### curl

```curl
curl -X DELETE "https://{kibana_url}/api/detection_engine/index"
```

## Response Examples

#### Acknowledged

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

#### Unauthorized

```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

```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

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

#### Server error

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

