From dd49f0a9c6a1c93ecd399d456f64ef5e9f2e084a Mon Sep 17 00:00:00 2001 From: Florent LB Date: Thu, 2 Apr 2026 17:31:18 +0200 Subject: [PATCH 1/9] Add create-programmatically.md for Dashboards and Lens APIs --- .../dashboards/create-programmatically.md | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 explore-analyze/dashboards/create-programmatically.md diff --git a/explore-analyze/dashboards/create-programmatically.md b/explore-analyze/dashboards/create-programmatically.md new file mode 100644 index 0000000000..528c86f0a2 --- /dev/null +++ b/explore-analyze/dashboards/create-programmatically.md @@ -0,0 +1,41 @@ +--- +description: Use the Dashboards API, the Lens Visualizations API, or AI-powered tools to create and manage Kibana dashboards and visualizations programmatically. +applies_to: + stack: ga + serverless: ga +products: + - id: kibana +navigation_title: "Create programmatically" +--- + +# Create dashboards and visualizations programmatically [create-programmatically] + +You can create and manage {{product.kibana}} dashboards and visualizations outside the UI using APIs or AI-powered tools. This is useful for automation workflows, GitOps pipelines, version-controlled dashboard definitions, and LLM-assisted generation. + +## Dashboards API [programmatic-dashboards-api] + +{applies_to}`stack: preview 9.4` {applies_to}`serverless: preview` + +The Dashboards API lets you create, retrieve, update, and delete dashboards programmatically using standard HTTP requests. Use it to build dashboards from code, integrate dashboard management into CI/CD pipelines, or generate dashboards from templates. + +Refer to the [Dashboards API reference](https://www.elastic.co/docs/api/doc/kibana/group/endpoint-dashboards) for the full schema and available endpoints. + +## Lens Visualizations API [programmatic-lens-api] + +{applies_to}`stack: preview 9.4` {applies_to}`serverless: preview` + +The Lens Visualizations API lets you create and manage reusable Lens visualizations independently of any dashboard. Use it to build a library of visualizations that can be shared across dashboards or updated centrally. + +Refer to the [Lens Visualizations API reference](https://www.elastic.co/docs/api/doc/kibana/group/endpoint-lens) for the full schema and available endpoints. + +## Agent skill for dashboards [programmatic-agent-skill] + +The kibana-dashboards agent skill enables LLM-driven workflows that create and manage dashboards through natural language. It exposes the Dashboards API as a callable skill for AI agents, making it straightforward to integrate dashboard automation into larger AI-powered pipelines. + +Refer to the [kibana-dashboards agent skill](https://github.com/elastic/agent-skills/tree/main/skills/kibana/kibana-dashboards) on GitHub for setup instructions and usage examples. + +## Agent Builder dashboard tools [programmatic-agent-builder-tools] + +{applies_to}`stack: preview 9.4` {applies_to}`serverless: preview` + +The Agent Builder includes built-in dashboard tools (`dashboard.create_dashboard` and `dashboard.update_dashboard`) that let you create and update dashboards through Elastic's AI assistant without leaving the chat interface. These tools are in tech preview and are tracked at [elastic/kibana#237795](https://github.com/elastic/kibana/issues/237795). From 083b3544b693c2a705607e73a64c73b211571b74 Mon Sep 17 00:00:00 2001 From: Florent LB Date: Thu, 2 Apr 2026 17:32:18 +0200 Subject: [PATCH 2/9] Add programmatic creation section to building.md --- explore-analyze/dashboards/building.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/explore-analyze/dashboards/building.md b/explore-analyze/dashboards/building.md index 53bd774094..fb381a8b19 100644 --- a/explore-analyze/dashboards/building.md +++ b/explore-analyze/dashboards/building.md @@ -31,3 +31,7 @@ To create or edit dashboards, you need: :::: * Sufficient privileges for the **Dashboard** feature. Without them, you might get a read-only indicator. A {{product.kibana}} administrator can [grant you the required privileges](../../deploy-manage/users-roles/cluster-or-deployment-auth/kibana-privileges.md). + +## Create dashboards programmatically [building-programmatic] + +In addition to building dashboards in the {{product.kibana}} UI, you can create and manage dashboards and visualizations using APIs or AI-powered tools. Refer to [Create dashboards and visualizations programmatically](create-programmatically.md). From cfd16545f71b11bfb8ddd6e0b07480e7ba9903df Mon Sep 17 00:00:00 2001 From: Florent LB Date: Thu, 2 Apr 2026 17:33:31 +0200 Subject: [PATCH 3/9] Add API dropdown to create-dashboard.md --- .../dashboards/create-dashboard.md | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/explore-analyze/dashboards/create-dashboard.md b/explore-analyze/dashboards/create-dashboard.md index d4b1e15098..cc8086df69 100644 --- a/explore-analyze/dashboards/create-dashboard.md +++ b/explore-analyze/dashboards/create-dashboard.md @@ -31,6 +31,25 @@ Before creating a dashboard, ensure you have: When you create a dashboard, you are automatically in edit mode and can make changes to the dashboard. +::::{dropdown} Create a dashboard using the API +:applies_to: stack: preview 9.4, serverless: preview + +Use `POST /api/dashboards` to create an empty dashboard, or include panels inline: + +```bash +curl -X POST "${KIBANA_URL}/api/dashboards" \ + -H "Authorization: ApiKey ${API_KEY}" \ + -H "kbn-xsrf: true" \ + -H "Content-Type: application/json" \ + -d '{ + "title": "Web logs overview", + "time_range": { "from": "now-90d", "to": "now" } +}' +``` + +Refer to the [Dashboards API reference](https://www.elastic.co/docs/api/doc/kibana/group/endpoint-dashboards) for the full schema, including how to add panels and controls. +:::: + 3. Populate your dashboard with the content that you need. You can: * [**Add new visualizations**](../visualize.md#panels-editors). Create a chart using [Lens](../visualize/lens.md), the default visualization editor in {{product.kibana}}, or other visualizations such as [Maps](../visualize/maps.md). @@ -42,7 +61,7 @@ Before creating a dashboard, ensure you have: 5. Define the main settings of your dashboard from the **Settings** menu located in the toolbar. 1. A meaningful title, description, and [tags](../find-and-organize/tags.md) allow you to find the dashboard quickly later when browsing your list of dashboards or using the {{kib}} search bar. - 2. Additional display options allow you unify the look and feel of the dashboard’s panels: + 2. Additional display options allow you unify the look and feel of the dashboard's panels: * **Store time with dashboard** — Saves the specified time filter. * **Use margins between panels** — Adds a margin of space between each panel. @@ -71,4 +90,3 @@ Before creating a dashboard, ensure you have: :::{include} ../_snippets/dashboard-ownership.md ::: - From 9c357a38bd695250b2184229056070c29b22a480 Mon Sep 17 00:00:00 2001 From: Florent LB Date: Thu, 2 Apr 2026 17:39:52 +0200 Subject: [PATCH 4/9] Update create-programmatically.md with specified content --- .../dashboards/create-programmatically.md | 42 ++++++++++++------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/explore-analyze/dashboards/create-programmatically.md b/explore-analyze/dashboards/create-programmatically.md index 528c86f0a2..0860e1c01d 100644 --- a/explore-analyze/dashboards/create-programmatically.md +++ b/explore-analyze/dashboards/create-programmatically.md @@ -5,37 +5,47 @@ applies_to: serverless: ga products: - id: kibana -navigation_title: "Create programmatically" --- # Create dashboards and visualizations programmatically [create-programmatically] -You can create and manage {{product.kibana}} dashboards and visualizations outside the UI using APIs or AI-powered tools. This is useful for automation workflows, GitOps pipelines, version-controlled dashboard definitions, and LLM-assisted generation. +You can create and manage Kibana dashboards and visualizations outside of the UI, using REST APIs or AI-powered tools. This is useful for automating dashboard deployments, managing them in version control, building tooling around dashboard lifecycle management, or using AI agents to generate dashboards on demand. -## Dashboards API [programmatic-dashboards-api] +## Dashboards API [dashboards-api] -{applies_to}`stack: preview 9.4` {applies_to}`serverless: preview` +```{applies_to} +stack: preview 9.4 +serverless: preview +``` -The Dashboards API lets you create, retrieve, update, and delete dashboards programmatically using standard HTTP requests. Use it to build dashboards from code, integrate dashboard management into CI/CD pipelines, or generate dashboards from templates. +The Dashboards API provides full CRUD access to dashboards, including their panels, controls, sections, and display options. Use it to create dashboards from code, update them programmatically, or integrate dashboard management into your own tooling. -Refer to the [Dashboards API reference](https://www.elastic.co/docs/api/doc/kibana/group/endpoint-dashboards) for the full schema and available endpoints. +Refer to the [Dashboards API reference](https://www.elastic.co/docs/api/doc/kibana/group/endpoint-dashboards). -## Lens Visualizations API [programmatic-lens-api] +## Lens Visualizations API [lens-visualizations-api] -{applies_to}`stack: preview 9.4` {applies_to}`serverless: preview` +```{applies_to} +stack: preview 9.4 +serverless: preview +``` -The Lens Visualizations API lets you create and manage reusable Lens visualizations independently of any dashboard. Use it to build a library of visualizations that can be shared across dashboards or updated centrally. +The Lens Visualizations API lets you create and manage reusable Lens visualizations as saved objects. Once created, a visualization can be embedded in a dashboard by reference. Use it to build a library of reusable charts and metrics that can be shared across multiple dashboards. -Refer to the [Lens Visualizations API reference](https://www.elastic.co/docs/api/doc/kibana/group/endpoint-lens) for the full schema and available endpoints. +Refer to the [Lens Visualizations API reference](https://www.elastic.co/docs/api/doc/kibana/group/endpoint-lens). -## Agent skill for dashboards [programmatic-agent-skill] +## Kibana dashboards agent skill [dashboards-agent-skill] -The kibana-dashboards agent skill enables LLM-driven workflows that create and manage dashboards through natural language. It exposes the Dashboards API as a callable skill for AI agents, making it straightforward to integrate dashboard automation into larger AI-powered pipelines. +The Kibana dashboards agent skill enables AI agents and LLM-powered tools to create and manage dashboards through natural language instructions. It is designed for agentic workflows where a language model generates dashboard definitions that are then applied automatically. -Refer to the [kibana-dashboards agent skill](https://github.com/elastic/agent-skills/tree/main/skills/kibana/kibana-dashboards) on GitHub for setup instructions and usage examples. +Refer to the [kibana-dashboards agent skill](https://github.com/elastic/agent-skills/tree/main/skills/kibana/kibana-dashboards) on GitHub. -## Agent Builder dashboard tools [programmatic-agent-builder-tools] +## Agent Builder dashboard tools [agent-builder-dashboard-tools] -{applies_to}`stack: preview 9.4` {applies_to}`serverless: preview` +```{applies_to} +stack: preview 9.4 +serverless: preview +``` -The Agent Builder includes built-in dashboard tools (`dashboard.create_dashboard` and `dashboard.update_dashboard`) that let you create and update dashboards through Elastic's AI assistant without leaving the chat interface. These tools are in tech preview and are tracked at [elastic/kibana#237795](https://github.com/elastic/kibana/issues/237795). +Elastic's built-in AI assistant includes dashboard tools that let you create and update dashboards through a chat interface, without leaving the Kibana UI. Describe what you want to build, and the assistant generates the dashboard for you. + +Refer to [Agent Builder](../ai-features/agent-builder/overview.md) for an overview of the available built-in tools. From 6d627931dbec497ba18661ba62d2ffa39c011cb1 Mon Sep 17 00:00:00 2001 From: Florent LB Date: Thu, 2 Apr 2026 17:40:35 +0200 Subject: [PATCH 5/9] Update create-dashboard.md: move API dropdown after agent-skill block --- .../dashboards/create-dashboard.md | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/explore-analyze/dashboards/create-dashboard.md b/explore-analyze/dashboards/create-dashboard.md index cc8086df69..cbd3227d6a 100644 --- a/explore-analyze/dashboards/create-dashboard.md +++ b/explore-analyze/dashboards/create-dashboard.md @@ -17,24 +17,10 @@ Create a new dashboard in {{product.kibana}} to start visualizing and monitoring :url: https://github.com/elastic/agent-skills/tree/main/skills/kibana/kibana-dashboards ::: -## Requirements [create-dashboard-requirements] - -Before creating a dashboard, ensure you have: - -* [Data indexed into {{product.elasticsearch}}](/manage-data/ingest.md) and at least one [data view](../find-and-organize/data-views.md) configured -* **All** privilege for the **Dashboard** feature in {{product.kibana}} - -## Create a new dashboard [create-dashboard-steps] - -1. Open the **Dashboards** page in {{product.kibana}}. -2. Select **Create dashboard** to start with an empty dashboard. - - When you create a dashboard, you are automatically in edit mode and can make changes to the dashboard. - ::::{dropdown} Create a dashboard using the API -:applies_to: stack: preview 9.4, serverless: preview +:applies_to: { stack: preview 9.4, serverless: preview } -Use `POST /api/dashboards` to create an empty dashboard, or include panels inline: +Use `POST /api/dashboards` to create a dashboard programmatically. You can create an empty dashboard or include panels inline: ```bash curl -X POST "${KIBANA_URL}/api/dashboards" \ @@ -47,9 +33,23 @@ curl -X POST "${KIBANA_URL}/api/dashboards" \ }' ``` -Refer to the [Dashboards API reference](https://www.elastic.co/docs/api/doc/kibana/group/endpoint-dashboards) for the full schema, including how to add panels and controls. +Refer to the [Dashboards API reference](https://www.elastic.co/docs/api/doc/kibana/group/endpoint-dashboards) for the full request schema, including how to add panels and controls. :::: +## Requirements [create-dashboard-requirements] + +Before creating a dashboard, ensure you have: + +* [Data indexed into {{product.elasticsearch}}](/manage-data/ingest.md) and at least one [data view](../find-and-organize/data-views.md) configured +* **All** privilege for the **Dashboard** feature in {{product.kibana}} + +## Create a new dashboard [create-dashboard-steps] + +1. Open the **Dashboards** page in {{product.kibana}}. +2. Select **Create dashboard** to start with an empty dashboard. + + When you create a dashboard, you are automatically in edit mode and can make changes to the dashboard. + 3. Populate your dashboard with the content that you need. You can: * [**Add new visualizations**](../visualize.md#panels-editors). Create a chart using [Lens](../visualize/lens.md), the default visualization editor in {{product.kibana}}, or other visualizations such as [Maps](../visualize/maps.md). From 8181feef996147dc6dad2d5a1e7b2be4e6f13747 Mon Sep 17 00:00:00 2001 From: Florent LB Date: Thu, 2 Apr 2026 17:42:08 +0200 Subject: [PATCH 6/9] Add create-programmatically.md to toc.yml --- explore-analyze/toc.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/explore-analyze/toc.yml b/explore-analyze/toc.yml index 31c9626fac..8239dbc312 100644 --- a/explore-analyze/toc.yml +++ b/explore-analyze/toc.yml @@ -261,6 +261,7 @@ toc: - file: dashboards/building.md children: - file: dashboards/create-dashboard.md + - file: dashboards/create-programmatically.md - file: dashboards/open-dashboard.md - file: dashboards/add-controls.md - file: dashboards/drilldowns.md From 78134304d6e362284505bfddbf8d0b4a15801276 Mon Sep 17 00:00:00 2001 From: Florent LB Date: Thu, 2 Apr 2026 17:43:19 +0200 Subject: [PATCH 7/9] Add API section and forward link to learning tutorial (Step 3) --- ...bana-data-exploration-learning-tutorial.md | 110 +++++++++++++++++- 1 file changed, 109 insertions(+), 1 deletion(-) diff --git a/explore-analyze/kibana-data-exploration-learning-tutorial.md b/explore-analyze/kibana-data-exploration-learning-tutorial.md index 1f2fdf4316..25fec9e91c 100644 --- a/explore-analyze/kibana-data-exploration-learning-tutorial.md +++ b/explore-analyze/kibana-data-exploration-learning-tutorial.md @@ -160,7 +160,7 @@ You've queried, filtered, aggregated, and inspected data, all within Discover us ## Step 3: Build your dashboard [build-your-dashboard] -Now that you have a dashboard with your first panel, add more visualizations to tell a complete story about your web traffic. +Now that you have a dashboard with your first panel, add more visualizations to tell a complete story about your web traffic. You can also [recreate this dashboard using the API](#learn-tutorial-create-programmatically) once you have completed the tutorial. ::::::{stepper} @@ -372,6 +372,114 @@ When you are happy with the layout, select **Save** in the toolbar. :::::: +### Create this dashboard using the API [learn-tutorial-create-programmatically] + +::::{dropdown} Recreate the Web logs overview dashboard with one API call +:applies_to: { stack: preview 9.4, serverless: preview } + +Once you know what the finished dashboard looks like, you can create it programmatically using the Dashboards API. The following request creates the full dashboard built in this tutorial. + +```bash +curl -X POST "${KIBANA_URL}/api/dashboards" \ + -H "Authorization: ApiKey ${API_KEY}" \ + -H "kbn-xsrf: true" \ + -H "Content-Type: application/json" \ + -d '{ + "title": "Web logs overview", + "time_range": { "from": "now-90d", "to": "now" }, + "panels": [ + { + "type": "lens", + "grid": { "x": 0, "y": 0, "w": 12, "h": 5 }, + "config": { + "attributes": { + "title": "Median response size", + "type": "metric", + "dataset": { "type": "index", "index": "kibana_sample_data_logs", "time_field": "@timestamp" }, + "metrics": [{ "type": "primary", "operation": "median", "field": "bytes", "format": { "type": "bytes" } }] + } + } + }, + { + "type": "lens", + "grid": { "x": 0, "y": 5, "w": 48, "h": 12 }, + "config": { + "attributes": { + "title": "Log volume over time per host", + "type": "xy", + "layers": [{ + "type": "line", + "dataset": { "type": "index", "index": "kibana_sample_data_logs", "time_field": "@timestamp" }, + "x": { "operation": "date_histogram", "field": "@timestamp" }, + "y": [{ "operation": "count" }], + "breakdown": { "operation": "terms", "fields": ["host.keyword"], "size": 10 } + }] + } + } + }, + { + "type": "lens", + "grid": { "x": 0, "y": 17, "w": 24, "h": 10 }, + "config": { + "attributes": { + "title": "Requests by file extension", + "type": "xy", + "layers": [{ + "type": "bar", + "dataset": { "type": "index", "index": "kibana_sample_data_logs", "time_field": "@timestamp" }, + "x": { "operation": "terms", "fields": ["extension.keyword"], "size": 10 }, + "y": [{ "operation": "count" }] + }] + } + } + }, + { + "type": "lens", + "grid": { "x": 24, "y": 17, "w": 24, "h": 10 }, + "config": { + "attributes": { + "title": "Events by response code", + "type": "xy", + "layers": [{ + "type": "bar", + "dataset": { + "type": "esql", + "query": "FROM kibana_sample_data_logs | WHERE response IS NOT NULL | STATS event_count = COUNT(*) BY response" + }, + "x": { "operation": "value", "column": "response" }, + "y": [{ "operation": "value", "column": "event_count" }] + }] + } + } + }, + { + "type": "lens", + "grid": { "x": 0, "y": 27, "w": 48, "h": 12 }, + "config": { + "attributes": { + "title": "", + "type": "datatable", + "dataset": { + "type": "esql", + "query": "FROM kibana_sample_data_logs | KEEP @timestamp, request, response, bytes | SORT @timestamp DESC | LIMIT 100" + }, + "metrics": [ + { "operation": "value", "column": "@timestamp" }, + { "operation": "value", "column": "request" }, + { "operation": "value", "column": "response" }, + { "operation": "value", "column": "bytes" } + ], + "rows": [] + } + } + } + ] +}' +``` + +Refer to the [Dashboards API reference](https://www.elastic.co/docs/api/doc/kibana/group/endpoint-dashboards) for the full schema. +:::: + Your dashboard now combines multiple panel types built with Lens, and you've seen how inline editing and interactive filtering make the dashboard both customizable and interactive. To learn more, refer to [Dashboards](dashboards.md), [Lens](visualize/lens.md), and [Panels and visualizations](visualize.md). ## Step 4: Share the dashboard [share-the-dashboard] From 08271e537db94c63a7467d9dc8bc8cf9c5ff4da9 Mon Sep 17 00:00:00 2001 From: Florent LB Date: Thu, 2 Apr 2026 18:29:10 +0200 Subject: [PATCH 8/9] Fix broken link: agent-builder/overview.md -> elastic-agent-builder.md --- explore-analyze/dashboards/create-programmatically.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/explore-analyze/dashboards/create-programmatically.md b/explore-analyze/dashboards/create-programmatically.md index 0860e1c01d..b3035267be 100644 --- a/explore-analyze/dashboards/create-programmatically.md +++ b/explore-analyze/dashboards/create-programmatically.md @@ -48,4 +48,4 @@ serverless: preview Elastic's built-in AI assistant includes dashboard tools that let you create and update dashboards through a chat interface, without leaving the Kibana UI. Describe what you want to build, and the assistant generates the dashboard for you. -Refer to [Agent Builder](../ai-features/agent-builder/overview.md) for an overview of the available built-in tools. +Refer to [Agent Builder](../ai-features/elastic-agent-builder.md) for an overview of the available built-in tools. From b746280259aec18281ede18419cb9a410598e18d Mon Sep 17 00:00:00 2001 From: Florent LB Date: Thu, 2 Apr 2026 18:45:05 +0200 Subject: [PATCH 9/9] Add missing frontmatter fields, applies_to tag, and fix passive voice --- explore-analyze/dashboards/building.md | 5 +++++ explore-analyze/dashboards/create-programmatically.md | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/explore-analyze/dashboards/building.md b/explore-analyze/dashboards/building.md index fb381a8b19..2069f67fa6 100644 --- a/explore-analyze/dashboards/building.md +++ b/explore-analyze/dashboards/building.md @@ -34,4 +34,9 @@ To create or edit dashboards, you need: ## Create dashboards programmatically [building-programmatic] +```{applies_to} +stack: preview 9.4 +serverless: preview +``` + In addition to building dashboards in the {{product.kibana}} UI, you can create and manage dashboards and visualizations using APIs or AI-powered tools. Refer to [Create dashboards and visualizations programmatically](create-programmatically.md). diff --git a/explore-analyze/dashboards/create-programmatically.md b/explore-analyze/dashboards/create-programmatically.md index b3035267be..3853d77480 100644 --- a/explore-analyze/dashboards/create-programmatically.md +++ b/explore-analyze/dashboards/create-programmatically.md @@ -1,10 +1,12 @@ --- +navigation_title: Create programmatically description: Use the Dashboards API, the Lens Visualizations API, or AI-powered tools to create and manage Kibana dashboards and visualizations programmatically. applies_to: stack: ga serverless: ga products: - id: kibana +type: overview --- # Create dashboards and visualizations programmatically [create-programmatically] @@ -35,7 +37,7 @@ Refer to the [Lens Visualizations API reference](https://www.elastic.co/docs/api ## Kibana dashboards agent skill [dashboards-agent-skill] -The Kibana dashboards agent skill enables AI agents and LLM-powered tools to create and manage dashboards through natural language instructions. It is designed for agentic workflows where a language model generates dashboard definitions that are then applied automatically. +The Kibana dashboards agent skill enables AI agents and LLM-powered tools to create and manage dashboards through natural language instructions. It is designed for agentic workflows where a language model generates dashboard definitions and applies them automatically. Refer to the [kibana-dashboards agent skill](https://github.com/elastic/agent-skills/tree/main/skills/kibana/kibana-dashboards) on GitHub.