Using Kibana REST API to generate visualization

There is no exposed API for creating dashboards, visualizations, or lens. The stored state of dashboards, visualization, and lens objects are intentionally not published or documented. These details are considered internal and change from minor too minor. You can open an issue in the Kibana repo to expose a API for creating these saved objects.

You could always brute force the issue and analyze the structure of the saved objects you want to create via and API. Just go into it knowing that your solution will be fragile and will need constant updating to work between minors.

An easy way to view the structure of saved objects is to query for them in Console. Or you could look at example saved objects from sample data.

// Query for saved objects
GET .kibana/_search
{
 "query": {
   "match": {
     "type": "dashboard"
   }
 }
}
1 Like