# Create Index Pattern/ Visualization Programmatically

**URL:** <https://discuss.elastic.co/t/create-index-pattern-visualization-programmatically/198943>\
**Category:** Elasticsearch\
**Created:** [September 10, 2019, 5:11pm UTC](https://discuss.elastic.co/t/create-index-pattern-visualization-programmatically/198943 "2019-09-10T17:11:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![csholic](https://avatars.discourse-cdn.com/v4/letter/c/e79b87/32.png) [@csholic](https://discuss.elastic.co/u/csholic)\
**Post date:** [September 10, 2019, 5:11pm UTC](https://discuss.elastic.co/t/create-index-pattern-visualization-programmatically/198943/1 "2019-09-10T17:11:36Z")

</div>

I know how to create or delete index in a python program using:

es.indices.delete(index = fname, ignore = [400, 404])  
helpers.bulk(es, json.load(f), index = indexname, doc\_type = 'my-type')

But is there a way that I can create index pattern and visualization programmatically? Didn't find API related with index pattern or visualization.

Also how do I get the json format of index pattern and visualization? I saw there's an export button in Kibana and when I clicked it I will download a JSON file. But it seems there's difference between the format of this JSON file and the one we actually need when we are using it in a python program.

---

<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 8, 2019, 5:11pm UTC](https://discuss.elastic.co/t/create-index-pattern-visualization-programmatically/198943/2 "2019-10-08T17:11:37Z")

</div>

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