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

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!

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.

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?

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

@Bill_McConaghy . Thanks you!

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