---
type: api
title: Get a Discover session
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4641/api/doc/kibana/operation/operation-get-discover-session
resource: https://www.elastic.co/elastic/docs-builder/docs/4641/api/doc/kibana/operation/operation-get-discover-session
products:
  - Kibana
---

# Get a Discover session

Authentication: required

Availability: Planned

- Server: `https://{kibana_url}`

## Paths

- `GET` `/api/discover_sessions/{id}`
- `GET` `/s/{space_id}/api/discover_sessions/{id}`

#### 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](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.
- `id` (string) — required
  The Discover session ID, as returned by the create or search endpoints.

## Description

Returns the complete state of a Discover session by ID.

## Responses

#### `200`

Success

`application/json`

- `data` (object)
  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)
    Ordered list of tabs in the Discover session. Each tab requires a stable, unique ID, which other saved objects and links can reference.
    - **header_row_height: auto**
      - `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.
        Map values (object)
        - `width` (number · min: 0)
          Optional width of the column in pixels.
      - `control_panels` (object[] · max items: 1000)
        The ES|QL controls of the tab.
        - `config` (union oneOf)
          The ES|QL control settings, including its variable, available options, and selected values.
          - **STATIC_VALUES** (`control_type: STATIC_VALUES`)
            An ES|QL variable control with a fixed list of selectable options defined directly in `available_options`.
            - `control_type` (enum)
              Values: `STATIC_VALUES`
            - `available_options` (string[] · max items: 1000)
              A fixed list of option strings displayed in the control.
            - `display_settings` (object)
              - `hide_action_bar` (boolean)
                When `true`, the search bar, sorting options, and select all toggle are hidden from the control.
              - `hide_exclude` (boolean)
                When `true`, the exclude mode toggle is hidden from the control.
              - `hide_exists` (boolean)
                When `true`, the exists filter option is hidden from the control.
              - `hide_sort` (boolean)
                When `true`, the sort selector is hidden from the control.
              - `placeholder` (string)
                Placeholder text displayed in the control input when no option is selected.
            - `selected_options` (string[] · max items: 10000)
              The list of currently selected option values.
            - `single_select` (boolean · default: true)
              When `true`, only one option can be selected at a time. Selecting a new option deselects any previously selected option. Defaults to `true`.
            - `title` (string)
              A human-readable title for the control.
            - `variable_name` (string)
              The name of the ES|QL variable that this control populates. The variable is referenced in ES|QL queries using the `?variable_name` syntax.
            - `variable_type` (enum)
              The ES|QL variable type that determines how the selected value is substituted into the query. Accepts `fields`, `values`, `functions`, `time_literal`, or `multi_values`.
              Values: `fields`, `values`, `functions`, `time_literal`, `multi_values`
          - **VALUES_FROM_QUERY** (`control_type: VALUES_FROM_QUERY`)
            An ES|QL variable control whose selectable options are dynamically retrieved by running an ES|QL query.
            - `control_type` (enum)
              Values: `VALUES_FROM_QUERY`
            - `display_settings` (object)
              - `hide_action_bar` (boolean)
                When `true`, the search bar, sorting options, and select all toggle are hidden from the control.
              - `hide_exclude` (boolean)
                When `true`, the exclude mode toggle is hidden from the control.
              - `hide_exists` (boolean)
                When `true`, the exists filter option is hidden from the control.
              - `hide_sort` (boolean)
                When `true`, the sort selector is hidden from the control.
              - `placeholder` (string)
                Placeholder text displayed in the control input when no option is selected.
            - `esql_query` (string)
              An ES|QL query whose results populate the list of available options in the control popover.
            - `selected_options` (string[] · max items: 10000)
              The list of currently selected option values.
            - `single_select` (boolean · default: true)
              When `true`, only one option can be selected at a time. Selecting a new option deselects any previously selected option. Defaults to `true`.
            - `title` (string)
              A human-readable title for the control.
            - `variable_name` (string)
              The name of the ES|QL variable that this control populates. The variable is referenced in ES|QL queries using the `?variable_name` syntax.
            - `variable_type` (enum)
              The ES|QL variable type that determines how the selected value is substituted into the query. Accepts `fields`, `values`, `functions`, `time_literal`, or `multi_values`.
              Values: `fields`, `values`, `functions`, `time_literal`, `multi_values`
        - `grow` (boolean · default: false)
          When `true`, the control expands to fill any available horizontal space.
        - `id` (string · min length: 1)
          The unique ID of the control.
        - `type` (enum)
          Values: `esql_control`
        - `width` (enum · default: medium)
          The minimum width of the control.
          Values: `small`, `medium`, `large`
      - `data_source` (union oneOf)
        The data view used by the tab, specified by reference or defined inline.
        - **Data view reference** (`type: data_view_reference`)
          - `type` (enum)
            Values: `data_view_reference`
          - `ref_id` (string)
            The id of the Kibana data view to use as the data source. Example: "my-data-view".
        - **Data view inline spec** (`type: data_view_spec`)
          - `type` (enum)
            Values: `data_view_spec`
          - `allow_hidden_indices` (boolean)
            When `true`, allows the data view to match hidden indices.
          - `field_filters` (string[] · max items: 10000)
            Field filters can be used to exclude one or more fields when fetching a document. They may contain wildcards, such as `user*` which filters fields starting with 'user'.
          - `field_settings` (map string to anyOf)
            Settings for individual fields, keyed by field name. To change how Kibana displays a field from the backing indices, set its label, description, or format. To define a runtime field, use the runtime field name and set `type`.
          - `index_pattern` (string · min length: 1)
            The index pattern (Elasticsearch index expression) to use as the data source. Example: "my-index-*".
          - `name` (string · min length: 1 · max length: 256)
            The name of the data view. Example: "Sample data view".
          - `time_field` (string)
            The name of the time field in the index. Used for time-based filtering. Example: "@timestamp".
      - `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.
        - **condition**
          A filter that evaluates a single field condition such as equality, range, or existence.
          - `type` (enum)
            Values: `condition`
          - `condition` (union oneOf)
            A filter condition with strict operator/value type matching.
            - **is** (`operator: is`)
              Matches documents where `field` equals a single specified value.
              - `operator` (enum)
                Values: `is`
              - `field` (string)
                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)
                Single value to compare against the field.
            - **is_one_of** (`operator: is_one_of`)
              Matches documents where `field` equals any value in a provided list.
              - `operator` (enum)
                Values: `is_one_of`
              - `field` (string)
                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[])
                Homogeneous array of values to match against the field.
            - **range** (`operator: range`)
              Matches documents where `field` falls within a specified numeric or date range.
              - `operator` (enum)
                Values: `range`
              - `field` (string)
                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` (object)
                Boundary values for a range comparison.
                - `format` (string)
                  Elasticsearch [date format](https://www.elastic.co/docs/reference/elasticsearch/mapping-reference/mapping-date-format) string applied when parsing date boundary values. For example, `strict_date_optional_time` or `epoch_millis`.
                - `gt` (number | string)
                  Greater than.
                - `gte` (number | string)
                  Greater than or equal to.
                - `lt` (number | string)
                  Less than.
                - `lte` (number | string)
                  Less than or equal to.
            - **exists** (`operator: exists`)
              Matches documents where `field` exists and contains a non-null value.
              - `operator` (enum)
                Values: `exists`
              - `field` (string)
                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`.
          - `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`.
        - **group**
          A filter that combines multiple conditions or nested groups using a logical `and` or `or` operator.
          - `type` (enum)
            Values: `group`
          - `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`.
          - `group` (object)
            Logical group that combines one or more conditions or nested groups.
            - `conditions` (union anyOf[]) — recursive
              Ordered list of conditions or nested groups combined by the group `operator`.
            - `operator` (enum)
              Logical operator applied across all entries in `conditions`. Use `and` to require all conditions, or `or` to require at least one.
              Values: `and`, `or`
          - `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`.
        - **dsl**
          A filter expressed as a raw [Elasticsearch Query DSL](https://www.elastic.co/docs/reference/query-languages/querydsl) object, used for queries that cannot be represented by condition or group filters.
          - `type` (enum)
            Values: `dsl`
          - `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`.
          - `dsl` (map string to object)
            Elasticsearch Query DSL object passed directly to the query.
          - `field` (string)
            Field name for scripted filters where the field cannot be extracted from the DSL query.
          - `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`.
          - `params` (object)
            Filter parameters metadata. May contain display values, formats, and parameters for scripted filters.
        - **spatial**
          A filter that applies an Elasticsearch geo query, used for geographic boundary and shape matching.
          - `type` (enum)
            Values: `spatial`
          - `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`.
          - `dsl` (map string to object)
            Elasticsearch geo query DSL object.
          - `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)
        A unique identifier. Must contain only lowercase letters, numbers, hyphens, and underscores.
      - `label` (string · max length: 120)
        The label of the tab.
      - `query` (object)
        A search query consisting of an expression and its language. Supports KQL and Lucene syntax.
        - `expression` (string)
          A query expression in KQL or Lucene syntax.
        - `language` (enum)
          Query language. Use `kql` for Kibana Query Language (KQL) or `lucene` for Lucene query syntax.
          Values: `kql`, `lucene`
      - `refresh_interval` (object)
        Specifies the auto-refresh interval for the object.
        - `pause` (boolean)
          When `true`, auto-refresh is paused.
        - `value` (number)
          The refresh interval in milliseconds.
      - `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.
      - `sort` (object[] · max items: 100 · default: [])
        Sort configuration for the data table (field and direction).
        - `direction` (enum)
          The sort direction: `asc` for ascending or `desc` for descending.
          Values: `asc`, `desc`
        - `name` (string)
          The name of the field to sort by.
      - `time_range` (object)
        Specifies the time range for a query.
        - `from` (string)
          The start of the time range. Accepts Elasticsearch [date math](https://www.elastic.co/docs/reference/elasticsearch/rest-apis/common-options#date-math) expressions (for example, `now-7d`) or ISO 8601 timestamps.
        - `mode` (enum)
          The time range mode. Use `absolute` for fixed start and end timestamps. Use `relative` for [date math](https://www.elastic.co/docs/reference/elasticsearch/rest-apis/common-options#date-math) expressions that are re-evaluated at query time (for example, `now-7d`).
          Values: `absolute`, `relative`
        - `to` (string)
          The end of the time range. Accepts Elasticsearch [date math](https://www.elastic.co/docs/reference/elasticsearch/rest-apis/common-options#date-math) expressions (for example, `now`) or ISO 8601 timestamps.
      - `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`
      - `vis_context` (object)
        The saved chart configuration. Discover reuses it when compatible with the tab’s current settings and query results; otherwise, it rebuilds the chart.
        - `attributes` (map string to object)
          Lens visualization attributes used to render the Discover chart.
        - `suggestion_type` (enum)
          Chart suggestion type used by Discover to generate this histogram configuration.
          Values: `lensSuggestion`, `histogramForESQL`, `histogramForDataView`
      - `wrap_lines` (boolean)
        When `true`, long values wrap in the JSON document view. When `false`, they are truncated to a single line.
    - **header_row_height: auto**
      - `breakdown_field` (string · max length: 1000)
        Field name used to split chart data into series.
      - `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.
        Map values (object)
        - `width` (number · min: 0)
          Optional width of the column in pixels.
      - `control_panels` (object[] · max items: 1000)
        The ES|QL controls of the tab.
        Same fields as `control_panels` in `header_row_height: auto`
      - `data_source` (object)
        Uses an ES|QL query as the data source. The query is executed at render time; resulting columns are available as fields.
        - `query` (string)
          An ES|QL query that drives the data source. The query must produce a tabular result set; column names are used as field references. Example: "FROM logs-* | STATS count = COUNT(*) BY host.name".
        - `type` (enum)
          Values: `esql`
      - `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`
      - `esql_approximation` (boolean)
        When `true`, ES|QL visualizations that use `STATS` run with [approximate execution](https://www.elastic.co/docs/reference/query-languages/esql/esql-query-approximation) for faster, estimated results.
      - `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_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)
        A unique identifier. Must contain only lowercase letters, numbers, hyphens, and underscores.
      - `label` (string · max length: 120)
        The label of the tab.
      - `refresh_interval` (object)
        Specifies the auto-refresh interval for the object.
        - `pause` (boolean)
          When `true`, auto-refresh is paused.
        - `value` (number)
          The refresh interval in milliseconds.
      - `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.
      - `sort` (object[] · max items: 100 · default: [])
        Sort configuration for the data table (field and direction).
        - `direction` (enum)
          The sort direction: `asc` for ascending or `desc` for descending.
          Values: `asc`, `desc`
        - `name` (string)
          The name of the field to sort by.
      - `time_range` (object)
        Specifies the time range for a query.
        - `from` (string)
          The start of the time range. Accepts Elasticsearch [date math](https://www.elastic.co/docs/reference/elasticsearch/rest-apis/common-options#date-math) expressions (for example, `now-7d`) or ISO 8601 timestamps.
        - `mode` (enum)
          The time range mode. Use `absolute` for fixed start and end timestamps. Use `relative` for [date math](https://www.elastic.co/docs/reference/elasticsearch/rest-apis/common-options#date-math) expressions that are re-evaluated at query time (for example, `now-7d`).
          Values: `absolute`, `relative`
        - `to` (string)
          The end of the time range. Accepts Elasticsearch [date math](https://www.elastic.co/docs/reference/elasticsearch/rest-apis/common-options#date-math) expressions (for example, `now`) or ISO 8601 timestamps.
      - `type` (enum · default: default)
        The tab type. `default` tabs have no type-specific settings.
        Values: `default`
      - `vis_context` (object)
        The saved chart configuration. Discover reuses it when compatible with the tab’s current settings and query results; otherwise, it rebuilds the chart.
        - `attributes` (map string to object)
          Lens visualization attributes used to render the Discover chart.
        - `suggestion_type` (enum)
          Chart suggestion type used by Discover to generate this histogram configuration.
          Values: `lensSuggestion`, `histogramForESQL`, `histogramForDataView`
      - `wrap_lines` (boolean)
        When `true`, long values wrap in the JSON document view. When `false`, they are truncated to a single line.
    - **Metrics tab**
      An ES|QL tab with saved metrics grid settings.
      - `breakdown_field` (string · max length: 1000)
        Field name used to split chart data into series.
      - `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.
        Map values (object)
        - `width` (number · min: 0)
          Optional width of the column in pixels.
      - `control_panels` (object[] · max items: 1000)
        The ES|QL controls of the tab.
        Same fields as `control_panels` in `header_row_height: auto`
      - `counter_aggregation` (enum)
        Aggregation applied to counter metric fields.
        Values: `avg`, `sum`, `min`, `max`
      - `data_source` (object)
        Uses an ES|QL query as the data source. The query is executed at render time; resulting columns are available as fields.
        - `query` (string)
          An ES|QL query that drives the data source. The query must produce a tabular result set; column names are used as field references. Example: "FROM logs-* | STATS count = COUNT(*) BY host.name".
        - `type` (enum)
          Values: `esql`
      - `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`
      - `dimensions` (string[] · max items: 5)
        Fields used to group metrics in the metrics grid.
      - `documents_display_mode` (enum)
        How documents are shown: `table` for a formatted table or `json` for a raw JSON tree.
        Values: `table`, `json`
      - `esql_approximation` (boolean)
        When `true`, ES|QL visualizations that use `STATS` run with [approximate execution](https://www.elastic.co/docs/reference/query-languages/esql/esql-query-approximation) for faster, estimated results.
      - `gauge_aggregation` (enum)
        Aggregation applied to gauge metric fields.
        Values: `avg`, `sum`, `min`, `max`
      - `grid_sort_direction` (enum)
        Direction of the metrics grid order. If omitted, defaults to ascending.
        Values: `asc`, `desc`
      - `grid_sort_field` (enum)
        Criterion used to order metrics in the metrics grid. `recency` orders by the metrics the viewing user explored most recently in their own browser. If omitted, metrics are ordered alphabetically.
        Values: `alphabetically`, `recency`
      - `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_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.
      - `histogram_percentile` (enum)
        Percentile displayed for histogram metric fields.
        Values: `p50`, `p75`, `p90`, `p95`, `p99`
      - `histogram_visualization` (enum)
        How histogram metrics are drawn. If omitted, Discover uses the percentile chart.
        Values: `lnsXY`
      - `id` (string · min length: 1 · max length: 250)
        A unique identifier. Must contain only lowercase letters, numbers, hyphens, and underscores.
      - `label` (string · max length: 120)
        The label of the tab.
      - `refresh_interval` (object)
        Specifies the auto-refresh interval for the object.
        - `pause` (boolean)
          When `true`, auto-refresh is paused.
        - `value` (number)
          The refresh interval in milliseconds.
      - `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.
      - `search_term` (string · max length: 1000)
        Search term used to filter metrics in the metrics grid.
      - `sort` (object[] · max items: 100 · default: [])
        Sort configuration for the data table (field and direction).
        - `direction` (enum)
          The sort direction: `asc` for ascending or `desc` for descending.
          Values: `asc`, `desc`
        - `name` (string)
          The name of the field to sort by.
      - `time_range` (object)
        Specifies the time range for a query.
        - `from` (string)
          The start of the time range. Accepts Elasticsearch [date math](https://www.elastic.co/docs/reference/elasticsearch/rest-apis/common-options#date-math) expressions (for example, `now-7d`) or ISO 8601 timestamps.
        - `mode` (enum)
          The time range mode. Use `absolute` for fixed start and end timestamps. Use `relative` for [date math](https://www.elastic.co/docs/reference/elasticsearch/rest-apis/common-options#date-math) expressions that are re-evaluated at query time (for example, `now-7d`).
          Values: `absolute`, `relative`
        - `to` (string)
          The end of the time range. Accepts Elasticsearch [date math](https://www.elastic.co/docs/reference/elasticsearch/rest-apis/common-options#date-math) expressions (for example, `now`) or ISO 8601 timestamps.
      - `type` (enum)
        A tab with saved metrics grid settings. Requires an ES|QL data source. These settings are used only when the query supports the metrics experience.
        Values: `metrics`
      - `vis_context` (object)
        The saved chart configuration. Discover reuses it when compatible with the tab’s current settings and query results; otherwise, it rebuilds the chart.
        - `attributes` (map string to object)
          Lens visualization attributes used to render the Discover chart.
        - `suggestion_type` (enum)
          Chart suggestion type used by Discover to generate this histogram configuration.
          Values: `lensSuggestion`, `histogramForESQL`, `histogramForDataView`
      - `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)
    The title of the Discover session.
- `id` (string)
  The Discover session ID.
- `meta` (object)
  - `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.
- `warnings` (union anyOf[])
  Warnings about content omitted from the API response due to conversion or validation errors. The saved session is not modified.
  - **Dropped item**
    An item in a tab that was excluded from the response because it failed validation.
    - `type` (enum)
      Values: `dropped_item`
    - `item_config` (map string to object)
      The original configuration of the dropped item.
    - `item_id` (string)
      The ID of the dropped item.
    - `item_type` (string)
      The type identifier of the dropped item, when available.
    - `key` (string)
      The name of the property that contains the dropped item.
    - `message` (string)
      The reason the content was dropped.
    - `tab_id` (string)
      The ID of the tab that contains the dropped content.
  - **Dropped property**
    A tab property excluded from the response due to malformed data.
    - `type` (enum)
      Values: `dropped_property`
    - `key` (string)
      The name of the property that was dropped.
    - `message` (string)
      The reason the content was dropped.
    - `tab_id` (string)
      The ID of the tab that contains the dropped content.
    - `value` (object)
      The original value of the property that was dropped.
#### `403`

Forbidden

#### `404`

Not found

#### `500`

Internal server error

## Code examples

#### Console

```console
GET kbn:/api/discover_sessions/web-log-requests
```

#### curl

```curl
curl -X GET "${KIBANA_URL}/api/discover_sessions/web-log-requests" \
  -H "Authorization: ApiKey ${API_KEY}" \
  -H "elastic-api-version: 2023-10-31"
```

## Response examples

#### Response for the ES|QL session example

`application/json`

```json
{
  "data": {
    "description": "",
    "tabs": [
      {
        "column_order": [
          "extension",
          "requests"
        ],
        "data_source": {
          "query": "FROM kibana_sample_data_logs | STATS requests = COUNT(*) BY extension | SORT requests DESC",
          "type": "esql"
        },
        "hide_chart": false,
        "hide_table": false,
        "id": "requests",
        "label": "Requests",
        "sort": [],
        "type": "default"
      }
    ],
    "tags": [],
    "title": "Requests by extension"
  },
  "id": "web-log-requests",
  "meta": {
    "created_at": "2026-10-15T09:00:00.000Z",
    "created_by": "u_example",
    "managed": false,
    "updated_at": "2026-10-15T09:00:00.000Z",
    "updated_by": "u_example",
    "version": "WzEsMV0="
  }
}
```

