# Set default index with curl command

**URL:** https://discuss.elastic.co/t/set-default-index-with-curl-command/220578
**Category:** Kibana
**Created:** [February 24, 2020, 7:05am UTC](https://discuss.elastic.co/t/set-default-index-with-curl-command/220578 "2020-02-24T07:05:37Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Voula\_Mikr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/voula_mikr/32/58451_2.png) [@Voula\_Mikr](https://discuss.elastic.co/u/Voula_Mikr)
#### Post date: [February 24, 2020, 7:05am UTC](https://discuss.elastic.co/t/set-default-index-with-curl-command/220578/1 "2020-02-24T07:05:37Z")

</div>

Hi!

I imported some dashboards to a fresh kibana helm deployment (7.0.1 version) but when I am going to open a dashboard, kibana asks to set the default index.  
How can I set the default index with a **curl command**?

Thank you in advance!

---

<div class="post-metadata">

### Author: ![tsullivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsullivan/32/31077_2.png) [@tsullivan](https://discuss.elastic.co/u/tsullivan)
#### Post date: [February 24, 2020, 8:46pm UTC](https://discuss.elastic.co/t/set-default-index-with-curl-command/220578/2 "2020-02-24T20:46:45Z")

</div>

It's the `defaultIndex` value in Advanced Settings needed for these fresh installs of Kibana. It looks like it might not be documented, but I can see from a network inspector that the curl command would be:

```auto
curl 'http://localhost:5601/api/kibana/settings' \
-H 'kbn-version: 7.5.1' \
-H 'Content-Type: application/json' \
--data-binary '{"changes":{"defaultIndex":"be7e57b0-572c-11ea-bb8f-a54396990d95"}}' \
--compressed

```

You can replace `be7e57b0-572c-11ea-bb8f-a54396990d95` with the ID of the index pattern you wish to set.

---

<div class="post-metadata">

### Author: ![tsullivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsullivan/32/31077_2.png) [@tsullivan](https://discuss.elastic.co/u/tsullivan)
#### Post date: [February 24, 2020, 9:19pm UTC](https://discuss.elastic.co/t/set-default-index-with-curl-command/220578/3 "2020-02-24T21:19:59Z")

</div>

BTW there was an issue to make these settings documented, but it looks like the API schema would have to be re-considered first. So I would expect this API to have breaking changes at any time over a Kibana minor release.

> <https://github.com/elastic/kibana/issues/14873>
>
> We should add documentation for this API and tag experimental.

---

<div class="post-metadata">

### Author: ![Voula\_Mikr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/voula_mikr/32/58451_2.png) [@Voula\_Mikr](https://discuss.elastic.co/u/Voula_Mikr)
#### Post date: [February 25, 2020, 1:20pm UTC](https://discuss.elastic.co/t/set-default-index-with-curl-command/220578/4 "2020-02-25T13:20:20Z")

</div>

Thank you for the response Tim.

The curl command works fine for a deployment I have on a vm but I get {"message":"blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];: [cluster\_block\_exception] blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];","statusCode":403,"error":"Forbidden"} when I run this curl on an another deployment. If you have a hint for this error will be more than helpful!!  
Thank you againe 🙂

---

<div class="post-metadata">

### Author: ![tsullivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsullivan/32/31077_2.png) [@tsullivan](https://discuss.elastic.co/u/tsullivan)
#### Post date: [February 25, 2020, 6:18pm UTC](https://discuss.elastic.co/t/set-default-index-with-curl-command/220578/5 "2020-02-25T18:18:09Z")

</div>

Hi, that error is being forwarded from Elasticsearch. The elasticsearch node logs will have more information about what is going on. It looks like the cluster is in a read-only state and that often means something about the disk volume that a node is running on.

---

<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: [March 24, 2020, 6:18pm UTC](https://discuss.elastic.co/t/set-default-index-with-curl-command/220578/6 "2020-03-24T18:18:09Z")

</div>

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