---
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/4493/api/doc/elasticsearch/operation/operation-dangling-indices-delete-dangling-index
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/elasticsearch/operation/operation-dangling-indices-delete-dangling-index
products:
  - Elasticsearch
---

# Delete a dangling index

Availability: Generally available since 7.9

## Paths

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

#### Path parameters

- `index_uuid` (string) — required
  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`

## Authentication

- Api key: `Authorization: <value>`
  Elasticsearch APIs support key-based authentication.
  You must create an API key and use the encoded value in the request header.
  For example:
  
  
  ```
  curl -X GET "${ES_URL}/_cat/indices?v=true" \
    -H "Authorization: ApiKey ${API_KEY}"
  ```
  
  To get API keys, use the `/_security/api_key` APIs.
- Basic: `Authorization: Basic <credentials>`
- Bearer: `Authorization: Bearer <token>`
  Elasticsearch APIs support the use of bearer tokens in the `Authorization` HTTP header to authenticate with the API.
  For examples, refer to [Token-based authentication services](https://www.elastic.co/docs/deploy-manage/users-roles/cluster-or-deployment-auth/token-based-authentication-services)

## Query string parameters

- `accept_data_loss` (boolean · default: false) — optional
  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 · default: 30s) — optional
  The period to wait for a connection to the master node.
- `timeout` (string · default: 30s) — optional
  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>")
);
```

#### 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"
)
```

