# How do you delete the task document once the task has completed?

**URL:** <https://discuss.elastic.co/t/how-do-you-delete-the-task-document-once-the-task-has-completed/134492>\
**Category:** Elasticsearch\
**Created:** [June 4, 2018, 9:22pm UTC](https://discuss.elastic.co/t/how-do-you-delete-the-task-document-once-the-task-has-completed/134492 "2018-06-04T21:22:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jinggang\_Diao](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jinggang_diao/32/31917_2.png) [@Jinggang\_Diao](https://discuss.elastic.co/u/Jinggang_Diao)\
**Post date:** [June 4, 2018, 9:22pm UTC](https://discuss.elastic.co/t/how-do-you-delete-the-task-document-once-the-task-has-completed/134492/1 "2018-06-04T21:22:57Z")

</div>

This question is also asked here [No delete task by id API in ES cluster? Intentionally? Not documented?](https://discuss.elastic.co/t/no-delete-task-by-id-api-in-es-cluster-intentionally-not-documented/89412/4), but no answer is provided.

---

<div class="post-metadata">

**Author:** ![Jinggang\_Diao](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jinggang_diao/32/31917_2.png) [@Jinggang\_Diao](https://discuss.elastic.co/u/Jinggang_Diao)\
**Post date:** [June 4, 2018, 9:37pm UTC](https://discuss.elastic.co/t/how-do-you-delete-the-task-document-once-the-task-has-completed/134492/2 "2018-06-04T21:37:34Z")

</div>

Okay I figured it out.  
Node Id + Task Id: ZKUuxQZpRCCcJ0njBM1P0A:442  
Method: Delete  
URI: [http://localhost:9200/.tasks/task/ZKUuxQZpRCCcJ0njBM1P0A:442](http://localhost:9200/.tasks/task/ZKUuxQZpRCCcJ0njBM1P0A:442)

Follow this format if you want to delete the document where your task is recorded.

The response looks like this  
{  
"\_index": ".tasks",  
"\_type": "task",  
"\_id": "ZKUuxQZpRCCcJ0njBM1P0A:442",  
"\_version": 2,  
"result": "deleted",  
"\_shards": {  
"total": 1,  
"successful": 1,  
"failed": 0  
},  
"\_seq\_no": 13,  
"\_primary\_term": 5  
}

---

<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:** [July 2, 2018, 9:37pm UTC](https://discuss.elastic.co/t/how-do-you-delete-the-task-document-once-the-task-has-completed/134492/3 "2018-07-02T21:37:35Z")

</div>

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