# How to add deletion policy in existing policy?

**URL:** https://discuss.elastic.co/t/how-to-add-deletion-policy-in-existing-policy/328052
**Category:** Elasticsearch
**Created:** [March 20, 2023, 8:42am UTC](https://discuss.elastic.co/t/how-to-add-deletion-policy-in-existing-policy/328052 "2023-03-20T08:42:07Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Mark\_S](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_s/32/98686_2.png) [@Mark\_S](https://discuss.elastic.co/u/Mark_S)
#### Post date: [March 20, 2023, 8:42am UTC](https://discuss.elastic.co/t/how-to-add-deletion-policy-in-existing-policy/328052/1 "2023-03-20T08:42:07Z")

</div>

I have a simple rotating policy and I want to add a deletion phase. This is not available in the UI, however I have done by creating a policy directly with PUT, including the delete section.  
My question is if it is possible to update an existing policy  
I tried to PUT only the delete part, but it was rejected.  
In [Create or update lifecycle policy API | Elasticsearch Guide [8.6] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-put-lifecycle.html) I see that the whole policy is given - is it not possible to only PUT the new part?

Here is my policy:

```auto
{
  "testindexpolicy" : {
    "version" : 1,
    "modified_date" : "2023-03-17T12:08:04.639Z",
    "policy" : {
      "phases" : {
        "hot" : {
          "min_age" : "0ms",
          "actions" : {
            "set_priority" : {
              "priority" : 100
            },
            "rollover" : {
              "max_primary_shard_size" : "1gb",
              "max_age" : "1d"
            }
          }
        }
      }
    },
    "in_use_by" : {
      "indices" : [index_from_logstash_test_alias-000002],
      "data_streams" : [],
      "composable_templates" : [
        "test_template"
      ]
    }

```

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [April 17, 2023, 8:42am UTC](https://discuss.elastic.co/t/how-to-add-deletion-policy-in-existing-policy/328052/2 "2023-04-17T08:42:59Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
