# Create and import kibana visualization using API

**URL:** <https://discuss.elastic.co/t/create-and-import-kibana-visualization-using-api/227821>\
**Category:** Kibana\
**Created:** [April 13, 2020, 8:28pm UTC](https://discuss.elastic.co/t/create-and-import-kibana-visualization-using-api/227821 "2020-04-13T20:28:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ilhem](https://avatars.discourse-cdn.com/v4/letter/i/90ced4/32.png) [@ilhem](https://discuss.elastic.co/u/ilhem)\
**Post date:** [April 13, 2020, 8:28pm UTC](https://discuss.elastic.co/t/create-and-import-kibana-visualization-using-api/227821/1 "2020-04-13T20:28:31Z")

</div>

1. I created a kibana visualization using kibana interface and i tried to import it via Postman  
GET [http://localhost:9200/.kibana/visualization/test1](http://localhost:9200/.kibana/visualization/test1)  
but i get this response  
{  
"\_index": ".kibana\_1",  
"\_type": "visualization",  
"\_id": "test1",  
"found": false  
}

2. I want to know how can I create an index patern and a kibana vizualisation using API.

---

<div class="post-metadata">

**Author:** ![rashmi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rashmi/32/16391_2.png) [@rashmi](https://discuss.elastic.co/u/rashmi)\
**Post date:** [April 13, 2020, 9:29pm UTC](https://discuss.elastic.co/t/create-and-import-kibana-visualization-using-api/227821/2 "2020-04-13T21:29:46Z")

</div>

> [@ilhem](#):
>
> dex patern and

If I understand correctly, you want to create an [Index Pattern](https://www.elastic.co/guide/en/kibana/7.6/index-patterns.html) for Kibana. An index pattern can include a wildcard to match multiple index names in Elasticsearch.

[Here is an example from the reference to create an index pattern using the REST API.](https://www.elastic.co/guide/en/kibana/current/saved-objects-api-create.html#_examples_4). In the example, the `my-pattern-*` index pattern in Kibana will match Elasticsearch indexes named `my-pattern-0` , `my-pattern-1` , `my-pattern-2` , etc.

You can also watch the API calls in your browser's developer tools as you save a visualization to see how the payload gets sent.

Importing them would be via saved objects API

> **[Import objects API | Kibana Guide \[8.11\] | Elastic](https://www.elastic.co/guide/en/kibana/current/saved-objects-api-import.html)**

thanks  
Rashmi

---

<div class="post-metadata">

**Author:** ![ilhem](https://avatars.discourse-cdn.com/v4/letter/i/90ced4/32.png) [@ilhem](https://discuss.elastic.co/u/ilhem)\
**Post date:** [April 13, 2020, 10:15pm UTC](https://discuss.elastic.co/t/create-and-import-kibana-visualization-using-api/227821/3 "2020-04-13T22:15:26Z")

</div>

thanks for your reply,  
in fact, I want to analyze the log file and generate a visualization for them. I did that manually, I mean I sent the logs via logstash and generate a curve from the data, but now I want to do it all programmatically, so I thought about API.

---

<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 11, 2020, 10:15pm UTC](https://discuss.elastic.co/t/create-and-import-kibana-visualization-using-api/227821/4 "2020-05-11T22:15:31Z")

</div>

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