# Kibana SaveObject API

**URL:** <https://discuss.elastic.co/t/kibana-saveobject-api/252557>\
**Category:** Kibana\
**Created:** [October 19, 2020, 2:01pm UTC](https://discuss.elastic.co/t/kibana-saveobject-api/252557 "2020-10-19T14:01:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mhr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mhr/32/119834_2.png) [@mhr](https://discuss.elastic.co/u/mhr)\
**Post date:** [October 19, 2020, 2:01pm UTC](https://discuss.elastic.co/t/kibana-saveobject-api/252557/1 "2020-10-19T14:01:58Z")

</div>

HI Support,

How to Import selective save object using Curl Command. I do not want to import IndexPattern using curl API from ndjson file.

---

<div class="post-metadata">

**Author:** ![Dzmitry](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dzmitry/32/65026_2.png) [@Dzmitry](https://discuss.elastic.co/u/Dzmitry)\
**Post date:** [October 19, 2020, 4:05pm UTC](https://discuss.elastic.co/t/kibana-saveobject-api/252557/2 "2020-10-19T16:05:24Z")

</div>

Hi @mhr,

What request did you try so far?  
Did you check [official documentation for import API](https://www.elastic.co/guide/en/kibana/master/saved-objects-api-import.html)?

Regards, Dzmitry

---

<div class="post-metadata">

**Author:** ![DMinovski](https://avatars.discourse-cdn.com/v4/letter/d/5fc32e/32.png) [@DMinovski](https://discuss.elastic.co/u/DMinovski)\
**Post date:** [November 7, 2020, 2:16pm UTC](https://discuss.elastic.co/t/kibana-saveobject-api/252557/3 "2020-11-07T14:16:20Z")

</div>

I tried using the .ndjson content from the file directly in the request body (payload) with the parameter -d, the same way that indices are created and can be used by copying the content from a file into the request body. I used the header

`-H "Content-Type: application/x-ndjson"`  
too but it returns

`{"statusCode":415,"error":"Unsupported Media Type","message":"Unsupported Media Type"}`

Is it possible to send saved object directly and not from file? The command:

`curl -u username:password -XPOST "http://localhost:5601/api/saved_objects/_import?overwrite=true" -H "Content-Type: application/json" -H 'kbn-xsrf: true' -H 'securitytenant: Global' -d '{"type":"index-pattern","id":"my-pattern","attributes":{"title":"my-pattern-*"}}' `

---

<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:** [December 5, 2020, 2:16pm UTC](https://discuss.elastic.co/t/kibana-saveobject-api/252557/4 "2020-12-05T14:16:22Z")

</div>

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