# REST API Post /api/kibana/settings/defaultIndex gives 403

**URL:** https://discuss.elastic.co/t/rest-api-post-api-kibana-settings-defaultindex-gives-403/250406
**Category:** Kibana
**Tags:** elastic-stack-security
**Created:** [September 29, 2020, 6:41pm UTC](https://discuss.elastic.co/t/rest-api-post-api-kibana-settings-defaultindex-gives-403/250406 "2020-09-29T18:41:24Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![annanicotera](https://avatars.discourse-cdn.com/v4/letter/a/41988e/32.png) [@annanicotera](https://discuss.elastic.co/u/annanicotera)
#### Post date: [September 29, 2020, 6:41pm UTC](https://discuss.elastic.co/t/rest-api-post-api-kibana-settings-defaultindex-gives-403/250406/1 "2020-09-29T18:41:24Z")

</div>

Elasticsearch 7.9.1 and KIbana 7.91. with X-pack security enabled.

 ![kibana_sla_space_privileges](https://us1.discourse-cdn.com/elastic/original/3X/f/f/fff99211bdf6ffdf6ef190c93c9cf29c7d55818a.png) ![kibana_sla_index_privileges](https://us1.discourse-cdn.com/elastic/original/3X/6/1/615f50552babb28ee5bfdd427fca9252e2f40f9e.png)

I have a role that can create index patterns. See attached index and space privileges screen shots.  
When calling the API:  
POST /api/kibana/settings/defaultIndex , I still get a 403.

> ` "{"type":"response","@timestamp":"2020-09-29T18:08:59Z","tags":[],"pid":21028,"method":"post","statusCode":403,"req":{"url":"/api/kibana/settings/defaultIndex","method":"post","headers":{"x-forwarded-by":"127.0.0.1:8091","x-forwarded-for":"127.0.0.1","x-forwarded-proto":"http","host":"localhost:8091","connection":"close","content-length":"38","accept":"application/json","kbn-xsrf":"true","content-type":"application/json","user-agent":"Apache-HttpClient/4.5.12 (Java/11.0.8)"},"remoteAddress":"127.0.0.1","userAgent":"127.0.0.1"},"res":{"statusCode":403,"responseTime":15,"contentLength":9},"message":"POST /api/kibana/settings/defaultIndex 403 15ms - 9.0B"}"`

If I use the "elastic" superuser account, it works fine. So I know this is a privilege problem. But I cannot seem to find the EXACT privilege I need to make this REST call.  
Can you please tell me exact privileges my role needs to make this REST call? Thanks in advance.

---

<div class="post-metadata">

### Author: ![rashmi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rashmi/32/16391_2.png) [@rashmi](https://discuss.elastic.co/u/rashmi)
#### Post date: [September 30, 2020, 4:54am UTC](https://discuss.elastic.co/t/rest-api-post-api-kibana-settings-defaultindex-gives-403/250406/2 "2020-09-30T04:54:03Z")

</div>

you can change the user privileges from "Index pattern management" permissions of "None" to "All"- that should do it to post your API..( grant Kibana privilege to the user- move from none to all in feature controls- index pattern management )  
Keep us posted.

Thanks

---

<div class="post-metadata">

### Author: ![annanicotera](https://avatars.discourse-cdn.com/v4/letter/a/41988e/32.png) [@annanicotera](https://discuss.elastic.co/u/annanicotera)
#### Post date: [October 3, 2020, 4:39pm UTC](https://discuss.elastic.co/t/rest-api-post-api-kibana-settings-defaultindex-gives-403/250406/3 "2020-10-03T16:39:25Z")

</div>

Please see above screenshot. I already have "All" for "Index Pattern Management" and it still was not helping. I know the privilege is in effect because when I login as this user, I see the button that says "Create Index Pattern" and I do not have the "glasses" icon to indicate read-only as the documentation says. That first screen shot above is under the "Spaces" privileges. I defined a Default space privilege. Any other suggestions?

---

<div class="post-metadata">

### Author: ![annanicotera](https://avatars.discourse-cdn.com/v4/letter/a/41988e/32.png) [@annanicotera](https://discuss.elastic.co/u/annanicotera)
#### Post date: [October 28, 2020, 5:45pm UTC](https://discuss.elastic.co/t/rest-api-post-api-kibana-settings-defaultindex-gives-403/250406/4 "2020-10-28T17:45:47Z")

</div>

Hello. Any comments?

---

<div class="post-metadata">

### Author: ![rashmi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rashmi/32/16391_2.png) [@rashmi](https://discuss.elastic.co/u/rashmi)
#### Post date: [October 29, 2020, 10:14pm UTC](https://discuss.elastic.co/t/rest-api-post-api-kibana-settings-defaultindex-gives-403/250406/5 "2020-10-29T22:14:28Z")

</div>

cc @jportner any inputs here?

Thanks  
Rashmi

---

<div class="post-metadata">

### Author: ![jportner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jportner/32/75692_2.png) [@jportner](https://discuss.elastic.co/u/jportner)
#### Post date: [October 30, 2020, 7:19pm UTC](https://discuss.elastic.co/t/rest-api-post-api-kibana-settings-defaultindex-gives-403/250406/6 "2020-10-30T19:19:47Z")

</div>

Hi @annanicotera, so sorry you haven't had a resolution for this yet.

This API modifies the 'config' saved object. You need the 'All' privilege in the 'Advanced Settings' feature to grant authorization to do so. Keep in mind this will also allow a user with that role to edit any other advanced settings.

---

<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: [November 27, 2020, 7:19pm UTC](https://discuss.elastic.co/t/rest-api-post-api-kibana-settings-defaultindex-gives-403/250406/7 "2020-11-27T19:19:49Z")

</div>

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