# Cant access API. Get unauthorized message

**URL:** <https://discuss.elastic.co/t/cant-access-api-get-unauthorized-message/311876>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-security\
**Created:** [August 10, 2022, 8:38pm UTC](https://discuss.elastic.co/t/cant-access-api-get-unauthorized-message/311876 "2022-08-10T20:38:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![MK817664](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mk817664/32/99690_2.png) [@MK817664](https://discuss.elastic.co/u/MK817664)\
**Post date:** [August 10, 2022, 8:38pm UTC](https://discuss.elastic.co/t/cant-access-api-get-unauthorized-message/311876/1 "2022-08-10T20:38:25Z")

</div>

So I'm very new and green to ES, I was trying to run over some online docs to try and get the connected to the API and do a insert of an attachment (PDF)

When I attempted to run the put command I get back

action [indices:admin/auto\_create] is unauthorized for user [creatIndex] with roles

So I went to the user, created a new roll, however under the indexes drop down it says there are no objects avalible.. So I ran the create index put command to create a single document index that does show up under index manager however I am unable to see it when I create or update a roll.

I tried to add the index in by just typing it, and running my code again, but this time I get back the following message

'action [indices:admin/auto\_create] is unauthorized for user [creatIndex] with roles [apiRoll] on indices [books], this action is granted by the index privileges [auto\_configure,create\_index,manage,all]'

Odd enough, the index is not named book, I have no idea where that is coming from, but also, it still does not work..

Is there any docs that may go over this a bit more?

---

<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:** [September 7, 2022, 8:38pm UTC](https://discuss.elastic.co/t/cant-access-api-get-unauthorized-message/311876/2 "2022-09-07T20:38:59Z")

</div>

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