# How to create index-pattern and import dashboard using REST API?

**URL:** <https://discuss.elastic.co/t/how-to-create-index-pattern-and-import-dashboard-using-rest-api/138651>\
**Category:** Kibana\
**Created:** [July 5, 2018, 7:31am UTC](https://discuss.elastic.co/t/how-to-create-index-pattern-and-import-dashboard-using-rest-api/138651 "2018-07-05T07:31:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ahrtr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ahrtr/32/29551_2.png) [@ahrtr](https://discuss.elastic.co/u/ahrtr)\
**Post date:** [July 5, 2018, 7:31am UTC](https://discuss.elastic.co/t/how-to-create-index-pattern-and-import-dashboard-using-rest-api/138651/1 "2018-07-05T07:31:45Z")

</div>

Hi, I can create index-pattern and import dashboard using kibana GUI, but I'd like to do these tasks programatically. The kibana version what I am using is 6.2.2.

Thanks!

---

<div class="post-metadata">

**Author:** ![Bill\_McConaghy](https://avatars.discourse-cdn.com/v4/letter/b/ed655f/32.png) [@Bill\_McConaghy](https://discuss.elastic.co/u/Bill_McConaghy)\
**Post date:** [July 5, 2018, 2:28pm UTC](https://discuss.elastic.co/t/how-to-create-index-pattern-and-import-dashboard-using-rest-api/138651/2 "2018-07-05T14:28:42Z")

</div>

We don't officially support using APIs to do this, but it can be done. You can open devtools in your browser and create an index pattern and import a dashboard, and then look at the network requests your browser makes and copy those for your own work.

---

<div class="post-metadata">

**Author:** ![ahrtr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ahrtr/32/29551_2.png) [@ahrtr](https://discuss.elastic.co/u/ahrtr)\
**Post date:** [July 6, 2018, 4:28am UTC](https://discuss.elastic.co/t/how-to-create-index-pattern-and-import-dashboard-using-rest-api/138651/3 "2018-07-06T04:28:47Z")

</div>

Thanks, it works!

But there is one minor issue. When I imported the dashboard & visualization JSON file programatically, I had to send a POST request for each saved object. Is it possible to just send one POST request for all saved objects which were saved in one JSON file?

---

<div class="post-metadata">

**Author:** ![Bill\_McConaghy](https://avatars.discourse-cdn.com/v4/letter/b/ed655f/32.png) [@Bill\_McConaghy](https://discuss.elastic.co/u/Bill_McConaghy)\
**Post date:** [July 6, 2018, 1:12pm UTC](https://discuss.elastic.co/t/how-to-create-index-pattern-and-import-dashboard-using-rest-api/138651/4 "2018-07-06T13:12:35Z")

</div>

At the moment, you have to do this one at a time. There is a PR open to add the bulk create functionality to the saved objects API, but that will not be available until it gets merged and then released. You can follow this work here: [https://github.com/elastic/kibana/pull/20498](https://github.com/elastic/kibana/pull/20498)

---

<div class="post-metadata">

**Author:** ![ahrtr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ahrtr/32/29551_2.png) [@ahrtr](https://discuss.elastic.co/u/ahrtr)\
**Post date:** [July 8, 2018, 11:50pm UTC](https://discuss.elastic.co/t/how-to-create-index-pattern-and-import-dashboard-using-rest-api/138651/5 "2018-07-08T23:50:24Z")

</div>

@Bill_McConaghy . Thanks you!

---

<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:** [August 5, 2018, 11:50pm UTC](https://discuss.elastic.co/t/how-to-create-index-pattern-and-import-dashboard-using-rest-api/138651/6 "2018-08-05T23:50:24Z")

</div>

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