# Unable importing json file from kibana UI

**URL:** <https://discuss.elastic.co/t/unable-importing-json-file-from-kibana-ui/175388>\
**Category:** Kibana\
**Created:** [April 4, 2019, 10:38am UTC](https://discuss.elastic.co/t/unable-importing-json-file-from-kibana-ui/175388 "2019-04-04T10:38:01Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Swati123](https://avatars.discourse-cdn.com/v4/letter/s/46a35a/32.png) [@Swati123](https://discuss.elastic.co/u/Swati123)\
**Post date:** [April 4, 2019, 10:38am UTC](https://discuss.elastic.co/t/unable-importing-json-file-from-kibana-ui/175388/1 "2019-04-04T10:38:01Z")

</div>

![kibana_invalid_json](https://us1.discourse-cdn.com/elastic/original/3X/4/3/43c4db309347cc819ec64bf3d570a2f18ee2b812.jpeg)

I am facing this issue while import json file from kibana ui (saved object -\> import) even though when I checked the json file its a invalid one checked under this [https://jsonlint.com](https://jsonlint.com).

Even I am not able to perform post curl command for this to import ,error received as :- "type":"visualization","error":{"statusCode":409,"message":"version conflict, document already exists"}},

Can anyone help on this?

---

<div class="post-metadata">

**Author:** ![mattkime](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mattkime/32/43522_2.png) [@mattkime](https://discuss.elastic.co/u/mattkime)\
**Post date:** [April 4, 2019, 8:19pm UTC](https://discuss.elastic.co/t/unable-importing-json-file-from-kibana-ui/175388/2 "2019-04-04T20:19:14Z")

</div>

What is the content of the json file? How would you like to use that data?

---

<div class="post-metadata">

**Author:** ![Swati123](https://avatars.discourse-cdn.com/v4/letter/s/46a35a/32.png) [@Swati123](https://discuss.elastic.co/u/Swati123)\
**Post date:** [April 5, 2019, 9:32am UTC](https://discuss.elastic.co/t/unable-importing-json-file-from-kibana-ui/175388/3 "2019-04-05T09:32:10Z")

</div>

@mattkime .. content is a normal collection of 5 visualizations in one dashboard and I have called the restapi to create json format and then deleted that dashboard from kibana and want to call restapi (curl command ) to import dashboard in kibana.

But while performing import api it gives me error as :  
"type":"visualization","error":{"statusCode":409,"message":"version conflict, document already exists"}},

---

<div class="post-metadata">

**Author:** ![mikecote](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mikecote/32/58549_2.png) [@mikecote](https://discuss.elastic.co/u/mikecote)\
**Post date:** [April 9, 2019, 7:53pm UTC](https://discuss.elastic.co/t/unable-importing-json-file-from-kibana-ui/175388/4 "2019-04-09T19:53:48Z")

</div>

Hi @Swati123, if you're trying to call the API to create the visualizations and dashboard, I believe you just need to add `?overwrite=true` to the query to avoid getting 409 errors.

If you're trying to use the import UI, the file to import has a different format than what the saved object APIs returns. The attributes of each object in the array are prefixed with an underscore and are named differently (ex: `_source` instead of `attributes`, etc).

Import file example for a single visualization:

```auto
[
  {
    "_id": "saved_object_connected_to_saved_search",
    "_type": "visualization",
    "_source": {
      "title": "saved object connected to saved search",
      "visState": "{\"title\":\"PHP Viz\",\"type\":\"horizontal_bar\",\"params\":{\"type\":\"histogram\",\"grid\":{\"categoryLines\":false,\"style\":{\"color\":\"#eee\"}},\"categoryAxes\":[{\"id\":\"CategoryAxis-1\",\"type\":\"category\",\"position\":\"left\",\"show\":true,\"style\":{},\"scale\":{\"type\":\"linear\"},\"labels\":{\"show\":true,\"rotate\":0,\"filter\":false,\"truncate\":200},\"title\":{}}],\"valueAxes\":[{\"id\":\"ValueAxis-1\",\"name\":\"LeftAxis-1\",\"type\":\"value\",\"position\":\"bottom\",\"show\":true,\"style\":{},\"scale\":{\"type\":\"linear\",\"mode\":\"normal\"},\"labels\":{\"show\":true,\"rotate\":75,\"filter\":true,\"truncate\":100},\"title\":{\"text\":\"Count\"}}],\"seriesParams\":[{\"show\":true,\"type\":\"histogram\",\"mode\":\"normal\",\"data\":{\"label\":\"Count\",\"id\":\"1\"},\"valueAxis\":\"ValueAxis-1\",\"drawLinesBetweenPoints\":true,\"showCircles\":true}],\"addTooltip\":true,\"addLegend\":true,\"legendPosition\":\"right\",\"times\":[],\"addTimeMarker\":false},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{}}]}",
      "uiStateJSON": "{}",
      "description": "",
      "savedSearchId": "c45e6c50-ba72-11e7-a8f9-ad70f02e633d",
      "version": 1,
      "kibanaSavedObjectMeta": {
        "searchSourceJSON": "{\"filter\":[],\"query\":{\"query\":\"\",\"language\":\"lucene\"}}"
      }
    },
    "_meta": {
      "savedObjectVersion": 2
    }
  }
]

```

---

<div class="post-metadata">

**Author:** ![Swati123](https://avatars.discourse-cdn.com/v4/letter/s/46a35a/32.png) [@Swati123](https://discuss.elastic.co/u/Swati123)\
**Post date:** [April 10, 2019, 6:37am UTC](https://discuss.elastic.co/t/unable-importing-json-file-from-kibana-ui/175388/5 "2019-04-10T06:37:26Z")

</div>

@mikecote Thanks Mike for the clarification.  
Will check both ways.

---

<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:** [May 8, 2019, 6:37am UTC](https://discuss.elastic.co/t/unable-importing-json-file-from-kibana-ui/175388/6 "2019-05-08T06:37:42Z")

</div>

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