# Strict dynamic mapping exception when importing visualizations and dashboards to kibana via curl

**URL:** <https://discuss.elastic.co/t/strict-dynamic-mapping-exception-when-importing-visualizations-and-dashboards-to-kibana-via-curl/132152>\
**Category:** Kibana\
**Created:** [May 16, 2018, 2:31pm UTC](https://discuss.elastic.co/t/strict-dynamic-mapping-exception-when-importing-visualizations-and-dashboards-to-kibana-via-curl/132152 "2018-05-16T14:31:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![yishain11](https://avatars.discourse-cdn.com/v4/letter/y/df705f/32.png) [@yishain11](https://discuss.elastic.co/u/yishain11)\
**Post date:** [May 16, 2018, 2:31pm UTC](https://discuss.elastic.co/t/strict-dynamic-mapping-exception-when-importing-visualizations-and-dashboards-to-kibana-via-curl/132152/1 "2018-05-16T14:31:29Z")

</div>

Hi,  
After a long and painful journey, I was able to write a script that changes the index id on imported visualizations/searchs/dashboard from kibana index into one of kibana's indeces that the user wants.  
What I try to do is to send the files with the new id to kibana, using the saved\_object api, like so:  
`curl -XPOST localhost:5601/api/saved_objects/search -H 'kbn-xsrf:true' -H 'Content-type:application/json' -d @./SOME_FILE.json`

The problem:  
It works only for imported searchs. For dashboards and visualizations, I get this error:  
`{"message":"mapping set to strict, dynamic introduction of [panelsJSON] within [search] is not allowed: [strict_dynamic_mapping_exception] mapping set to strict, dynamic introduction of [panelsJSON] within [search] is not allowed","statusCode":400,"error":"Bad Request"}`  
(BTW, I talked about a similar issue in [this](https://discuss.elastic.co/t/importing-visualizations-from-different-machine/131617/4) feed, but I open here another question because it wasn't answered there, and that post was quite lengthy and the basic topic was different, so I decided to open a dedicated one).

My questions are:

1. Why dosen't it work for visualizations and dashboard but it does for searchs?
2. How to work around/solve this issue?  
It's realy frustrating that I'm so close to have a simple script that imports everything from any kibana index and to be stuck on this...

Can anyone help?

BTW 2: If anyone will find it helpful to see how my script works, I would love to share. Just message me.

Thanks!

---

<div class="post-metadata">

**Author:** ![spalger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spalger/32/14092_2.png) [@spalger](https://discuss.elastic.co/u/spalger)\
**Post date:** [May 16, 2018, 9:20pm UTC](https://discuss.elastic.co/t/strict-dynamic-mapping-exception-when-importing-visualizations-and-dashboards-to-kibana-via-curl/132152/2 "2018-05-16T21:20:50Z")

</div>

The data you are supplying must include a `panelsJSON` property, which is only valid for dashboards. Are you setting the proper type in the URL? `localhost:5601/api/saved_objects/search` would be for searches, `localhost:5601/api/saved_objects/visualization` for visualizations, and `localhost:5601/api/saved_objects/dashboard` for dashboards.

---

<div class="post-metadata">

**Author:** ![yishain11](https://avatars.discourse-cdn.com/v4/letter/y/df705f/32.png) [@yishain11](https://discuss.elastic.co/u/yishain11)\
**Post date:** [May 17, 2018, 6:54am UTC](https://discuss.elastic.co/t/strict-dynamic-mapping-exception-when-importing-visualizations-and-dashboards-to-kibana-via-curl/132152/3 "2018-05-17T06:54:26Z")

</div>

Thanks, I didn't notice my mistake. It works.

---

<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:** [June 14, 2018, 6:54am UTC](https://discuss.elastic.co/t/strict-dynamic-mapping-exception-when-importing-visualizations-and-dashboards-to-kibana-via-curl/132152/4 "2018-06-14T06:54:34Z")

</div>

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