# Get API, refresh=wait\_for not allowed

**URL:** <https://discuss.elastic.co/t/get-api-refresh-wait-for-not-allowed/230396>\
**Category:** Elasticsearch\
**Created:** [April 29, 2020, 3:01pm UTC](https://discuss.elastic.co/t/get-api-refresh-wait-for-not-allowed/230396 "2020-04-29T15:01:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![antonio\_antuan](https://avatars.discourse-cdn.com/v4/letter/a/e0b2c6/32.png) [@antonio\_antuan](https://discuss.elastic.co/u/antonio_antuan)\
**Post date:** [April 29, 2020, 3:01pm UTC](https://discuss.elastic.co/t/get-api-refresh-wait-for-not-allowed/230396/1 "2020-04-29T15:01:13Z")

</div>

Hi!  
I'm using elasticsearch 7.4.2. Docs are [saying](https://www.elastic.co/guide/en/elasticsearch/reference/7.4/docs-get.html#docs-get-api-query-params) that I can set `refresh` parameter with `wait_for` value. But if I try to do this, an error is returned:

`GET http://0.0.0.0:9200/events/_doc/31780294-6529-425d-b0fa-7b03b9485ca4?refresh=wait_for`

```auto
{"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"Failed to parse value [wait_for] as only [true] or [false] are allowed."}],"type":"illegal_argument_exception","reason":"Failed to parse value [wait_for] as only [true] or [false] are allowed."},"status":400}

```

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [April 29, 2020, 3:28pm UTC](https://discuss.elastic.co/t/get-api-refresh-wait-for-not-allowed/230396/2 "2020-04-29T15:28:51Z")

</div>

Welcome!

Tested on 7.6 and was able to reproduce the problem.

```auto
DELETE test 
PUT test/_doc/1
{
  "foo": "bar"
}
GET test/_doc/1?refresh=wait_for

```

Gives:

```auto
# GET test/_doc/1?refresh=wait_for
{
  "error" : {
    "root_cause" : [
      {
        "type" : "illegal_argument_exception",
        "reason" : "Failed to parse value [wait_for] as only [true] or [false] are allowed."
      }
    ],
    "type" : "illegal_argument_exception",
    "reason" : "Failed to parse value [wait_for] as only [true] or [false] are allowed."
  },
  "status" : 400
}

```

Refresh=wait\_for works well for the PUT document API though:

```auto
PUT test/_doc/1?refresh=wait_for
{
  "foo": "bar"
}

```

Could you open an issue in elasticsearch repository? It's at least a documentation issue IMHO.

Thanks for reporting!

---

<div class="post-metadata">

**Author:** ![antonio\_antuan](https://avatars.discourse-cdn.com/v4/letter/a/e0b2c6/32.png) [@antonio\_antuan](https://discuss.elastic.co/u/antonio_antuan)\
**Post date:** [April 29, 2020, 8:14pm UTC](https://discuss.elastic.co/t/get-api-refresh-wait-for-not-allowed/230396/3 "2020-04-29T20:14:44Z")

</div>

Thanks.  
Issue created: [https://github.com/elastic/elasticsearch/issues/55970](https://github.com/elastic/elasticsearch/issues/55970)

---

<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:** [May 27, 2020, 8:14pm UTC](https://discuss.elastic.co/t/get-api-refresh-wait-for-not-allowed/230396/4 "2020-05-27T20:14:47Z")

</div>

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