# How to use curl to export dashboard objects?

**URL:** <https://forum.opensearch.org/t/how-to-use-curl-to-export-dashboard-objects/20580>\
**Category:** OpenSearch\
**Created:** [July 29, 2024, 3:46pm UTC](https://forum.opensearch.org/t/how-to-use-curl-to-export-dashboard-objects/20580 "2024-07-29T15:46:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![curlquest](https://avatars.discourse-cdn.com/v4/letter/c/22d042/32.png) [@curlquest](https://forum.opensearch.org/u/curlquest)\
**Post date:** [July 29, 2024, 3:46pm UTC](https://forum.opensearch.org/t/how-to-use-curl-to-export-dashboard-objects/20580/1 "2024-07-29T15:46:17Z")

</div>

**Describe the issue** :  
I wanted to try and make a script that would download the exported dashboards from  
https:// localhost:5202/\_dashboards/app/management/opensearch-dashboards/objects and export all of the dashboards into a ndjson file, but I can’t seem to get this to work.

For example I’ve tried: url -v -X POST “http:// localhost:5202/api/saved\_objects/\_export?overwrite=true” -H “osd-xsrf: true” --insecure

or something like:

curl -XGET “https:// localhost:9202/\_dashboards/app/management/opensearch-dashboards/objects/\_export” -insecure

I usually just get 404 errors or the webpage HTML itself. Sorry if this is a dumb question I don’t often work with cURL. Any help is appreciated. [btw I put spaces in the https:// localhost because it wouldn’t let me post otherwise.]

---

<div class="post-metadata">

**Author:** ![Mantas](https://avatars.discourse-cdn.com/v4/letter/m/7bcc69/32.png) [@Mantas](https://forum.opensearch.org/u/Mantas)\
**Post date:** [July 29, 2024, 4:14pm UTC](https://forum.opensearch.org/t/how-to-use-curl-to-export-dashboard-objects/20580/2 "2024-07-29T16:14:44Z")

</div>

Hi @curlquest,

I came across this discussion on how to import dashboards, if that’s any helpful:

> <https://github.com/opensearch-project/OpenSearch-Dashboards/issues/1723>
>
> Hi,
> 
> I am using metricbeat-oss version 7.10.2 with aws opensearch 1.2 (compati…bility mode enabled so trick the metricbeat with version 7.10.2). The opensearch connection is working fine. However, when I tried to follow the workaround approach in another post (https://github.com/opensearch-project/OpenSearch-Dashboards/issues/831) to manually curl to import the pre-existing metricbeat dashboards to opensearch, I could not trigger the API call successfully,
> 
> curl -k -XPOST -u {id}:{password} -H "osd-xsrf: true" -H 'content-type: application/json' \\
> https://{opensearch url}:443/\_dashboards/api/opensearch-dashboards/dashboards/import?exclude=index-patterh\\&force=true \\
> \-d@Metricbeat-kubernetes-overview.json
> 
> This API is quite puzzling to me,
> 1) when I executed the curl command, I get a "no matches found" error, and it seems the api does not exist. Not sure it's a version problem.
> 2) I could not find any documentation on this opensearch dashbaord API online including opensearch website
> 3) The dashboard in the api is in json format, however, opensearch dashbaord or kibana bashboard only accepts ndjson. How can this work?
> 
> Thank you.
> Charlie

best,  
mj

---

<div class="post-metadata">

**Author:** ![pablo](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/pablo/32/10363_2.png) [@pablo](https://forum.opensearch.org/u/pablo)\
**Post date:** [July 31, 2024, 10:57pm UTC](https://forum.opensearch.org/t/how-to-use-curl-to-export-dashboard-objects/20580/3 "2024-07-31T22:57:59Z")

</div>

@curlquest I’ve answered this question in your other thread.

> [@Is there a Saved Objects API in Opensearch?](https://forum.opensearch.org/t/is-there-a-saved-objects-api-in-opensearch/20625):
>
> Elasticsearch has a Saved Objects API and it is in their documentation, but I can’t find it in the Opensearch documentation. I’ve tried the “curl -XPOST -k http:// localhost:5601/api/saved\_objects/\_export” kind of commands but it does not work. Has it been deprecated? If not, how do I access it?
