# Elastic api is not working in elk6

**URL:** <https://discuss.elastic.co/t/elastic-api-is-not-working-in-elk6/248751>\
**Category:** Elasticsearch\
**Created:** [September 16, 2020, 12:09am UTC](https://discuss.elastic.co/t/elastic-api-is-not-working-in-elk6/248751 "2020-09-16T00:09:38Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![rajkumar.m](https://avatars.discourse-cdn.com/v4/letter/r/e9bcb4/32.png) [@rajkumar.m](https://discuss.elastic.co/u/rajkumar.m)\
**Post date:** [September 16, 2020, 12:09am UTC](https://discuss.elastic.co/t/elastic-api-is-not-working-in-elk6/248751/1 "2020-09-16T00:09:38Z")

</div>

Hi Team,

I am unable to create search by using elastic API,  
the same thing is wokring on ELK5 but not working in ELK6.  
Please help.

Please find the below command & error:

curl -H 'Authorization:Basic XXXXXXXXXX' -H 'Content-Type: application/json' --cacer XXXX.pem -s -XPOST [https://XXXXXXXXXX:9200/.kibana/search/XXXXXXXXXXXX](https://XXXXXXXXXX:9200/.kibana/search/XXXXXXXXXXXX) -d '{"title" : "xxxxxxxxxxxxxxxxx","description" : "XXXXXXXX","hits" : 0,"columns" : ["\_source"],"sort" : ["\_score", "desc"],"version" : 1,"kibanaSavedObjectMeta" : {"searchSourceJSON" : "{"index":"\*\*\*\*\*\*\*\*\*_","query":{"query\_string":{"query":"\"XXXXXXXXXXX\" AND \"XXXXXXXXXX\"","analyze\_wildcard":true}},"filter":[],"highlight":{"pre\_tags":["@kibana-highlighted-field@"],"post\_tags":["@/kibana-highlighted-field@"],"fields":{"_":{}},"require\_field\_match":false,"fragment\_size":2147483647}}"} } '

Error:  
{"error":{"root\_cause":[{"type":"illegal\_argument\_exception","reason":"Rejecting mapping update to [.kibana\_1] as the final mapping would have more than 1 type: [search, doc]"}],"type":"illegal\_argument\_exception","reason":"Rejecting mapping update to [.kibana\_1] as the final mapping would have more than 1 type: [search, doc]"},"status":400}

---

<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:** [September 16, 2020, 12:21am UTC](https://discuss.elastic.co/t/elastic-api-is-not-working-in-elk6/248751/2 "2020-09-16T00:21:48Z")

</div>

Just to understand what you are doing here, are you uploading a new saved search?

---

<div class="post-metadata">

**Author:** ![rajkumar.m](https://avatars.discourse-cdn.com/v4/letter/r/e9bcb4/32.png) [@rajkumar.m](https://discuss.elastic.co/u/rajkumar.m)\
**Post date:** [September 16, 2020, 12:51am UTC](https://discuss.elastic.co/t/elastic-api-is-not-working-in-elk6/248751/3 "2020-09-16T00:51:21Z")

</div>

Thanks Mark for quick response,

Yes, I was trying to upload the json of search.  
but the same format which I had used it for ELK5 was working.

---

<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:** [September 16, 2020, 12:56am UTC](https://discuss.elastic.co/t/elastic-api-is-not-working-in-elk6/248751/4 "2020-09-16T00:56:24Z")

</div>

Ok, that format is not correct.

You might want to look at the format of a saved search in the newer version and reformat your document.

---

<div class="post-metadata">

**Author:** ![rajkumar.m](https://avatars.discourse-cdn.com/v4/letter/r/e9bcb4/32.png) [@rajkumar.m](https://discuss.elastic.co/u/rajkumar.m)\
**Post date:** [September 16, 2020, 4:30pm UTC](https://discuss.elastic.co/t/elastic-api-is-not-working-in-elk6/248751/5 "2020-09-16T16:30:58Z")

</div>

I just downloaded the same search from ELK5 and ELK6, both are same.  
I have tested by downloading from ELK5 and uploading directly using import into ELK6, it's working fine.  
I am facing issue only when I use curl an upload in ELK6.

Please advise on the error:  
{"error":{"root\_cause":[{"type":"illegal\_argument\_exception","reason":"Rejecting mapping update to [.kibana\_1] as the final mapping would have more than 1 type: [search, doc]"}],"type":"illegal\_argument\_exception","reason":"Rejecting mapping update to [.kibana\_1] as the final mapping would have more than 1 type: [search, doc]"},"status":400}

---

<div class="post-metadata">

**Author:** ![rajkumar.m](https://avatars.discourse-cdn.com/v4/letter/r/e9bcb4/32.png) [@rajkumar.m](https://discuss.elastic.co/u/rajkumar.m)\
**Post date:** [October 1, 2020, 2:26pm UTC](https://discuss.elastic.co/t/elastic-api-is-not-working-in-elk6/248751/6 "2020-10-01T14:26:49Z")

</div>

I have used kibana saved objects API for creating dashboards and its working.

> **[Saved Objects API | Kibana Guide \[6.8\] | Elastic](https://www.elastic.co/guide/en/kibana/6.8/saved-objects-api.html)**

---

<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:** [October 29, 2020, 2:26pm UTC](https://discuss.elastic.co/t/elastic-api-is-not-working-in-elk6/248751/7 "2020-10-29T14:26:52Z")

</div>

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