---
type: api
title: Retry a policy
description: Retry running the lifecycle policy for an index that is in the ERROR step.
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/elasticsearch/v9/operation/operation-ilm-retry
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/elasticsearch/v9/operation/operation-ilm-retry
products:
  - Elasticsearch
---

# Retry a policy

Availability: Generally available since 6.6

## Paths

- `POST` `/{index}/_ilm/retry`

#### Path parameters

- `index` (string) — required
  The name of the indices (comma-separated) whose failed lifecycle step is to be retry

## Description

Retry running the lifecycle policy for an index that is in the ERROR step.
The API sets the policy back to the step where the error occurred and runs the step.
Use the explain lifecycle state API to determine whether an index is in the ERROR step.

## Required authorization

- Index privileges: `manage_ilm`

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

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

#### Console

```console
POST /my-index-000001/_ilm/retry
```

#### JavaScript

```javascript
const response = await client.ilm.retry({
  index: "my-index-000001",
});
```

#### Python

```python
resp = client.ilm.retry(
    index="my-index-000001",
)
```

#### curl

```curl
curl -X POST "$ELASTICSEARCH_URL/my-index-000001/_ilm/retry" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY"
```

#### Java

```java
client.ilm().retry(r -> r
    .index("my-index-000001")
);
```

#### C#

```c#
var response = await client.IndexLifecycleManagement.RetryAsync(index: "my-index-000001");
```

#### PHP

```php
$resp = $client->ilm()->retry([
    "index" => "my-index-000001",
]);
```

#### Ruby

```ruby
response = client.ilm.retry(
  index: "my-index-000001"
)
```

