# Creation of Kibana visualization using curl fails in version 6.1.2

**URL:** <https://discuss.elastic.co/t/creation-of-kibana-visualization-using-curl-fails-in-version-6-1-2/147681>\
**Category:** Elasticsearch\
**Created:** [September 7, 2018, 9:09am UTC](https://discuss.elastic.co/t/creation-of-kibana-visualization-using-curl-fails-in-version-6-1-2/147681 "2018-09-07T09:09:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kamleshjoshi](https://avatars.discourse-cdn.com/v4/letter/k/f14d63/32.png) [@kamleshjoshi](https://discuss.elastic.co/u/kamleshjoshi)\
**Post date:** [September 7, 2018, 9:09am UTC](https://discuss.elastic.co/t/creation-of-kibana-visualization-using-curl-fails-in-version-6-1-2/147681/1 "2018-09-07T09:09:46Z")

</div>

I am getting error while trying to create Kibana visualization using following curl:  
**Error is:**"Invalid request payload JSON format"

curl -X POST "[http://localhost:5601/api/saved-objects/visualization/my-visualization](http://localhost:5601/api/saved-objects/visualization/my-visualization)" -H 'kbn-xsrf' -H 'Content-Type : application/json' -d visualization.json

**visualization.json is :**  
{  
"attributes": {  
"title": "Event\_Name\_Source",  
"visState": "{"title":"Event\_Name\_Source","type": "pie", "params": { "type": "pie", "addTooltip": true, "addLegend": true, "legendPosition": "right","isDonut": true,"labels": {"show": false,"values": true,"last\_level": true,"truncate": 100}},"aggs": [{ "id": "1", "enabled": true, "type": "count", "schema": "metric", "params": {}}, { "id": "2", "enabled": true,"type": "terms","schema": "segment","params": {"field": "eventName","otherBucket": false,"otherBucketLabel": "Other","missingBucket": false,"missingBucketLabel": "Missing","size": 5,"order": "desc","orderBy": "1","customLabel": "Event Name"}},{"id": "3","enabled": true,"type": "terms","schema": "segment","params": {"field": "eventSource","otherBucket": false,"otherBucketLabel": "Other","missingBucket": false,"missingBucketLabel": "Missing","size": 5,"order": "desc","orderBy": "1","customLabel": "Event Source"}}]}",  
"uiStateJSON": "{}",  
"description": "",  
"version": 1,  
"kibanaSavedObjectMeta": {  
"searchSourceJSON": "{"index": "cloudtraillogs","filter": [],"query": {"query": "","language": "lucene"}}"  
}  
}

Please help with what is wrong in the above json. Is this format correct for elasticsearch version 6.1.2

---

<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 5, 2018, 9:09am UTC](https://discuss.elastic.co/t/creation-of-kibana-visualization-using-curl-fails-in-version-6-1-2/147681/2 "2018-10-05T09:09:46Z")

</div>

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