# The document payload of the Delete api

**URL:** <https://discuss.elastic.co/t/the-document-payload-of-the-delete-api/16000>\
**Category:** Elasticsearch\
**Created:** [February 25, 2014, 5:46am UTC](https://discuss.elastic.co/t/the-document-payload-of-the-delete-api/16000 "2014-02-25T05:46:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ivan\_Ji](https://avatars.discourse-cdn.com/v4/letter/i/d78d45/32.png) [@Ivan\_Ji](https://discuss.elastic.co/u/Ivan_Ji)\
**Post date:** [February 25, 2014, 5:46am UTC](https://discuss.elastic.co/t/the-document-payload-of-the-delete-api/16000/1 "2014-02-25T05:46:28Z")

</div>

Hi all,

I am wondering whether the delete API support to return the content of the  
deleted documents because I need to know the content of the deleted  
documents.

Of course, I can get the document first and then delete it with two REST  
API. But are there any api to achieve it?

any suggestions?

Best,

Ivan

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/b290ad84-5870-4651-a30a-c8848cf2f062%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b290ad84-5870-4651-a30a-c8848cf2f062%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Binh\_Ly](https://avatars.discourse-cdn.com/v4/letter/b/ce7236/32.png) [@Binh\_Ly](https://discuss.elastic.co/u/Binh_Ly)\
**Post date:** [February 25, 2014, 2:35pm UTC](https://discuss.elastic.co/t/the-document-payload-of-the-delete-api/16000/2 "2014-02-25T14:35:37Z")

</div>

Unfortunately, you'll have to GET it first.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/49c78498-d1b6-44ce-bb85-b6f9d9d9b7a7%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/49c78498-d1b6-44ce-bb85-b6f9d9d9b7a7%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![brian\_yoder](https://avatars.discourse-cdn.com/v4/letter/b/f1d935/32.png) [@brian\_yoder](https://discuss.elastic.co/u/brian_yoder)\
**Post date:** [February 25, 2014, 3:59pm UTC](https://discuss.elastic.co/t/the-document-payload-of-the-delete-api/16000/3 "2014-02-25T15:59:25Z")

</div>

And note that if you GET it and save the version number, and then pass the  
version number into the DELETE, you can be sure it will be deleted only if  
nobody else updated it in the meantime.

This all works so much better in Java than in scripts + curl.

Brian

On Tuesday, February 25, 2014 9:35:37 AM UTC-5, Binh Ly wrote:

> Unfortunately, you'll have to GET it first.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/f3e7e97a-284b-4d3a-b333-b03b8c9f65fe%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/f3e7e97a-284b-4d3a-b333-b03b8c9f65fe%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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 6, 2017, 1:47am UTC](https://discuss.elastic.co/t/the-document-payload-of-the-delete-api/16000/4 "2017-07-06T01:47:22Z")

</div>


