Get dashboards related saved objects using REST API

Hi,
I want to programatically export/import a dashboard from one space to another including all its related saved objects. The steps I am thinking about are:

  1. Create Space let's call it "Space-X"
  2. Get id of the dashboard I want to import ( can be done manually in Kibana)
  3. Get list of ids for all related saved objects (index-patterns, visualizations and saved searches)
  4. Import everything at once

How can I get list of ids for all related saved objects programatically using Kibana REST API?

I found that I can do this easily using import/export dashboards APIs
https://www.elastic.co/guide/en/kibana/current/dashboard-import-api-import.html
https://www.elastic.co/guide/en/kibana/current/dashboard-import-api-export.html

But I don't know how can I set the space to where I want this dashboard to be exported

There is a blog post with more information on this here: https://www.elastic.co/blog/how-to-migrate-to-kibana-spaces

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