---
type: api
title: Get the dangling indices
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/v9/operation/operation-dangling-indices-list-dangling-indices
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/elasticsearch/v9/operation/operation-dangling-indices-list-dangling-indices
products:
  - Elasticsearch
---

# Get the dangling indices

Availability: Generally available since 7.9

## Paths

- `GET` `/_dangling`

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

Use this API to list dangling indices, which you can then import or delete.

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

## Response

`application/json`

- `dangling_indices` (object[])
  - `index_name` (string)
  - `index_uuid` (string)
  - `creation_date_millis` (number)
  - `node_ids` (string)
## Code examples

#### Console

```console
GET /_dangling
```

#### JavaScript

```javascript
const response = await client.danglingIndices.listDanglingIndices();
```

#### Python

```python
resp = client.dangling_indices.list_dangling_indices()
```

#### curl

```curl
curl -X GET "$ELASTICSEARCH_URL/_dangling" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY"
```

#### Java

```java
client.danglingIndices().listDanglingIndices();
```

#### C#

```c#
var response = await client.DanglingIndices.ListDanglingIndicesAsync();
```

#### PHP

```php
$resp = $client->danglingIndices()->listDanglingIndices();
```

#### Ruby

```ruby
response = client.dangling_indices.list_dangling_indices
```

## Response examples

#### List dangling indices response example1

```json
{
  "dangling_indices": [
   {
    "index_name": "my-index-000001",
    "index_uuid": "zmM4e0JtBkeUjiHD-MihPQ",
    "creation_date_millis": 1589414451372,
    "node_ids": [
      "pL47UN3dAb2d5RCWP6lQ3e"
    ]
   }
  ]
}
```

