# Get dashboards related saved objects using REST API

**URL:** <https://discuss.elastic.co/t/get-dashboards-related-saved-objects-using-rest-api/162776>\
**Category:** Kibana\
**Created:** [January 3, 2019, 9:49am UTC](https://discuss.elastic.co/t/get-dashboards-related-saved-objects-using-rest-api/162776 "2019-01-03T09:49:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![M.alsioufi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/m.alsioufi/32/52269_2.png) [@M.alsioufi](https://discuss.elastic.co/u/M.alsioufi)\
**Post date:** [January 3, 2019, 9:49am UTC](https://discuss.elastic.co/t/get-dashboards-related-saved-objects-using-rest-api/162776/1 "2019-01-03T09:49:08Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![M.alsioufi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/m.alsioufi/32/52269_2.png) [@M.alsioufi](https://discuss.elastic.co/u/M.alsioufi)\
**Post date:** [January 3, 2019, 10:03am UTC](https://discuss.elastic.co/t/get-dashboards-related-saved-objects-using-rest-api/162776/2 "2019-01-03T10:03:53Z")

</div>

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-import.html)  
[https://www.elastic.co/guide/en/kibana/current/dashboard-import-api-export.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

---

<div class="post-metadata">

**Author:** ![tylersmalley](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tylersmalley/32/8833_2.png) [@tylersmalley](https://discuss.elastic.co/u/tylersmalley)\
**Post date:** [January 3, 2019, 11:55pm UTC](https://discuss.elastic.co/t/get-dashboards-related-saved-objects-using-rest-api/162776/3 "2019-01-03T23:55:28Z")

</div>

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

---

<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:** [January 31, 2019, 11:55pm UTC](https://discuss.elastic.co/t/get-dashboards-related-saved-objects-using-rest-api/162776/4 "2019-01-31T23:55:36Z")

</div>

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