---
type: api
title: Delete a dangling index
description: If Elasticsearch encounters index data that is absent from the current cluster state, those indices are considered to be dangling.
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-dangling-indices-delete-dangling-index
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-dangling-indices-delete-dangling-index
products:
  - Elasticsearch
---

# Delete a dangling index

Availability: 7.9+

## Paths

- `DELETE` `/_dangling/{index_uuid}`

- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/authentication#apikeyauth)
- [Basic auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/authentication#basicauth)
- [Bearer auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/authentication#bearerauth)

#### Path Parameters

- `index_uuid` (string)
  The UUID of the index to delete. Use the get dangling indices API to find the UUID.

## Description

If Elasticsearch encounters index data that is absent from the current cluster state, those indices are considered to be dangling.
For example, this can happen if you delete more than `cluster.indices.tombstones.size` indices while an Elasticsearch node is offline.

## Required authorization

* Cluster privileges: `manage`

## Query String Parameters

- `accept_data_loss` (boolean · default: false)
  This parameter must be set to true to acknowledge that it will no longer be possible to recove data from the dangling index.
- `master_timeout` (string Duration · default: 30s)
  The period to wait for a connection to the master node.
- `timeout` (string Duration · default: 30s)
  The period to wait for a response.

## Response

`application/json`

- `acknowledged` (boolean)
  For a successful response, this value is always true. On failure, an exception is returned instead.
## Code Examples

#### Console

```console
DELETE /_dangling/<index-uuid>?accept_data_loss=true
```

#### JavaScript

```javascript
const response = await client.danglingIndices.deleteDanglingIndex({
  index_uuid: "<index-uuid>",
  accept_data_loss: "true",
});
```

#### Python

```python
resp = client.dangling_indices.delete_dangling_index(
    index_uuid="<index-uuid>",
    accept_data_loss=True,
)
```

#### curl

```curl
curl -X DELETE "$ELASTICSEARCH_URL/_dangling/<index-uuid>?accept_data_loss=true" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY"
```

#### Java

```java
client.danglingIndices().deleteDanglingIndex(d -> d
    .acceptDataLoss(true)
    .indexUuid("<index-uuid>")
);
```

#### C#

```c#
var response = await client.DanglingIndices
    .DeleteDanglingIndexAsync(indexUuid: "<index-uuid>", d1 => d1
        .AcceptDataLoss(true)
    );
```

#### PHP

```php
$resp = $client->danglingIndices()->deleteDanglingIndex([
    "index_uuid" => "<index-uuid>",
    "accept_data_loss" => "true",
]);
```

#### Ruby

```ruby
response = client.dangling_indices.delete_dangling_index(
  index_uuid: "<index-uuid>",
  accept_data_loss: "true"
)
```

