# Delete by Query security exception

**URL:** <https://discuss.elastic.co/t/delete-by-query-security-exception/229768>\
**Category:** Elasticsearch\
**Created:** [April 25, 2020, 2:47pm UTC](https://discuss.elastic.co/t/delete-by-query-security-exception/229768 "2020-04-25T14:47:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![goetia](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/goetia/32/45072_2.png) [@goetia](https://discuss.elastic.co/u/goetia)\
**Post date:** [April 25, 2020, 2:47pm UTC](https://discuss.elastic.co/t/delete-by-query-security-exception/229768/1 "2020-04-25T14:47:53Z")

</div>

Hi,

I'm having problems while trying to delete documents using delete\_by\_query. my cURL is as follows:

```auto
curl -X POST -u elastic:xxxxxxxxxxxx 'http://host:9200/index-*/delete_by_query' -H 'Content-Type: application/json' -d'
{
    "query": {"bool": {"must": [{"match":{"key1": "value1"}}, {"match":{"key2": "value2"}}, {"term":{"key3": value3}}]}}
}
'

```

I get error:

```auto
{"error":{"root_cause":[{"type":"security_exception","reason":"action [indices:admin/create] is unauthorized for user [elastic]"}],"type":"security_exception","reason":"action [indices:admin/create] is unauthorized for user [elastic]","caused_by":{"type":"illegal_state_exception","reason":"There are no external requests known to support wildcards that don't support replacing their indices"}},"status":403}%     

```

User elastic has default superuser role. Any help?

Thanks

---

<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 23, 2020, 2:47pm UTC](https://discuss.elastic.co/t/delete-by-query-security-exception/229768/2 "2020-05-23T14:47:53Z")

</div>

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