Create a Discover session

Base URL
https://{kibana_url}
  • POST /api/discover_sessions
  • POST /s/{space_id}/api/discover_sessions
Auth

Creates a Discover session and returns its ID, full state, and metadata.

Path parameters

space_id string optional

An identifier for the space. If space_id is not provided in the URL, the default space is used. Refer to Spaces for more information.

Header parameters

kbn-xsrf string required

A required header to protect against CSRF attacks

Request body

description string · max length: 10000

A short description of the Discover session.

tabs union anyOf[] · min items: 1 · max items: 25 required

Ordered list of tabs in the Discover session. Each tab requires a stable, unique ID, which other saved objects and links can reference.

Any of:
breakdown_field string · max length: 1000

Field name used to split chart data into series.

chart_interval enum

Time interval for the chart histogram on this tab.

Values: auto ms s m h d w M y
column_order string[] · max items: 100

Ordered list of field names to display in the data table. If omitted, defaults to the defaultColumns advanced setting.

column_settings map string to object

Per-column settings keyed by field name, such as width. Keys should correspond to entries in column_order when both are set.

data_source union oneOf required

The data view used by the tab, specified by reference or defined inline.

One of: (determined by type)
type: data_view_reference
type enum required
Values: data_view_reference
ref_id string required

The id of the Kibana data view to use as the data source. Example: "my-data-view".

default_rendered_nodes number · min: 10 · max: 200

The number of nodes each JSON cell renders by default in the JSON document view.

density enum

The table row spacing. If omitted, Kibana determines the density from its current settings, such as the user preference.

Values: compact expanded normal
documents_display_mode enum

How documents are shown: table for a formatted table or json for a raw JSON tree.

Values: table json
filters union oneOf[] · max items: 100 · default: []

List of filters to apply to the data in the tab.

One of:

A filter that evaluates a single field condition such as equality, range, or existence.

type enum required
Values: condition
condition union oneOf required

A filter condition with strict operator/value type matching.

One of: (determined by operator)
operator: is

Matches documents where field equals a single specified value.

operator enum required
Values: is
field string required

Name of the document field the condition evaluates.

negate boolean

When true, the filter is negated and matches documents that do NOT satisfy the condition. Defaults to false.

value union string | number | boolean required

Single value to compare against the field.

controlled_by string

Identifier of the panel that manages this filter. When set, the filter is treated as owned by that panel.

data_view_id string

Identifier of the data view used as context for this filter.

disabled boolean

When true, the filter is inactive and does not affect query results. Defaults to false.

is_multi_index boolean

When true, the filter can be applied across multiple indices. Defaults to false.

label string

Human-readable label for the filter, used for display purposes.

negate boolean

When true, the filter is negated and matches documents that do NOT satisfy the condition. Defaults to false.

header_row_height union number | enum

The table header row height, as a number of lines, or auto to size it based on content. If omitted, Kibana determines the height from its current settings, such as the user preference.

Values: auto
hide_aggregated_preview boolean

Applies to the field statistics view. When true, hides the distribution preview shown for each field. If omitted, previews are shown.

hide_chart boolean · default: false

When true, the chart is hidden.

hide_nulls boolean

When true, fields with null values are hidden in the JSON document view.

hide_table boolean · default: false

When true, the data table is hidden.

id string · min length: 1 · max length: 250 required

A unique identifier. Must contain only lowercase letters, numbers, hyphens, and underscores.

label string · max length: 120 required

The label of the tab.

row_height union number | enum

The table data row height, as a number of lines, or auto to size it based on content. If omitted, defaults to the discover:rowHeightOption advanced setting.

Values: auto
rows_per_page number · min: 1 · max: 10000

The number of rows to display per page in the data table. If omitted, defaults to the discover:sampleRowsPerPage advanced setting. Has no effect on ES|QL tabs.

sample_size number · min: 10 · max: 10000

The number of documents to sample for the data table. If omitted, defaults to the discover:sampleSize advanced setting.

type enum · default: default

The tab type. default tabs have no type-specific settings.

Values: default
view_mode enum · default: documents

The Discover view mode: documents (search hits), patterns (pattern analysis), or aggregated (field statistics).

Values: documents patterns aggregated
wrap_lines boolean

When true, long values wrap in the JSON document view. When false, they are truncated to a single line.

tags string[] · max items: 1000 · default: []

Tag IDs to associate with this Discover session.

title string · min length: 1 · max length: 1000 required

The title of the Discover session.

Responses

Created

application/json
data object required

Configuration data for a Discover session.

description string · max length: 10000

A short description of the Discover session.

tabs union anyOf[] · min items: 1 · max items: 25 required

Ordered list of tabs in the Discover session. Each tab requires a stable, unique ID, which other saved objects and links can reference.

Same options as tabs
tags string[] · max items: 1000 · default: []

Tag IDs to associate with this Discover session.

title string · min length: 1 · max length: 1000 required

The title of the Discover session.

id string required

The Discover session ID.

meta object required
created_at string

Timestamp when the object was created (ISO 8601).

created_by string

User profile ID of the user who created the object.

managed boolean

When true, the object is managed by Kibana and cannot be edited by users.

owner string

Identifier of the plugin or team that owns this object.

updated_at string

Timestamp when the object was last updated (ISO 8601).

updated_by string

User profile ID of the user who last updated the object.

version string

Internal version identifier for optimistic concurrency control.

400

Invalid request

403

Forbidden

Base URL
https://{kibana_url}