# Bug report for Documents API

**URL:** <https://discuss.elastic.co/t/bug-report-for-documents-api/275613>\
**Category:** Elastic Search\
**Tags:** elastic-app-search\
**Created:** [June 10, 2021, 7:42pm UTC](https://discuss.elastic.co/t/bug-report-for-documents-api/275613 "2021-06-10T19:42:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![zkirill](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zkirill/32/89957_2.png) [@zkirill](https://discuss.elastic.co/u/zkirill)\
**Post date:** [June 10, 2021, 7:42pm UTC](https://discuss.elastic.co/t/bug-report-for-documents-api/275613/1 "2021-06-10T19:42:07Z")

</div>

When deleting a document by ID the API falsely suggests that the document was not deleted whereas it has, in fact, been deleted.

Given the following document:

```auto
[
  {
    "id": 1,
    "name": "Apple pie"    
  }
]

```

The query to delete the document with a numeric ID is executed as follows. Notice that the document ID is written as a number and not as a string.

```auto
curl -X DELETE 'https://[instance id].ent-search.[region].[provider].cloud.es.io/api/as/v1/engines/national-parks-demo/documents' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxx' \
-d '[1]'

```

The response (HTTP 200) suggests that the document was not deleted:

```auto
[
  {
    "id": 1,
    "deleted": false
  }
]

```

However, the document does, in fact, get deleted.

Altering the delete request to include the document ID as a string "1" instead of a number 1 performs as expected.

---

<div class="post-metadata">

**Author:** ![Irina\_Truong](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/irina_truong/32/112040_2.png) [@Irina\_Truong](https://discuss.elastic.co/u/Irina_Truong)\
**Post date:** [June 10, 2021, 8:08pm UTC](https://discuss.elastic.co/t/bug-report-for-documents-api/275613/2 "2021-06-10T20:08:41Z")

</div>

Nice catch @zkirill! I created a ticket in the corresponding repo. Thank you for reporting!

---

<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 8, 2021, 8:08pm UTC](https://discuss.elastic.co/t/bug-report-for-documents-api/275613/3 "2021-07-08T20:08:49Z")

</div>

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