---
type: api
title: Delete a lifecycle policy
description: You cannot delete policies that are currently in use. If the policy is being used to manage any indices, the request fails and returns an error.
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v9/operation/operation-ilm-delete-lifecycle
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v9/operation/operation-ilm-delete-lifecycle
products:
  - Elasticsearch
---

# Delete a lifecycle policy

Availability: 6.6+

## Paths

- `DELETE` `/_ilm/policy/{policy}`

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

#### Path Parameters

- `policy` (string Name)
  Identifier for the policy.

## Description

You cannot delete policies that are currently in use. If the policy is being used to manage any indices, the request fails and returns an error.

## Required authorization

* Cluster privileges: `manage_ilm`

## Query String Parameters

- `master_timeout` (string Duration · default: 30s)
  Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.
- `timeout` (string Duration · default: 30s)
  Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

## 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 _ilm/policy/my_policy
```

#### JavaScript

```javascript
const response = await client.ilm.deleteLifecycle({
  name: "my_policy",
});
```

#### Python

```python
resp = client.ilm.delete_lifecycle(
    name="my_policy",
)
```

#### curl

```curl
curl -X DELETE "$ELASTICSEARCH_URL/_ilm/policy/my_policy" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY"
```

#### Java

```java
client.ilm().deleteLifecycle(d -> d
    .name("my_policy")
);
```

#### C#

```c#
var response = await client.IndexLifecycleManagement.DeleteLifecycleAsync(name: "my_policy");
```

#### PHP

```php
$resp = $client->ilm()->deleteLifecycle([
    "policy" => "my_policy",
]);
```

#### Ruby

```ruby
response = client.ilm.delete_lifecycle(
  policy: "my_policy"
)
```

## Response Examples

#### Delete lifecycle response example1

A successful response when deleting a lifecycle policy.

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

