Kibana Dashboards and Visualizations APIs

Download OpenAPI specification:

Introduction

Technical preview — These APIs are available as technical preview on Elastic Cloud Serverless projects and Kibana 9.4.

Use the Kibana Dashboards and Visualizations APIs to programmatically create, retrieve, update, and delete dashboards and visualizations.

To interact with these APIs, use the following HTTP methods:

  • GET: Retrieve a resource.
  • POST: Create a new resource.
  • PUT: Replace an existing resource.
  • DELETE: Remove a resource.

You can prepend any Kibana API endpoint with kbn: and run the request in Dev Tools → Console. For example:

GET kbn:/api/dashboards

For more information about the console, refer to Run API requests.

Note - This documentation is derived from the main branch of the kibana repository and is provided under Attribution-NonCommercial-NoDerivatives 4.0 International.

Dashboards

A dashboard is a collection of panels arranged on a grid. Each panel can contain a visualization, a Discover session, an image, markdown text, or an interactive filter control. Use this API to create and manage dashboards programmatically.

When to use this API

  • Use this API to define a complete, self-contained dashboard in a single payload, including inline visualizations (both data view and ES|QL based), controls, and filters.
  • Use the Visualizations API to create reusable charts saved to your visualization library. You can then embed them in dashboards as linked panels using their ID.

Get started

Before you begin:

  • Authentication: Refer to Authentication in the Kibana API documentation.
  • CSRF protection: Write operations (POST, PUT, DELETE) require the kbn-xsrf: true header.
  • Spaces: If you use non-default Kibana spaces, prepend s/{space_id}/ to the path.

Try it now

Create your first dashboard right now. The following example creates a dashboard with an ES|QL line chart showing log entries over time. You can run it as-is once you have the Kibana sample logs dataset installed:

curl -X POST "${KIBANA_URL}/api/dashboards" \
  -H "Authorization: ApiKey ${API_KEY}" \
  -H "kbn-xsrf: true" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "My first API dashboard",
    "panels": [
      {
        "grid": {
          "x": 0,
          "y": 0,
          "w": 24,
          "h": 10
        },
        "type": "vis",
        "config": {
          "type": "xy",
          "title": "Total log entries over time",
          "layers": [
            {
              "type": "line",
              "data_source": {
                "type": "esql",
                "query": "FROM kibana_sample_data_logs | STATS count = COUNT() BY BUCKET(@timestamp, 75, ?_tstart, ?_tend)"
              },
              "x": {
                "column": "BUCKET(@timestamp, 75, ?_tstart, ?_tend)"
              },
              "y": [
                {
                  "column": "count"
                }
              ]
            }
          ],
          "axis": {
            "x": {
              "title": {
                "visible": false
              }
            }
          }
        }
      }
    ]
  }'

All examples on this page use Kibana sample datasets (kibana_sample_data_logs, kibana_sample_data_ecommerce, kibana_sample_data_flights). To use your own data, replace the FROM pattern and field references.

Dashboard structure

A dashboard is structured as follows:

  • title (required): the display name of the dashboard.

  • panels: array of items placed on a 48-column grid. Each item has a type, a grid position (x, y, w, h), and a config. Two item shapes are supported:

    • Panel: any content type, including visualizations, Discover sessions, images, markdown, and filter controls. The type field determines the panel's content and the structure of its config.
    • Section: a collapsible group of panels. Use sections to organize a large dashboard into logical groups. A section has a grid.y position and its own nested panels array.

    The grid is 48 columns wide. Use w: 48 for a full-width panel, w: 24 for half-width, and so on. Height (h) and vertical position (y) are in grid rows with no fixed maximum.

  • pinned_panels: filter controls pinned at the top of the dashboard that apply to all panels. Filter controls placed in panels apply only to panels in the same section.

  • filters, query, time_range: filter the data displayed across all panels.

Panel types

The type field in each panel determines what it contains and the structure of its config:

Type Description
vis Visualization (bar, line, metric, and so on), supports both data view and ES|QL queries
discover_session Discover session
image Image
markdown Markdown text
esql_control ES|QL variable control
options_list_control Dropdown filter by field value
range_slider_control Slider filter by numeric range
time_slider_control Time range slider

Additional panel types for observability use cases:

Type Description
slo_alerts SLO alerts
slo_burn_rate SLO burn rate
slo_error_budget SLO error budget
slo_overview SLO overview
synthetics_monitors Synthetics monitors
synthetics_stats_overview Synthetics stats overview

info The following panel types are supported in the Kibana UI but not yet by the REST API: map, legacy_vis, links, field_stats_table, aiops_change_point_chart, aiops_log_rate_analysis, aiops_pattern_analysis. Write operations (POST, PUT) return a 400 error when these panel types are included. Read operations (GET) strip these panels from the response and include them in a list of warnings.

Embedding library items

vis, discover_session, and markdown panels can be embedded inline (full config stored in the dashboard) or linked from library (references a library item by ID).

For the full config schema for visualization panels, including chart types, metric operations, and breakdowns, refer to the Visualizations API.

  • Inline: use when the panel is specific to this dashboard or must work across Kibana spaces. The panel configuration goes directly inside config:

    {
      "grid": {
        "x": 0,
        "y": 0,
        "w": 12,
        "h": 8
      },
      "type": "vis",
      "config": {
        "type": "metric",
        "title": "Average bytes",
        "data_source": {
          "type": "data_view_spec",
          "index_pattern": "kibana_sample_data_logs",
          "time_field": "timestamp"
        },
        "metrics": [
          {
            "type": "primary",
            "operation": "average",
            "field": "bytes"
          }
        ]
      }
    }
    
  • Linked from library: references an item in your library by its ID. Use ref_id with any supported panel type (vis, discover_session, markdown). Use the Visualizations API to create and retrieve IDs for visualization items.

    {
      "grid": {
        "x": 0,
        "y": 0,
        "w": 12,
        "h": 8
      },
      "type": "vis",
      "config": {
        "ref_id": "1e4f0a30-b3c5-11ef-bd7a-2b6b1a8c0f3d"
      }
    }
    

ES|QL visualizations

To create ES|QL-based charts, embed them inline as vis panels and set data_source.type to "esql".

  • metric charts: reference query result columns in metrics using column:

    {
      "grid": {
        "x": 0,
        "y": 0,
        "w": 12,
        "h": 6
      },
      "type": "vis",
      "config": {
        "type": "metric",
        "title": "Total requests",
        "data_source": {
          "type": "esql",
          "query": "FROM logs-* | STATS count = COUNT()"
        },
        "metrics": [
          {
            "type": "primary",
            "column": "count"
          }
        ]
      }
    }
    
  • xy charts: data_source goes inside each layer. Use BUCKET(@timestamp, 75, ?_tstart, ?_tend) to align time-series buckets with the dashboard's selected time range. For a complete xy chart example, see the Create a dashboard endpoint.

Search dashboards

Spaces method and path for this operation:

get /s/{space_id}/api/dashboards

Refer to Spaces for more information.

Returns a paginated list of dashboards. Each result includes title, description, tags, and metadata, but not the full panel layout. Use GET /api/dashboards/{id} to retrieve the complete state.

Authorizations:
apiKeyAuthbasicAuth
query Parameters
page
number

The page of results to return. Defaults to 1.

per_page
number

The number of results to return per page. Defaults to 20.

query
string

Filters results by title and description using Elasticsearch simple_query_string syntax. Multi-word terms require all words to match.

tags
Array of strings <= 100 items

A tag ID to include. Accepts a single tag ID or multiple tag IDs. When multiple are specified, dashboards matching any of the tag IDs are included.

excluded_tags
Array of strings <= 100 items

A tag ID to exclude. Accepts a single tag ID or multiple tag IDs. When multiple are specified, dashboards matching any of the tag IDs are excluded.

Responses

Request samples

curl -X GET "${KIBANA_URL}/api/dashboards?query=web+logs&per_page=10" \
  -H "Authorization: ApiKey ${API_KEY}"

Response samples

Content type
application/json

Paginated list of dashboard summaries. Each item includes the ID, a subset of dashboard state fields (title, time_range if set), and metadata. Full panel content is not included — use the GET endpoint to retrieve a specific dashboard.

{
  • "dashboards": [
    ],
  • "page": 1,
  • "total": 2
}

Create a dashboard

Spaces method and path for this operation:

post /s/{space_id}/api/dashboards

Refer to Spaces for more information.

Creates a new dashboard and returns its ID, full state, and metadata.

Authorizations:
apiKeyAuthbasicAuth
header Parameters
kbn-xsrf
required
string
Example: true

A required header to protect against CSRF attacks

Request Body schema: application/json
object (Access control)

Access control settings for the dashboard.

description
string

A short description of the dashboard.

Array of condition (object) or group (object) or dsl (object) or spatial (object) <= 500 items

Filters applied across all panels, including pinned panels.

object (Options)
Default: {"auto_apply_filters":true,"hide_panel_borders":false,"hide_panel_titles":false,"sync_colors":false,"sync_cursor":true,"sync_tooltips":false,"use_margins":true}

Display and behavior settings for the dashboard.

Array of (APM Service map (object) or Discover session (object) or ES|QL variable control (object) or Image (object) or Markdown (object) or Options list control (object) or Range slider control (object) or SLO alerts (object) or SLO burn rate (object) or SLO error budget (object) or SLO overview (object) or Synthetics monitors (object) or Synthetics stats overview (object) or Time slider control (object) or Visualization (object)) or Section (object) <= 100 items
Default: []

Panels and sections in the dashboard. Each entry is either a panel (with a type and config) or a collapsible section (with a title, collapsed state, and nested panels).

Array of any <= 100 items
Default: []

An array of control panels and their state in the control group.

project_routing
string

Controls cross-project search behavior for this dashboard (Serverless only). Set to _alias:_origin to scope data to the current project, or _alias:* to search across all projects. When omitted, the space default applies.

object (Query)

A search query consisting of an expression and its language. Supports KQL and Lucene syntax.

object (Refresh interval)

Specifies the auto-refresh interval for the object.

tags
Array of strings <= 100 items

Tag IDs to associate with this dashboard.

object (Time range)

Specifies the time range for a query.

title
required
string non-empty

A human-readable title for the dashboard.

Responses

Request samples

Content type
application/json
{
  • "access_control": {
    },
  • "description": "string",
  • "filters": [
    ],
  • "options": {
    },
  • "panels": [ ],
  • "pinned_panels": [ ],
  • "project_routing": "string",
  • "query": {
    },
  • "refresh_interval": {
    },
  • "tags": [
    ],
  • "time_range": {
    },
  • "title": "string"
}

Response samples

Content type
application/json

Response to creating a dashboard. Returns the generated ID, the full dashboard state in data, and metadata. Default option values are always returned even when not explicitly set in the request. Panel id values are generated automatically.

{
  • "id": "3c4b8e10-d57a-11ef-9a52-4f3c2a8d0e1b",
  • "data": {
    },
  • "meta": {
    }
}

Delete a dashboard

Spaces method and path for this operation:

delete /s/{space_id}/api/dashboards/{id}

Refer to Spaces for more information.

Permanently deletes a dashboard by ID.

Authorizations:
apiKeyAuthbasicAuth
path Parameters
id
required
string

The dashboard ID, as returned by the create or search endpoints.

header Parameters
kbn-xsrf
required
string
Example: true

A required header to protect against CSRF attacks

Responses

Request samples

curl -X DELETE "${KIBANA_URL}/api/dashboards/3c4b8e10-d57a-11ef-9a52-4f3c2a8d0e1b" \
  -H "Authorization: ApiKey ${API_KEY}" \
  -H "kbn-xsrf: true"

Get a dashboard

Spaces method and path for this operation:

get /s/{space_id}/api/dashboards/{id}

Refer to Spaces for more information.

Returns the complete state of a dashboard by ID.

Authorizations:
apiKeyAuthbasicAuth
path Parameters
id
required
string

The dashboard ID, as returned by the create or search endpoints.

Responses

Request samples

curl -X GET "${KIBANA_URL}/api/dashboards/3c4b8e10-d57a-11ef-9a52-4f3c2a8d0e1b" \
  -H "Authorization: ApiKey ${API_KEY}"

Response samples

Content type
application/json

The full dashboard state including all panels, options, and metadata.

{
  • "id": "3c4b8e10-d57a-11ef-9a52-4f3c2a8d0e1b",
  • "data": {
    },
  • "meta": {
    }
}

Upsert a dashboard

Spaces method and path for this operation:

put /s/{space_id}/api/dashboards/{id}

Refer to Spaces for more information.

Creates a new dashboard with the given ID if none exists, or replaces the complete state of an existing one.

warn This is a full replacement. Any panels not included in the request body are permanently removed. To make targeted changes, retrieve the current state first with GET /api/dashboards/{id}, apply your changes, and submit the full updated object.

Authorizations:
apiKeyAuthbasicAuth
path Parameters
id
required
string
header Parameters
kbn-xsrf
required
string
Example: true

A required header to protect against CSRF attacks

Request Body schema: application/json
description
string

A short description of the dashboard.

Array of condition (object) or group (object) or dsl (object) or spatial (object) <= 500 items

Filters applied across all panels, including pinned panels.

object (Options)
Default: {"auto_apply_filters":true,"hide_panel_borders":false,"hide_panel_titles":false,"sync_colors":false,"sync_cursor":true,"sync_tooltips":false,"use_margins":true}

Display and behavior settings for the dashboard.

Array of (APM Service map (object) or Discover session (object) or ES|QL variable control (object) or Image (object) or Markdown (object) or Options list control (object) or Range slider control (object) or SLO alerts (object) or SLO burn rate (object) or SLO error budget (object) or SLO overview (object) or Synthetics monitors (object) or Synthetics stats overview (object) or Time slider control (object) or Visualization (object)) or Section (object) <= 100 items
Default: []

Panels and sections in the dashboard. Each entry is either a panel (with a type and config) or a collapsible section (with a title, collapsed state, and nested panels).

Array of any <= 100 items
Default: []

An array of control panels and their state in the control group.

project_routing
string

Controls cross-project search behavior for this dashboard (Serverless only). Set to _alias:_origin to scope data to the current project, or _alias:* to search across all projects. When omitted, the space default applies.

object (Query)

A search query consisting of an expression and its language. Supports KQL and Lucene syntax.

object (Refresh interval)

Specifies the auto-refresh interval for the object.

tags
Array of strings <= 100 items

Tag IDs to associate with this dashboard.

object (Time range)

Specifies the time range for a query.

title
required
string non-empty

A human-readable title for the dashboard.

Responses

Request samples

Content type
application/json
{
  • "description": "string",
  • "filters": [
    ],
  • "options": {
    },
  • "panels": [ ],
  • "pinned_panels": [ ],
  • "project_routing": "string",
  • "query": {
    },
  • "refresh_interval": {
    },
  • "tags": [
    ],
  • "time_range": {
    },
  • "title": "string"
}

Response samples

Content type
application/json

The complete updated dashboard state after a full replacement. Note that meta.created_at is not returned in update responses — use the GET endpoint to retrieve it.

{
  • "id": "3c4b8e10-d57a-11ef-9a52-4f3c2a8d0e1b",
  • "data": {
    },
  • "meta": {
    }
}

Visualizations

Create, retrieve, update, and delete Kibana visualizations. Visualizations created through this API are saved to your visualization library.

When to use this API

  • Use this API to create reusable charts saved to the visualization library. You can then embed them in dashboards by referencing their ID from the Dashboards API.
  • Use the Dashboards API when you want to define a complete dashboard in one request, or when you need ES|QL-based visualizations.

Get started

Before you begin:

  • Authentication: Refer to Authentication in the Kibana API documentation.
  • CSRF protection: Write operations (POST, PUT, DELETE) require the kbn-xsrf: true header.
  • Spaces: If you use non-default Kibana spaces, prepend s/{space_id}/ to the path.

Try it now

The following example creates a line chart showing log entries over time. You can run it after installing the Kibana sample logs dataset:

curl -X POST "${KIBANA_URL}/api/visualizations" \
  -H "Authorization: ApiKey ${API_KEY}" \
  -H "kbn-xsrf: true" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "xy",
    "title": "Total log entries over time",
    "layers": [
      {
        "type": "line",
        "data_source": {
          "type": "data_view_spec",
          "index_pattern": "kibana_sample_data_logs",
          "time_field": "timestamp"
        },
        "x": {
          "operation": "date_histogram",
          "field": "timestamp"
        },
        "y": [
          {
            "operation": "count"
          }
        ]
      }
    ]
  }'

All curl examples in this reference use Kibana sample datasets (kibana_sample_data_logs, kibana_sample_data_ecommerce, kibana_sample_data_flights). To use your own data, replace the index_pattern and field names.

How a visualization is structured

Every visualization requires at minimum:

  • type: the chart to render. Each chart type has its own required fields, so the full structure of the request body depends on which type you specify.
  • data_source: how data is fetched. You can reference an existing Kibana data view by ID ("type": "data_view_reference"), define a data view inline using an index pattern ("type": "data_view_spec"), or use an ES|QL query ("type": "esql"). Note that ES|QL is only supported via the Dashboards API. For most chart types, data_source is a top-level field. For XY charts, it belongs inside each layer in layers[].

You can also include query and filters to apply KQL or Lucene filters to all chart data. Both are optional and can be omitted.

Everything else is chart-specific: layers for XY charts, metrics for metric charts, and so on. Refer to the request schema on the Create a visualization endpoint for the full shape of each type.

Chart types

The type field in the request body determines the chart type:

Type Chart Documentation
data_table Data table Table
gauge Gauge (bullet, circular) Gauge
heatmap Heat map Heat map
metric Single value metric Metric
mosaic Mosaic Mosaic
pie Pie or donut (use donut_hole to control the hole size) Pie
region_map Region map (choropleth) Region map
tag_cloud Tag cloud Tag cloud
treemap Treemap Treemap
waffle Waffle Waffle
xy Bar, line, area (and stacked/percentage variants) Bar, Line, Area

Search visualizations

Spaces method and path for this operation:

get /s/{space_id}/api/visualizations

Refer to Spaces for more information.

Returns a paginated list of Lens visualizations matching the optional query text.

Authorizations:
apiKeyAuthbasicAuth
query Parameters
fields
Array of strings
search_fields
Array of strings
query
string

Text to match against search_fields.

page
number >= 1
Default: 1

Page number.

per_page
number [ 1 .. 1000 ]
Default: 20

Results per page.

Responses

Request samples

curl -X GET "${KIBANA_URL}/api/visualizations?query=requests&per_page=10" \
  -H "Authorization: ApiKey ${API_KEY}"

Response samples

Content type
application/json

Paginated list of visualizations matching the query. Each item includes the ID, full chart configuration, and metadata. Use the GET endpoint to retrieve a single visualization by ID.

{
  • "data": [
    ],
  • "meta": {
    }
}

Create visualization

Spaces method and path for this operation:

post /s/{space_id}/api/visualizations

Refer to Spaces for more information.

Creates a Lens visualization and saves it to the library.

ES|QL visualizations cannot be created through this endpoint.

Authorizations:
apiKeyAuthbasicAuth
query Parameters
overwrite
boolean
header Parameters
kbn-xsrf
required
string
Example: true

A required header to protect against CSRF attacks

Request Body schema: application/json
Any of
Date Histogram Operation (object) or Terms Operation (object) or Histogram Operation (object) or Ranges Operation (object) or Filters Operation (object)
required
Data view reference (object) or Data view inline spec (object)
description
string
Array of dashboard_drilldown (object) or discover_drilldown (object) or url_drilldown (object) <= 100 items
Array of condition (object) or group (object) or dsl (object) or spatial (object) (lensPanelFilters) <= 100 items

Filters applied to the panel

hide_border
boolean
hide_title
boolean
ignore_global_filters
boolean
Default: false

When true, ignores global filters when fetching data for this layer. Defaults to false.

required
Array of ((Count Metric Operation (object) or Unique Count Metric Operation (object) or Stats Metric Operation (object) or Sum Metric Operation (object) or Last Value Operation (object) or Percentile Operation (object) or Percentile Ranks Operation (object)) or (Differences Operation (object) or Moving Average Operation (object) or Cumulative Sum Operation (object) or Counter Rate Operation (object)) or Formula Operation (object)) or ((Count Metric Operation (object) or Unique Count Metric Operation (object) or Stats Metric Operation (object) or Sum Metric Operation (object) or Last Value Operation (object) or Percentile Operation (object) or Percentile Ranks Operation (object)) or (Differences Operation (object) or Moving Average Operation (object) or Cumulative Sum Operation (object) or Counter Rate Operation (object)) or Formula Operation (object)) [ 1 .. 2 ] items

Metric dimensions to display. The first must be a primary metric; an optional second must be a secondary metric.

required
object (Filter)

A KQL or Lucene query that filters panel data. Applied on top of any dashboard-level filters.

Array of objects (kbn-content-management-utils-referenceSchema)
sampling
number [ 0 .. 1 ]
Default: 1

Sampling factor between 0 (no sampling) and 1 (full sampling).

object (metricStyling)

Visual chart styling options

object (Time range)

Specifies the time range for a query.

title
string
type
required
string
Value: "metric"

Responses

Request samples

Content type
application/json
Example
{
  • "breakdown_by": {
    },
  • "data_source": {
    },
  • "description": "string",
  • "drilldowns": [
    ],
  • "filters": [
    ],
  • "hide_border": true,
  • "hide_title": true,
  • "ignore_global_filters": false,
  • "metrics": [
    ],
  • "query": {
    },
  • "references": [
    ],
  • "sampling": 1,
  • "styling": {
    },
  • "time_range": {
    },
  • "title": "string",
  • "type": "metric"
}

Response samples

Content type
application/json
Example

Response after creating a metric chart (count of requests) using an inline data view. Server-populated defaults are included in the response.

{
  • "id": "1e4f0a30-b3c5-11ef-bd7a-2b6b1a8c0f3d",
  • "data": {
    },
  • "meta": {
    }
}

Delete visualization

Spaces method and path for this operation:

delete /s/{space_id}/api/visualizations/{id}

Refer to Spaces for more information.

Permanently deletes a Lens visualization. If the visualization is referenced by a dashboard panel, the panel shows an error after deletion.

Authorizations:
apiKeyAuthbasicAuth
path Parameters
id
required
string

The visualization identifier, as returned by the create or search endpoints.

header Parameters
kbn-xsrf
required
string
Example: true

A required header to protect against CSRF attacks

Responses

Request samples

curl -X DELETE "${KIBANA_URL}/api/visualizations/1e4f0a30-b3c5-11ef-bd7a-2b6b1a8c0f3d" \
  -H "Authorization: ApiKey ${API_KEY}" \
  -H "kbn-xsrf: true"

Get visualization

Spaces method and path for this operation:

get /s/{space_id}/api/visualizations/{id}

Refer to Spaces for more information.

Returns a single Lens visualization by its ID.

Authorizations:
apiKeyAuthbasicAuth
path Parameters
id
required
string

The visualization identifier, as returned by the create or search endpoints.

Responses

Request samples

curl -X GET "${KIBANA_URL}/api/visualizations/1e4f0a30-b3c5-11ef-bd7a-2b6b1a8c0f3d" \
  -H "Authorization: ApiKey ${API_KEY}"

Response samples

Content type
application/json

The full visualization state including the chart configuration and metadata.

{
  • "id": "1e4f0a30-b3c5-11ef-bd7a-2b6b1a8c0f3d",
  • "data": {
    },
  • "meta": {
    }
}

Update visualization

Spaces method and path for this operation:

put /s/{space_id}/api/visualizations/{id}

Refer to Spaces for more information.

Replaces the full configuration of an existing Lens visualization. Partial updates are not supported. To make incremental changes, retrieve the visualization first, modify the fields you need, then send the complete object back.

If no visualization exists with the specified ID, a new one is created.

ES|QL visualizations cannot be updated through this endpoint.

Authorizations:
apiKeyAuthbasicAuth
path Parameters
id
required
string

The visualization identifier, as returned by the create or search endpoints.

header Parameters
kbn-xsrf
required
string
Example: true

A required header to protect against CSRF attacks

Request Body schema: application/json
Any of
Date Histogram Operation (object) or Terms Operation (object) or Histogram Operation (object) or Ranges Operation (object) or Filters Operation (object)
required
Data view reference (object) or Data view inline spec (object)
description
string
Array of dashboard_drilldown (object) or discover_drilldown (object) or url_drilldown (object) <= 100 items
Array of condition (object) or group (object) or dsl (object) or spatial (object) (lensPanelFilters) <= 100 items

Filters applied to the panel

hide_border
boolean
hide_title
boolean
ignore_global_filters
boolean
Default: false

When true, ignores global filters when fetching data for this layer. Defaults to false.

required
Array of ((Count Metric Operation (object) or Unique Count Metric Operation (object) or Stats Metric Operation (object) or Sum Metric Operation (object) or Last Value Operation (object) or Percentile Operation (object) or Percentile Ranks Operation (object)) or (Differences Operation (object) or Moving Average Operation (object) or Cumulative Sum Operation (object) or Counter Rate Operation (object)) or Formula Operation (object)) or ((Count Metric Operation (object) or Unique Count Metric Operation (object) or Stats Metric Operation (object) or Sum Metric Operation (object) or Last Value Operation (object) or Percentile Operation (object) or Percentile Ranks Operation (object)) or (Differences Operation (object) or Moving Average Operation (object) or Cumulative Sum Operation (object) or Counter Rate Operation (object)) or Formula Operation (object)) [ 1 .. 2 ] items

Metric dimensions to display. The first must be a primary metric; an optional second must be a secondary metric.

required
object (Filter)

A KQL or Lucene query that filters panel data. Applied on top of any dashboard-level filters.

Array of objects (kbn-content-management-utils-referenceSchema)
sampling
number [ 0 .. 1 ]
Default: 1

Sampling factor between 0 (no sampling) and 1 (full sampling).

object (metricStyling)

Visual chart styling options

object (Time range)

Specifies the time range for a query.

title
string
type
required
string
Value: "metric"

Responses

Request samples

Content type
application/json
Example
{
  • "breakdown_by": {
    },
  • "data_source": {
    },
  • "description": "string",
  • "drilldowns": [
    ],
  • "filters": [
    ],
  • "hide_border": true,
  • "hide_title": true,
  • "ignore_global_filters": false,
  • "metrics": [
    ],
  • "query": {
    },
  • "references": [
    ],
  • "sampling": 1,
  • "styling": {
    },
  • "time_range": {
    },
  • "title": "string",
  • "type": "metric"
}

Response samples

Content type
application/json

The complete updated visualization state after a full replacement. PUT replaces the entire chart configuration — fields omitted from the request are reset to their defaults. meta.created_at reflects the update time rather than the original creation time.

{
  • "id": "1e4f0a30-b3c5-11ef-bd7a-2b6b1a8c0f3d",
  • "data": {
    },
  • "meta": {
    }
}