---
type: api
title: Import 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-import-dangling-index
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-dangling-indices-import-dangling-index
products:
  - Elasticsearch
---

# Import a dangling index

Availability: 7.9+

## Paths

- `POST` `/_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 import. Use the get dangling indices API to locate 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 import a dangling index.
Because Elasticsearch cannot know where the dangling index data came from or determine which shard copies are fresh and which are stale, it cannot guarantee that the imported data represents the latest state of the index when it was last in the cluster.
- `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
POST /_dangling/zmM4e0JtBkeUjiHD-MihPQ?accept_data_loss=true
```

#### JavaScript

```javascript
const response = await client.danglingIndices.importDanglingIndex({
  index_uuid: "zmM4e0JtBkeUjiHD-MihPQ",
  accept_data_loss: "true",
});
```

#### Python

```python
resp = client.dangling_indices.import_dangling_index(
    index_uuid="zmM4e0JtBkeUjiHD-MihPQ",
    accept_data_loss=True,
)
```

#### curl

```curl
curl -X POST "$ELASTICSEARCH_URL/_dangling/zmM4e0JtBkeUjiHD-MihPQ?accept_data_loss=true" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY"
```

#### Java

```java
client.danglingIndices().importDanglingIndex(i -> i
    .acceptDataLoss(true)
    .indexUuid("zmM4e0JtBkeUjiHD-MihPQ")
);
```

#### C#

```c#
var response = await client.DanglingIndices
    .ImportDanglingIndexAsync(indexUuid: "zmM4e0JtBkeUjiHD-MihPQ", d1 => d1
        .AcceptDataLoss(true)
    );
```

#### PHP

```php
$resp = $client->danglingIndices()->importDanglingIndex([
    "index_uuid" => "zmM4e0JtBkeUjiHD-MihPQ",
    "accept_data_loss" => "true",
]);
```

#### Ruby

```ruby
response = client.dangling_indices.import_dangling_index(
  index_uuid: "zmM4e0JtBkeUjiHD-MihPQ",
  accept_data_loss: "true"
)
```

## Response Examples

#### Import dangling index response example1

A successful response from `POST /_dangling/zmM4e0JtBkeUjiHD-MihPQ?accept_data_loss=true`.

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

