# Where does the export saved Object API put the exported objects?

**URL:** https://discuss.elastic.co/t/where-does-the-export-saved-object-api-put-the-exported-objects/238378
**Category:** Kibana
**Created:** [June 24, 2020, 5:35am UTC](https://discuss.elastic.co/t/where-does-the-export-saved-object-api-put-the-exported-objects/238378 "2020-06-24T05:35:04Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![mykael](https://avatars.discourse-cdn.com/v4/letter/m/ec9cab/32.png) [@mykael](https://discuss.elastic.co/u/mykael)
#### Post date: [June 24, 2020, 5:35am UTC](https://discuss.elastic.co/t/where-does-the-export-saved-object-api-put-the-exported-objects/238378/1 "2020-06-24T05:35:04Z")

</div>

OK, used curl to drive the saved object export api:

`curl -X POST "localhost:9200/api/saved_objects/_export" -H "kbn-xsrf: true" -H "Content-Type: application/json" -d "{ \"objects\": [{ \"type\": \"dashboard\" }], \"includeReferencesDeep\": true }"`

Basically dumping out all of the dashboards and everything that feeds into them.

I get back a response saying it's done it, but where is the file holding the exported objects? When I do it through my web browser I get a new file - exported.ndjson - downloaded, but all curl is giving me is a 'great done it!'.

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [June 24, 2020, 5:40am UTC](https://discuss.elastic.co/t/where-does-the-export-saved-object-api-put-the-exported-objects/238378/2 "2020-06-24T05:40:25Z")

</div>

It'll usually save it in the directory you ran the command from.

---

<div class="post-metadata">

### Author: ![mykael](https://avatars.discourse-cdn.com/v4/letter/m/ec9cab/32.png) [@mykael](https://discuss.elastic.co/u/mykael)
#### Post date: [June 24, 2020, 5:57am UTC](https://discuss.elastic.co/t/where-does-the-export-saved-object-api-put-the-exported-objects/238378/3 "2020-06-24T05:57:30Z")

</div>

Nope, no sign of any new files.

The response is:

`{"_index":"api","_type":"saved_objects","_id":"_export","_version":5,"result":"updated","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":4,"_primary_term":1}`

There are definitely some dashboards loaded into Kibana.

Any guesses as to what the filename would be? If I add a -o to curl, I just get the response written to a file...

I'm sending it to port 9200. If I try sending it to 5601 - as the manual indicates - I get:

`{"statusCode":400,"error":"Bad Request","message":"Invalid request payload JSON format"}`

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [June 24, 2020, 6:00am UTC](https://discuss.elastic.co/t/where-does-the-export-saved-object-api-put-the-exported-objects/238378/4 "2020-06-24T06:00:39Z")

</div>

Ahh ok.

You need to be talking to the Kibana host/IP, which uses port 5601, not Elasticsearch, which uses port 9200. If you talk to Elasticsearch with that query, you are actually creating/updating a document in an index called `api`. Which is what that response is saying. You should be able verify that by checking with `_cat/indices?v`.

You should also be using the `-o` flag for curl as you mention, I did forget that part myself 🙂

---

<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: [July 22, 2020, 6:00am UTC](https://discuss.elastic.co/t/where-does-the-export-saved-object-api-put-the-exported-objects/238378/5 "2020-07-22T06:00:42Z")

</div>

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