# Problem Posting to Kibana Shared Objects API

**URL:** <https://discuss.elastic.co/t/problem-posting-to-kibana-shared-objects-api/266595>\
**Category:** Kibana\
**Created:** [March 8, 2021, 6:54pm UTC](https://discuss.elastic.co/t/problem-posting-to-kibana-shared-objects-api/266595 "2021-03-08T18:54:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![brett.b](https://avatars.discourse-cdn.com/v4/letter/b/ce73a5/32.png) [@brett.b](https://discuss.elastic.co/u/brett.b)\
**Post date:** [March 8, 2021, 6:54pm UTC](https://discuss.elastic.co/t/problem-posting-to-kibana-shared-objects-api/266595/1 "2021-03-08T18:54:24Z")

</div>

Hello there - I'm trying to use the Saved Objects "import" feature, but I keep getting 415 response codes. I used the export feature to export a dashboard to a ndjson file and then I try to push that same dashboard back to the cluster but it fails. I have tried with + without the headers `"Content-Type": "application/ndjson" [or] "application/x-ndjson"` but those don't seem to help.

Following the documentation [here](https://www.elastic.co/guide/en/kibana/master/saved-objects-api-import.html), I tried to run the [first post](https://www.elastic.co/guide/en/kibana/master/saved-objects-api-import.html) and can't even get that to work. It should be noted that in the provided example, the only header set is `-H "kbn-xsrf: true"`, nothing about application-type.

Does anyone have an idea of how to fix this 415 issue?

---

<div class="post-metadata">

**Author:** ![bhavyarm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bhavyarm/32/22392_2.png) [@bhavyarm](https://discuss.elastic.co/u/bhavyarm)\
**Post date:** [March 9, 2021, 7:37pm UTC](https://discuss.elastic.co/t/problem-posting-to-kibana-shared-objects-api/266595/2 "2021-03-09T19:37:06Z")

</div>

Hello,

So this import command worked for me:

```auto
curl -X POST "localhost:5601/api/saved_objects/_import?createNewCopies=true" -H "kbn-xsrf: true" --form file=@dashboard.ndjson -H 'kbn-xsrf: true'

```

dashboard.ndjson is the .ndjson file I am trying to import.

Thanks,  
Bhavya

---

<div class="post-metadata">

**Author:** ![bhavyarm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bhavyarm/32/22392_2.png) [@bhavyarm](https://discuss.elastic.co/u/bhavyarm)\
**Post date:** [March 9, 2021, 7:39pm UTC](https://discuss.elastic.co/t/problem-posting-to-kibana-shared-objects-api/266595/3 "2021-03-09T19:39:08Z")

</div>

Please note there is a bug on the docs where copying as curl command is not working - [[doc] Curl command is not exported correctly from Saved Objects API · Issue #76774 · elastic/kibana · GitHub](https://github.com/elastic/kibana/issues/76774)

Thanks  
Bhavya

---

<div class="post-metadata">

**Author:** ![brett.b](https://avatars.discourse-cdn.com/v4/letter/b/ce73a5/32.png) [@brett.b](https://discuss.elastic.co/u/brett.b)\
**Post date:** [March 12, 2021, 7:00pm UTC](https://discuss.elastic.co/t/problem-posting-to-kibana-shared-objects-api/266595/4 "2021-03-12T19:00:38Z")

</div>

Thank you for replying. That still didn't work for me, so I just decided to use the Dashboard API instead.

---

<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:** [April 9, 2021, 7:01pm UTC](https://discuss.elastic.co/t/problem-posting-to-kibana-shared-objects-api/266595/5 "2021-04-09T19:01:20Z")

</div>

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