From 344759ca0abe14e036cbc64269b492d2eb40392c Mon Sep 17 00:00:00 2001 From: Vladimir Filonov Date: Tue, 19 May 2026 18:31:08 +0400 Subject: [PATCH 1/6] Adopt alert-like table and filtering from observability/discovery --- .../shared/workflows_management/kibana.jsonc | 2 + .../workflows_management/public/mocks.ts | 2 + .../pages/executions/executions_page.test.tsx | 47 ++- .../pages/executions/executions_page.tsx | 27 +- .../pages/executions/static_execution_rows.ts | 42 -- .../workflow_execution_detail_flyout.tsx | 152 ++++++++ .../workflow_executions_data_view.ts | 77 ++++ ...flow_executions_filter_search_scaffold.tsx | 129 ------- .../workflow_executions_filters.tsx | 105 +++++ .../workflow_executions_page_constants.ts | 43 +++ .../workflow_executions_page_content.tsx | 102 +++++ .../workflow_executions_search_bar.tsx | 59 +++ .../workflow_executions_search_query.test.ts | 80 ++++ .../workflow_executions_search_query.ts | 83 ++++ .../workflow_executions_stub_data_grid.tsx | 164 -------- .../workflow_executions_table.test.tsx | 152 ++++++++ .../executions/workflow_executions_table.tsx | 360 ++++++++++++++++++ .../workflows_management/public/types.ts | 2 + 18 files changed, 1269 insertions(+), 359 deletions(-) delete mode 100644 src/platform/plugins/shared/workflows_management/public/pages/executions/static_execution_rows.ts create mode 100644 src/platform/plugins/shared/workflows_management/public/pages/executions/workflow_execution_detail_flyout.tsx create mode 100644 src/platform/plugins/shared/workflows_management/public/pages/executions/workflow_executions_data_view.ts delete mode 100644 src/platform/plugins/shared/workflows_management/public/pages/executions/workflow_executions_filter_search_scaffold.tsx create mode 100644 src/platform/plugins/shared/workflows_management/public/pages/executions/workflow_executions_filters.tsx create mode 100644 src/platform/plugins/shared/workflows_management/public/pages/executions/workflow_executions_page_constants.ts create mode 100644 src/platform/plugins/shared/workflows_management/public/pages/executions/workflow_executions_page_content.tsx create mode 100644 src/platform/plugins/shared/workflows_management/public/pages/executions/workflow_executions_search_bar.tsx create mode 100644 src/platform/plugins/shared/workflows_management/public/pages/executions/workflow_executions_search_query.test.ts create mode 100644 src/platform/plugins/shared/workflows_management/public/pages/executions/workflow_executions_search_query.ts delete mode 100644 src/platform/plugins/shared/workflows_management/public/pages/executions/workflow_executions_stub_data_grid.tsx create mode 100644 src/platform/plugins/shared/workflows_management/public/pages/executions/workflow_executions_table.test.tsx create mode 100644 src/platform/plugins/shared/workflows_management/public/pages/executions/workflow_executions_table.tsx diff --git a/src/platform/plugins/shared/workflows_management/kibana.jsonc b/src/platform/plugins/shared/workflows_management/kibana.jsonc index 6b862250f9b10..2d47dddf5db17 100644 --- a/src/platform/plugins/shared/workflows_management/kibana.jsonc +++ b/src/platform/plugins/shared/workflows_management/kibana.jsonc @@ -30,6 +30,8 @@ "fieldFormats", "unifiedSearch", "embeddable", + "controls", + "uiActions", "licensing" ], "optionalPlugins": ["alerting", "serverless", "cloud", "inbox"], diff --git a/src/platform/plugins/shared/workflows_management/public/mocks.ts b/src/platform/plugins/shared/workflows_management/public/mocks.ts index 1872eae4f629c..c4e997433ebc4 100644 --- a/src/platform/plugins/shared/workflows_management/public/mocks.ts +++ b/src/platform/plugins/shared/workflows_management/public/mocks.ts @@ -21,6 +21,7 @@ import { QueryClient } from '@kbn/react-query'; import { serverlessMock } from '@kbn/serverless/public/mocks'; import { spacesPluginMock } from '@kbn/spaces-plugin/public/mocks'; import { triggersActionsUiMock } from '@kbn/triggers-actions-ui-plugin/public/mocks'; +import { uiActionsPluginMock } from '@kbn/ui-actions-plugin/public/mocks'; import { unifiedSearchPluginMock } from '@kbn/unified-search-plugin/public/mocks'; import { workflowsExtensionsMock } from '@kbn/workflows-extensions/public/mocks'; import { createAvailabilityServiceMock } from './common/lib/availability/mock'; @@ -39,6 +40,7 @@ export const createStartServicesMock = () => ({ data: dataPluginMock.createStartContract(), spaces: spacesPluginMock.createStartContract(), triggersActionsUi: triggersActionsUiMock.createStart(), + uiActions: uiActionsPluginMock.createStartContract(), workflowsExtensions: workflowsExtensionsMock.createStart(), licensing: licensingMock.createStart(), cloud: cloudMock.createStart(), diff --git a/src/platform/plugins/shared/workflows_management/public/pages/executions/executions_page.test.tsx b/src/platform/plugins/shared/workflows_management/public/pages/executions/executions_page.test.tsx index 4d3eb435905a8..8686b1bbde147 100644 --- a/src/platform/plugins/shared/workflows_management/public/pages/executions/executions_page.test.tsx +++ b/src/platform/plugins/shared/workflows_management/public/pages/executions/executions_page.test.tsx @@ -7,21 +7,60 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { render, screen } from '@testing-library/react'; +import { render, screen, waitFor } from '@testing-library/react'; import React from 'react'; +import { of } from 'rxjs'; +import { searchSourceInstanceMock } from '@kbn/data-plugin/common/search/search_source/mocks'; import { WorkflowExecutionsPage } from './executions_page'; import { createStartServicesMock } from '../../mocks'; import { getTestProvider } from '../../shared/mocks/test_providers'; +jest.mock('@kbn/alerts-ui-shared/src/alert_filter_controls', () => ({ + AlertFilterControls: () =>
, +})); + +jest.mock('@kbn/unified-data-table', () => { + const actual = jest.requireActual('@kbn/unified-data-table'); + return { + ...actual, + UnifiedDataTable: () =>
, + }; +}); + +jest.mock('@kbn/cell-actions', () => ({ + CellActionsProvider: ({ children }: { children: React.ReactNode }) => <>{children}, +})); + describe('WorkflowExecutionsPage', () => { - it('renders the executions shell and stub grid', async () => { + it('renders the executions page with search, filters, and table', async () => { const services = createStartServicesMock(); services.workflowsManagement.globalExecutionsView.enabled = true; + services.spaces.getActiveSpace = jest.fn().mockResolvedValue({ id: 'default' }); + const SearchBarStub = () =>
; + services.unifiedSearch.ui.SearchBar = SearchBarStub; + + jest.mocked(searchSourceInstanceMock.fetch$).mockReturnValue( + of({ + rawResponse: { + hits: { + hits: [], + total: { value: 0, relation: 'eq' }, + }, + }, + }) as unknown as ReturnType + ); render(, { wrapper: getTestProvider({ services }) }); expect(screen.getByTestId('workflowExecutionsPage')).toBeInTheDocument(); - expect(screen.getByTestId('workflowExecutionsSearchFilterScaffold')).toBeInTheDocument(); - await screen.findByTestId('discoverDocTable'); + expect(screen.getByTestId('workflowExecutionsPageContent')).toBeInTheDocument(); + expect(screen.getByTestId('searchBarStub')).toBeInTheDocument(); + await waitFor(() => { + expect(screen.getByTestId('workflowExecutionsFilters')).toBeInTheDocument(); + }); + expect(screen.getByTestId('alertFilterControlsStub')).toBeInTheDocument(); + await waitFor(() => { + expect(screen.getByTestId('workflowExecutionsTableEmpty')).toBeInTheDocument(); + }); }); }); diff --git a/src/platform/plugins/shared/workflows_management/public/pages/executions/executions_page.tsx b/src/platform/plugins/shared/workflows_management/public/pages/executions/executions_page.tsx index 953e26898f236..d4157312cf5f6 100644 --- a/src/platform/plugins/shared/workflows_management/public/pages/executions/executions_page.tsx +++ b/src/platform/plugins/shared/workflows_management/public/pages/executions/executions_page.tsx @@ -7,13 +7,10 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { EuiPageTemplate, EuiSpacer, EuiText, useEuiTheme } from '@elastic/eui'; +import { EuiPageTemplate, EuiScreenReaderOnly, EuiText, useEuiTheme } from '@elastic/eui'; import React from 'react'; import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n-react'; -import { WorkflowExecutionsFilterSearchScaffold } from './workflow_executions_filter_search_scaffold'; -import { WorkflowExecutionsStubDataGrid } from './workflow_executions_stub_data_grid'; -import { useKibana } from '../../hooks/use_kibana'; +import { WorkflowExecutionsPageContent } from './workflow_executions_page_content'; import { useWorkflowsBreadcrumbs } from '../../hooks/use_workflow_breadcrumbs/use_workflow_breadcrumbs'; const executionsPageTitle = i18n.translate('workflowsManagement.executionsPage.pageTitle', { @@ -23,13 +20,11 @@ const executionsPageTitle = i18n.translate('workflowsManagement.executionsPage.p const executionsPageDescription = i18n.translate( 'workflowsManagement.executionsPage.pageDescription', { - defaultMessage: - 'Recent workflow executions for your space. Data below is static until the list is connected to Elasticsearch.', + defaultMessage: 'Browse and filter workflow executions across your space.', } ); export function WorkflowExecutionsPage() { - const services = useKibana().services; const { euiTheme } = useEuiTheme(); useWorkflowsBreadcrumbs(executionsPageTitle); @@ -41,23 +36,15 @@ export function WorkflowExecutionsPage() { data-test-subj="workflowExecutionsPage" > + +

{executionsPageTitle}

+

{executionsPageDescription}

- -

- -

-
- - - - +
); diff --git a/src/platform/plugins/shared/workflows_management/public/pages/executions/static_execution_rows.ts b/src/platform/plugins/shared/workflows_management/public/pages/executions/static_execution_rows.ts deleted file mode 100644 index 0ee371324fc3e..0000000000000 --- a/src/platform/plugins/shared/workflows_management/public/pages/executions/static_execution_rows.ts +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the "Elastic License - * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -export interface WorkflowExecutionListStubRow { - readonly '@timestamp': string; - readonly execution_id: string; - readonly workflow_name: string; - readonly status: string; - readonly trigger_type: string; -} - -export const WORKFLOW_EXECUTIONS_STUB_DATA_VIEW_TITLE = 'workflows-executions-stub'; - -export const STATIC_WORKFLOW_EXECUTION_ROWS: WorkflowExecutionListStubRow[] = [ - { - '@timestamp': '2026-05-01T10:15:00.000Z', - execution_id: 'exec-001', - workflow_name: 'Notify on-call', - status: 'completed', - trigger_type: 'manual', - }, - { - '@timestamp': '2026-05-01T10:42:22.000Z', - execution_id: 'exec-002', - workflow_name: 'Index enrichment', - status: 'running', - trigger_type: 'index', - }, - { - '@timestamp': '2026-05-02T08:03:11.000Z', - execution_id: 'exec-003', - workflow_name: 'Weekly report', - status: 'failed', - trigger_type: 'alert', - }, -]; diff --git a/src/platform/plugins/shared/workflows_management/public/pages/executions/workflow_execution_detail_flyout.tsx b/src/platform/plugins/shared/workflows_management/public/pages/executions/workflow_execution_detail_flyout.tsx new file mode 100644 index 0000000000000..0b3804e6b7377 --- /dev/null +++ b/src/platform/plugins/shared/workflows_management/public/pages/executions/workflow_execution_detail_flyout.tsx @@ -0,0 +1,152 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { + EuiCodeBlock, + EuiDescriptionList, + EuiFlyout, + EuiFlyoutBody, + EuiFlyoutHeader, + EuiSpacer, + EuiText, + EuiTitle, + useGeneratedHtmlId, +} from '@elastic/eui'; +import React, { useMemo } from 'react'; +import type { DataTableRecord } from '@kbn/discover-utils/types'; +import { i18n } from '@kbn/i18n'; + +export interface WorkflowExecutionDetailFlyoutProps { + hit: DataTableRecord; + onClose: () => void; +} + +const formatValue = (value: unknown): string => { + if (value == null) { + return '\u2014'; + } + if (Array.isArray(value)) { + return value.length === 1 ? formatValue(value[0]) : value.map(formatValue).join(', '); + } + if (typeof value === 'object') { + return JSON.stringify(value); + } + return String(value); +}; + +const SUMMARY_FIELDS: ReadonlyArray<{ field: string; label: string }> = [ + { + field: 'id', + label: i18n.translate('workflowsManagement.executionsPage.flyoutFieldId', { + defaultMessage: 'Execution ID', + }), + }, + { + field: 'workflowId', + label: i18n.translate('workflowsManagement.executionsPage.flyoutFieldWorkflow', { + defaultMessage: 'Workflow', + }), + }, + { + field: 'status', + label: i18n.translate('workflowsManagement.executionsPage.flyoutFieldStatus', { + defaultMessage: 'Status', + }), + }, + { + field: 'startedAt', + label: i18n.translate('workflowsManagement.executionsPage.flyoutFieldStarted', { + defaultMessage: 'Started at', + }), + }, + { + field: 'finishedAt', + label: i18n.translate('workflowsManagement.executionsPage.flyoutFieldFinished', { + defaultMessage: 'Finished at', + }), + }, + { + field: 'triggeredBy', + label: i18n.translate('workflowsManagement.executionsPage.flyoutFieldTriggeredBy', { + defaultMessage: 'Triggered by', + }), + }, + { + field: 'executedBy', + label: i18n.translate('workflowsManagement.executionsPage.flyoutFieldExecutedBy', { + defaultMessage: 'Executed by', + }), + }, +]; + +export const WorkflowExecutionDetailFlyout = React.memo( + ({ hit, onClose }) => { + const flyoutTitleId = useGeneratedHtmlId({ prefix: 'workflowExecutionDetailFlyoutTitle' }); + + const summary = useMemo( + () => + SUMMARY_FIELDS.map(({ field, label }) => ({ + title: label, + description: formatValue(hit.flattened[field]), + })), + [hit.flattened] + ); + + const rawJson = useMemo( + () => JSON.stringify(hit.raw?._source ?? hit.flattened, null, 2), + [hit.flattened, hit.raw] + ); + + return ( + + + +

+ {i18n.translate('workflowsManagement.executionsPage.flyoutTitle', { + defaultMessage: 'Execution details', + })} +

+
+ + + {hit.flattened.id ? formatValue(hit.flattened.id) : hit.id} + +
+ + + + +

+ {i18n.translate('workflowsManagement.executionsPage.flyoutRawJsonTitle', { + defaultMessage: 'Raw document', + })} +

+
+ + + {rawJson} + +
+
+ ); + } +); +WorkflowExecutionDetailFlyout.displayName = 'WorkflowExecutionDetailFlyout'; diff --git a/src/platform/plugins/shared/workflows_management/public/pages/executions/workflow_executions_data_view.ts b/src/platform/plugins/shared/workflows_management/public/pages/executions/workflow_executions_data_view.ts new file mode 100644 index 0000000000000..51e64d30cdf81 --- /dev/null +++ b/src/platform/plugins/shared/workflows_management/public/pages/executions/workflow_executions_data_view.ts @@ -0,0 +1,77 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import type { DataViewSpec, FieldSpec } from '@kbn/data-views-plugin/common'; +import { DataView } from '@kbn/data-views-plugin/common'; +import type { FieldFormatsStart } from '@kbn/field-formats-plugin/public'; +import { WORKFLOWS_EXECUTIONS_INDEX } from '../../../common'; + +export const WORKFLOW_EXECUTIONS_DATA_VIEW_ID = 'workflows-executions-adhoc'; + +export const WORKFLOW_EXECUTIONS_DATA_VIEW_SPEC: DataViewSpec = { + id: WORKFLOW_EXECUTIONS_DATA_VIEW_ID, + title: WORKFLOWS_EXECUTIONS_INDEX, + timeFieldName: 'startedAt', +}; + +const keywordField = (name: string): FieldSpec => ({ + name, + type: 'string', + esTypes: ['keyword'], + searchable: true, + aggregatable: true, + readFromDocValues: true, + scripted: false, +}); + +const dateField = (name: string): FieldSpec => ({ + name, + type: 'date', + esTypes: ['date'], + searchable: true, + aggregatable: true, + readFromDocValues: true, + scripted: false, +}); + +const booleanField = (name: string): FieldSpec => ({ + name, + type: 'boolean', + esTypes: ['boolean'], + searchable: true, + aggregatable: true, + readFromDocValues: true, + scripted: false, +}); + +export function createWorkflowExecutionsDataView(fieldFormats: FieldFormatsStart): DataView { + const fields: Record = { + startedAt: dateField('startedAt'), + createdAt: dateField('createdAt'), + finishedAt: dateField('finishedAt'), + id: keywordField('id'), + workflowId: keywordField('workflowId'), + status: keywordField('status'), + triggeredBy: keywordField('triggeredBy'), + executedBy: keywordField('executedBy'), + createdBy: keywordField('createdBy'), + isTestRun: booleanField('isTestRun'), + spaceId: keywordField('spaceId'), + }; + + return new DataView({ + spec: { + ...WORKFLOW_EXECUTIONS_DATA_VIEW_SPEC, + allowNoIndex: true, + fields, + }, + fieldFormats, + metaFields: ['_id', '_type', '_source'], + }); +} diff --git a/src/platform/plugins/shared/workflows_management/public/pages/executions/workflow_executions_filter_search_scaffold.tsx b/src/platform/plugins/shared/workflows_management/public/pages/executions/workflow_executions_filter_search_scaffold.tsx deleted file mode 100644 index 651943b039fb6..0000000000000 --- a/src/platform/plugins/shared/workflows_management/public/pages/executions/workflow_executions_filter_search_scaffold.tsx +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the "Elastic License - * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { - EuiFieldSearch, - EuiFilterButton, - EuiFilterGroup, - EuiFlexGroup, - EuiFlexItem, - EuiScreenReaderOnly, -} from '@elastic/eui'; -import { css } from '@emotion/react'; -import React from 'react'; -import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n-react'; - -const searchBarWrapperCss = css` - min-width: 200px; - & .euiPopover { - display: block; - } -`; - -const searchAriaLabel = i18n.translate( - 'workflowsManagement.executionsPage.searchScaffoldAriaLabel', - { - defaultMessage: 'Search executions (not yet available)', - } -); - -const searchPlaceholder = i18n.translate( - 'workflowsManagement.executionsPage.searchScaffoldPlaceholder', - { - defaultMessage: 'Execution ID / workflow name', - } -); - -const filterStatusLabel = i18n.translate( - 'workflowsManagement.executionsPage.filterScaffoldStatus', - { - defaultMessage: 'Status', - } -); - -const filterWorkflowLabel = i18n.translate( - 'workflowsManagement.executionsPage.filterScaffoldWorkflow', - { - defaultMessage: 'Workflow', - } -); - -const filterTimeRangeLabel = i18n.translate( - 'workflowsManagement.executionsPage.filterScaffoldTimeRange', - { - defaultMessage: 'Time range', - } -); - -export const WorkflowExecutionsFilterSearchScaffold = React.memo(() => ( -
- -

- -

-
- - - - - - - - {filterStatusLabel} - - - - - - - {filterWorkflowLabel} - - - - - - - {filterTimeRangeLabel} - - - - -
-)); -WorkflowExecutionsFilterSearchScaffold.displayName = 'WorkflowExecutionsFilterSearchScaffold'; diff --git a/src/platform/plugins/shared/workflows_management/public/pages/executions/workflow_executions_filters.tsx b/src/platform/plugins/shared/workflows_management/public/pages/executions/workflow_executions_filters.tsx new file mode 100644 index 0000000000000..8ba4b8c2159db --- /dev/null +++ b/src/platform/plugins/shared/workflows_management/public/pages/executions/workflow_executions_filters.tsx @@ -0,0 +1,105 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import React, { useCallback, useMemo } from 'react'; +import { useHistory, useLocation } from 'react-router-dom'; +import { AlertFilterControls } from '@kbn/alerts-ui-shared/src/alert_filter_controls'; +import type { FilterControlConfig } from '@kbn/alerts-ui-shared/src/alert_filter_controls/types'; +import type { Filter, Query, TimeRange } from '@kbn/es-query'; +import { createKbnUrlStateStorage, Storage } from '@kbn/kibana-utils-plugin/public'; +import { convertCamelCasedKeysToSnakeCase } from '@kbn/presentation-publishing'; +import { + WORKFLOW_EXECUTIONS_DATA_VIEW_ID, + WORKFLOW_EXECUTIONS_DATA_VIEW_SPEC, +} from './workflow_executions_data_view'; +import { + DEFAULT_EXECUTION_PAGE_FILTERS, + EXECUTION_FILTERS_STORAGE_KEY, + EXECUTION_FILTERS_URL_PARAM_KEY, +} from './workflow_executions_page_constants'; +import { useKibana } from '../../hooks/use_kibana'; +import { useSpaceId } from '../../hooks/use_space_id'; + +export interface WorkflowExecutionsFiltersProps { + filters: Filter[]; + query?: Query; + timeRange: TimeRange; + onFiltersChange: (filters: Filter[]) => void; +} + +export const WorkflowExecutionsFilters = React.memo( + ({ filters, query, timeRange, onFiltersChange }) => { + const { http, notifications, dataViews } = useKibana().services; + const spaceId = useSpaceId(); + const history = useHistory(); + const location = useLocation(); + + const urlStorage = useMemo( + () => + createKbnUrlStateStorage({ + history, + useHash: false, + useHashQuery: false, + }), + [history] + ); + + const persisted = urlStorage.get( + EXECUTION_FILTERS_URL_PARAM_KEY + ); + const controlsUrlState = persisted + ? persisted.map(convertCamelCasedKeysToSnakeCase) + : undefined; + + const setControlsUrlState = useCallback( + (next: FilterControlConfig[]) => { + urlStorage.set(EXECUTION_FILTERS_URL_PARAM_KEY, next); + }, + [urlStorage] + ); + + const services = useMemo( + () => ({ + http, + notifications, + dataViews, + storage: Storage, + }), + [http, notifications, dataViews] + ); + + if (!spaceId) { + return null; + } + + return ( +
+ +
+ ); + } +); +WorkflowExecutionsFilters.displayName = 'WorkflowExecutionsFilters'; diff --git a/src/platform/plugins/shared/workflows_management/public/pages/executions/workflow_executions_page_constants.ts b/src/platform/plugins/shared/workflows_management/public/pages/executions/workflow_executions_page_constants.ts new file mode 100644 index 0000000000000..e343dea771606 --- /dev/null +++ b/src/platform/plugins/shared/workflows_management/public/pages/executions/workflow_executions_page_constants.ts @@ -0,0 +1,43 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import type { FilterControlConfig } from '@kbn/alerts-ui-shared/src/alert_filter_controls/types'; +import { i18n } from '@kbn/i18n'; + +export const EXECUTION_FILTERS_URL_PARAM_KEY = 'workflowsExecutionsPageFilters' as const; +export const EXECUTION_FILTERS_STORAGE_KEY = 'workflows.executions.pageFilters' as const; + +export const DEFAULT_EXECUTION_PAGE_FILTERS: FilterControlConfig[] = [ + { + title: i18n.translate('workflowsManagement.executionsPage.filterStatus', { + defaultMessage: 'Status', + }), + field_name: 'status', + persist: true, + }, + { + title: i18n.translate('workflowsManagement.executionsPage.filterWorkflow', { + defaultMessage: 'Workflow', + }), + field_name: 'workflowId', + persist: true, + }, + { + title: i18n.translate('workflowsManagement.executionsPage.filterExecutedBy', { + defaultMessage: 'Executed by', + }), + field_name: 'executedBy', + }, + { + title: i18n.translate('workflowsManagement.executionsPage.filterTrigger', { + defaultMessage: 'Trigger', + }), + field_name: 'triggeredBy', + }, +]; diff --git a/src/platform/plugins/shared/workflows_management/public/pages/executions/workflow_executions_page_content.tsx b/src/platform/plugins/shared/workflows_management/public/pages/executions/workflow_executions_page_content.tsx new file mode 100644 index 0000000000000..5aef1227e8225 --- /dev/null +++ b/src/platform/plugins/shared/workflows_management/public/pages/executions/workflow_executions_page_content.tsx @@ -0,0 +1,102 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { EuiHorizontalRule, EuiSpacer } from '@elastic/eui'; +import React, { useCallback, useMemo, useState } from 'react'; +import type { Filter, Query, TimeRange } from '@kbn/es-query'; +import { createWorkflowExecutionsDataView } from './workflow_executions_data_view'; +import { WorkflowExecutionsFilters } from './workflow_executions_filters'; +import { WorkflowExecutionsSearchBar } from './workflow_executions_search_bar'; +import { WorkflowExecutionsTable } from './workflow_executions_table'; +import { useKibana } from '../../hooks/use_kibana'; +import { useSpaceId } from '../../hooks/use_space_id'; + +const DEFAULT_TIME_RANGE: TimeRange = { + from: 'now-24h', + to: 'now', +}; + +const DEFAULT_QUERY: Query = { + query: '', + language: 'kuery', +}; + +const EMPTY_FILTERS: Filter[] = []; + +export const WorkflowExecutionsPageContent = React.memo(() => { + const { fieldFormats } = useKibana().services; + const spaceId = useSpaceId(); + const dataView = useMemo(() => createWorkflowExecutionsDataView(fieldFormats), [fieldFormats]); + + const [query, setQuery] = useState(DEFAULT_QUERY); + const [submittedQuery, setSubmittedQuery] = useState(DEFAULT_QUERY); + const [timeRange, setTimeRange] = useState(DEFAULT_TIME_RANGE); + const [controlFilters, setControlFilters] = useState(EMPTY_FILTERS); + const [searchBarFilters, setSearchBarFilters] = useState(EMPTY_FILTERS); + + const combinedFilters = useMemo( + () => [...controlFilters, ...searchBarFilters], + [controlFilters, searchBarFilters] + ); + + const handleQueryChange = useCallback( + ({ query: nextQuery, dateRange }: { query?: Query; dateRange: TimeRange }) => { + if (nextQuery) { + setQuery(nextQuery); + } + setTimeRange(dateRange); + }, + [] + ); + + const handleQuerySubmit = useCallback( + ({ query: nextQuery, dateRange }: { query?: Query; dateRange: TimeRange }) => { + if (nextQuery) { + setQuery(nextQuery); + setSubmittedQuery(nextQuery); + } + setTimeRange(dateRange); + }, + [] + ); + + return ( +
+ + + + + + + {spaceId ? ( + + ) : null} +
+ ); +}); +WorkflowExecutionsPageContent.displayName = 'WorkflowExecutionsPageContent'; diff --git a/src/platform/plugins/shared/workflows_management/public/pages/executions/workflow_executions_search_bar.tsx b/src/platform/plugins/shared/workflows_management/public/pages/executions/workflow_executions_search_bar.tsx new file mode 100644 index 0000000000000..8f78d7d2a31b4 --- /dev/null +++ b/src/platform/plugins/shared/workflows_management/public/pages/executions/workflow_executions_search_bar.tsx @@ -0,0 +1,59 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import React from 'react'; +import type { DataView } from '@kbn/data-views-plugin/common'; +import type { Filter, Query, TimeRange } from '@kbn/es-query'; +import { i18n } from '@kbn/i18n'; +import { useKibana } from '../../hooks/use_kibana'; + +export interface WorkflowExecutionsSearchBarProps { + dataView: DataView; + query: Query; + timeRange: TimeRange; + filters: Filter[]; + onQueryChange: (payload: { query?: Query; dateRange: TimeRange }) => void; + onQuerySubmit: (payload: { query?: Query; dateRange: TimeRange }) => void; + onFiltersUpdated: (filters: Filter[]) => void; +} + +export const WorkflowExecutionsSearchBar = React.memo( + ({ dataView, query, timeRange, filters, onQueryChange, onQuerySubmit, onFiltersUpdated }) => { + const { unifiedSearch } = useKibana().services; + const { SearchBar } = unifiedSearch.ui; + + return ( +
+ +
+ ); + } +); +WorkflowExecutionsSearchBar.displayName = 'WorkflowExecutionsSearchBar'; diff --git a/src/platform/plugins/shared/workflows_management/public/pages/executions/workflow_executions_search_query.test.ts b/src/platform/plugins/shared/workflows_management/public/pages/executions/workflow_executions_search_query.test.ts new file mode 100644 index 0000000000000..1d8b4f86a3d51 --- /dev/null +++ b/src/platform/plugins/shared/workflows_management/public/pages/executions/workflow_executions_search_query.test.ts @@ -0,0 +1,80 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { + buildWorkflowExecutionsSearchFilters, + getWorkflowExecutionsFetchErrorMessage, + isWorkflowExecutionsIndexNotFoundError, +} from './workflow_executions_search_query'; + +describe('workflow_executions_search_query', () => { + describe('buildWorkflowExecutionsSearchFilters', () => { + it('includes user filters, space, step-run exclusion, and time range', () => { + const userFilters = [ + { + meta: { alias: 'status filter', disabled: false }, + query: { term: { status: 'completed' } }, + }, + ]; + + const filters = buildWorkflowExecutionsSearchFilters({ + spaceId: 'default', + timeRange: { from: 'now-24h', to: 'now' }, + timeField: 'startedAt', + userFilters, + }); + + expect(filters).toHaveLength(4); + expect(filters[0]).toBe(userFilters[0]); + expect(filters[1].query).toEqual({ + bool: { + should: [ + { term: { spaceId: 'default' } }, + { bool: { must_not: { exists: { field: 'spaceId' } } } }, + ], + minimum_should_match: 1, + }, + }); + expect(filters[2].query).toEqual({ + bool: { + must_not: { exists: { field: 'stepId' } }, + }, + }); + expect(filters[3].query).toEqual({ + range: { + startedAt: { + gte: 'now-24h', + lte: 'now', + format: 'strict_date_optional_time', + }, + }, + }); + }); + }); + + describe('isWorkflowExecutionsIndexNotFoundError', () => { + it('returns true for index_not_found_exception', () => { + const error = { + body: { error: { type: 'index_not_found_exception', reason: 'missing' } }, + }; + + expect(isWorkflowExecutionsIndexNotFoundError(error)).toBe(true); + }); + + it('returns false for other errors', () => { + expect(isWorkflowExecutionsIndexNotFoundError(new Error('other'))).toBe(false); + }); + }); + + describe('getWorkflowExecutionsFetchErrorMessage', () => { + it('returns a generic message', () => { + expect(getWorkflowExecutionsFetchErrorMessage()).toBe('Failed to load executions'); + }); + }); +}); diff --git a/src/platform/plugins/shared/workflows_management/public/pages/executions/workflow_executions_search_query.ts b/src/platform/plugins/shared/workflows_management/public/pages/executions/workflow_executions_search_query.ts new file mode 100644 index 0000000000000..7eda56c60b1b0 --- /dev/null +++ b/src/platform/plugins/shared/workflows_management/public/pages/executions/workflow_executions_search_query.ts @@ -0,0 +1,83 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import type { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/types'; +import type { Filter, TimeRange } from '@kbn/es-query'; +import { i18n } from '@kbn/i18n'; + +interface ElasticsearchErrorBody { + error?: { + type?: string; + }; +} + +const isElasticsearchResponseError = (error: unknown): error is { body: ElasticsearchErrorBody } => + typeof error === 'object' && + error !== null && + 'body' in error && + typeof (error as { body?: unknown }).body === 'object'; + +const buildSpaceFilterQuery = (spaceId: string): QueryDslQueryContainer => ({ + bool: { + should: [{ term: { spaceId } }, { bool: { must_not: { exists: { field: 'spaceId' } } } }], + minimum_should_match: 1, + }, +}); + +const buildOmitStepRunsFilterQuery = (): QueryDslQueryContainer => ({ + bool: { + must_not: { exists: { field: 'stepId' } }, + }, +}); + +const buildTimeRangeFilter = (timeRange: TimeRange, timeField: string): Filter => ({ + query: { + range: { + [timeField]: { + gte: timeRange.from, + lte: timeRange.to, + format: 'strict_date_optional_time', + }, + }, + }, + meta: { + type: 'custom', + }, +}); + +export const buildWorkflowExecutionsSearchFilters = ({ + spaceId, + timeRange, + timeField, + userFilters, +}: { + spaceId: string; + timeRange: TimeRange; + timeField: string; + userFilters: Filter[]; +}): Filter[] => [ + ...userFilters, + { + meta: { type: 'custom', disabled: false }, + query: buildSpaceFilterQuery(spaceId), + }, + { + meta: { type: 'custom', disabled: false }, + query: buildOmitStepRunsFilterQuery(), + }, + buildTimeRangeFilter(timeRange, timeField), +]; + +export const isWorkflowExecutionsIndexNotFoundError = (error: unknown): boolean => + isElasticsearchResponseError(error) && error.body.error?.type === 'index_not_found_exception'; + +export const getWorkflowExecutionsFetchErrorMessage = (): string => + i18n.translate('workflowsManagement.executionsPage.fetchError', { + defaultMessage: 'Failed to load executions', + }); diff --git a/src/platform/plugins/shared/workflows_management/public/pages/executions/workflow_executions_stub_data_grid.tsx b/src/platform/plugins/shared/workflows_management/public/pages/executions/workflow_executions_stub_data_grid.tsx deleted file mode 100644 index 5bee2079c4eb5..0000000000000 --- a/src/platform/plugins/shared/workflows_management/public/pages/executions/workflow_executions_stub_data_grid.tsx +++ /dev/null @@ -1,164 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the "Elastic License - * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { css } from '@emotion/react'; -import React, { useCallback, useMemo, useState } from 'react'; -import { CellActionsProvider } from '@kbn/cell-actions'; -import { DataView, type FieldSpec } from '@kbn/data-views-plugin/common'; -import type { DataTableRecord } from '@kbn/discover-utils/types'; -import { Storage } from '@kbn/kibana-utils-plugin/public'; -import type { UiActionsStart } from '@kbn/ui-actions-plugin/public'; -import { DataLoadingState, type SortOrder, UnifiedDataTable } from '@kbn/unified-data-table'; -import { - STATIC_WORKFLOW_EXECUTION_ROWS, - WORKFLOW_EXECUTIONS_STUB_DATA_VIEW_TITLE, - type WorkflowExecutionListStubRow, -} from './static_execution_rows'; -import type { WorkflowsServices } from '../../types'; - -const INITIAL_COLUMNS: string[] = [ - '@timestamp', - 'workflow_name', - 'status', - 'execution_id', - 'trigger_type', -]; - -const sortOrder: SortOrder[] = []; - -const noopGetTriggerCompatibleActions: UiActionsStart['getTriggerCompatibleActions'] = - async () => []; - -function stringField(name: string): FieldSpec { - return { - name, - type: 'string', - esTypes: ['keyword'], - searchable: true, - aggregatable: true, - readFromDocValues: true, - scripted: false, - }; -} - -function dateField(name: string): FieldSpec { - return { - name, - type: 'date', - esTypes: ['date'], - searchable: true, - aggregatable: true, - readFromDocValues: true, - scripted: false, - }; -} - -function createStubExecutionsDataView(fieldFormats: WorkflowsServices['fieldFormats']): DataView { - const fields: Record = { - '@timestamp': dateField('@timestamp'), - execution_id: stringField('execution_id'), - workflow_name: stringField('workflow_name'), - status: stringField('status'), - trigger_type: stringField('trigger_type'), - }; - - return new DataView({ - spec: { - title: WORKFLOW_EXECUTIONS_STUB_DATA_VIEW_TITLE, - allowNoIndex: true, - timeFieldName: '@timestamp', - fields, - }, - fieldFormats, - metaFields: ['_id', '_type', '_source'], - }); -} - -function rowsToDataTableRecords(rows: WorkflowExecutionListStubRow[]): DataTableRecord[] { - return rows.map( - (row) => - ({ - id: row.execution_id, - raw: row, - flattened: row, - } as unknown as DataTableRecord) - ); -} - -const ROWS_PER_PAGE_OPTIONS = [10, 25]; -const DEFAULT_ROWS_PER_PAGE = 10; - -export interface WorkflowExecutionsStubDataGridProps { - services: WorkflowsServices; -} - -export const WorkflowExecutionsStubDataGrid = React.memo( - ({ services }) => { - const { data, fieldFormats, notifications, theme, uiSettings } = services; - - const dataView = useMemo(() => createStubExecutionsDataView(fieldFormats), [fieldFormats]); - - const [columns, setColumns] = useState(INITIAL_COLUMNS); - const [rowsPerPage, setRowsPerPage] = useState(DEFAULT_ROWS_PER_PAGE); - - const rows = useMemo(() => rowsToDataTableRecords(STATIC_WORKFLOW_EXECUTION_ROWS), []); - - const unifiedTableServices = useMemo( - () => ({ - data, - theme, - uiSettings, - toastNotifications: notifications.toasts, - fieldFormats, - storage: new Storage(localStorage), - }), - [data, fieldFormats, notifications.toasts, theme, uiSettings] - ); - - const onSetColumns = useCallback((next: string[]) => { - setColumns(next); - }, []); - - return ( - - - - ); - } -); -WorkflowExecutionsStubDataGrid.displayName = 'WorkflowExecutionsStubDataGrid'; diff --git a/src/platform/plugins/shared/workflows_management/public/pages/executions/workflow_executions_table.test.tsx b/src/platform/plugins/shared/workflows_management/public/pages/executions/workflow_executions_table.test.tsx new file mode 100644 index 0000000000000..1dc9f13660e20 --- /dev/null +++ b/src/platform/plugins/shared/workflows_management/public/pages/executions/workflow_executions_table.test.tsx @@ -0,0 +1,152 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { errors } from '@elastic/elasticsearch'; +import { render, screen, waitFor } from '@testing-library/react'; +import React from 'react'; +import { of, throwError } from 'rxjs'; +import { searchSourceInstanceMock } from '@kbn/data-plugin/common/search/search_source/mocks'; +import { createWorkflowExecutionsDataView } from './workflow_executions_data_view'; +import { WorkflowExecutionsTable } from './workflow_executions_table'; +import { createStartServicesMock } from '../../mocks'; +import { getTestProvider } from '../../shared/mocks/test_providers'; + +jest.mock('@kbn/unified-data-table', () => { + const actual = jest.requireActual('@kbn/unified-data-table'); + return { + ...actual, + UnifiedDataTable: () =>
, + }; +}); + +jest.mock('@kbn/cell-actions', () => ({ + CellActionsProvider: ({ children }: { children: React.ReactNode }) => <>{children}, +})); + +describe('WorkflowExecutionsTable', () => { + const defaultQuery = { query: '', language: 'kuery' as const }; + const defaultTimeRange = { from: 'now-24h', to: 'now' }; + + beforeEach(() => { + jest.clearAllMocks(); + jest.mocked(searchSourceInstanceMock.fetch$).mockReturnValue( + of({ + rawResponse: { + hits: { + hits: [], + total: { value: 0, relation: 'eq' }, + }, + }, + }) as unknown as ReturnType + ); + }); + + it('queries with space scoping and step-run exclusion filters', async () => { + const services = createStartServicesMock(); + const dataView = createWorkflowExecutionsDataView(services.fieldFormats); + + render( + , + { wrapper: getTestProvider({ services }) } + ); + + await waitFor(() => { + expect(screen.getByTestId('workflowExecutionsTableEmpty')).toBeInTheDocument(); + }); + + const filterCalls = jest + .mocked(searchSourceInstanceMock.setField) + .mock.calls.filter(([field]) => field === 'filter'); + expect(filterCalls.length).toBeGreaterThan(0); + + const searchFilters = filterCalls[filterCalls.length - 1][1] as Array<{ query: unknown }>; + expect(searchFilters).toEqual( + expect.arrayContaining([ + expect.objectContaining({ + query: { + bool: { + should: [ + { term: { spaceId: 'my-space' } }, + { bool: { must_not: { exists: { field: 'spaceId' } } } }, + ], + minimum_should_match: 1, + }, + }, + }), + expect.objectContaining({ + query: { + bool: { + must_not: { exists: { field: 'stepId' } }, + }, + }, + }), + ]) + ); + }); + + it('shows empty state when the executions index does not exist', async () => { + const services = createStartServicesMock(); + const dataView = createWorkflowExecutionsDataView(services.fieldFormats); + const indexNotFoundError = new errors.ResponseError({ + statusCode: 404, + body: { error: { type: 'index_not_found_exception', reason: 'missing' } }, + } as ConstructorParameters[0]); + + jest + .mocked(searchSourceInstanceMock.fetch$) + .mockReturnValue(throwError(() => indexNotFoundError)); + + render( + , + { wrapper: getTestProvider({ services }) } + ); + + await waitFor(() => { + expect(screen.getByTestId('workflowExecutionsTableEmpty')).toBeInTheDocument(); + }); + expect(screen.queryByTestId('workflowExecutionsTableError')).not.toBeInTheDocument(); + }); + + it('shows a generic error prompt for non-index errors', async () => { + const services = createStartServicesMock(); + const dataView = createWorkflowExecutionsDataView(services.fieldFormats); + + jest + .mocked(searchSourceInstanceMock.fetch$) + .mockReturnValue(throwError(() => new Error('cluster unavailable'))); + + render( + , + { wrapper: getTestProvider({ services }) } + ); + + await waitFor(() => { + expect(screen.getByTestId('workflowExecutionsTableError')).toBeInTheDocument(); + }); + expect(screen.getByText('Failed to load executions')).toBeInTheDocument(); + }); +}); diff --git a/src/platform/plugins/shared/workflows_management/public/pages/executions/workflow_executions_table.tsx b/src/platform/plugins/shared/workflows_management/public/pages/executions/workflow_executions_table.tsx new file mode 100644 index 0000000000000..37bc4d009c8b7 --- /dev/null +++ b/src/platform/plugins/shared/workflows_management/public/pages/executions/workflow_executions_table.tsx @@ -0,0 +1,360 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { + EuiButtonEmpty, + EuiCallOut, + EuiEmptyPrompt, + EuiPanel, + EuiSkeletonText, + EuiTablePagination, +} from '@elastic/eui'; +import { css } from '@emotion/react'; +import React, { useCallback, useEffect, useMemo, useState } from 'react'; +import { take } from 'rxjs'; +import { CellActionsProvider } from '@kbn/cell-actions'; +import { SortDirection } from '@kbn/data-plugin/public'; +import type { DataView } from '@kbn/data-views-plugin/common'; +import { buildDataTableRecordList } from '@kbn/discover-utils'; +import type { DataTableRecord, EsHitRecord } from '@kbn/discover-utils/types'; +import type { Filter, Query, TimeRange } from '@kbn/es-query'; +import type { ESSearchResponse, SearchHit } from '@kbn/es-types'; +import { i18n } from '@kbn/i18n'; +import { FormattedMessage } from '@kbn/i18n-react'; +import { + DataLoadingState, + type SortOrder, + UnifiedDataTable, + type UnifiedDataTableSettings, +} from '@kbn/unified-data-table'; +import type { EsWorkflowExecution } from '@kbn/workflows'; +import { WorkflowExecutionDetailFlyout } from './workflow_execution_detail_flyout'; +import { + buildWorkflowExecutionsSearchFilters, + getWorkflowExecutionsFetchErrorMessage, + isWorkflowExecutionsIndexNotFoundError, +} from './workflow_executions_search_query'; +import { useKibana } from '../../hooks/use_kibana'; + +const DEFAULT_COLUMNS = ['workflowId', 'status', 'id', 'triggeredBy', 'executedBy'] as const; +const DEFAULT_PAGE_SIZE = 25; +const PAGE_SIZE_OPTIONS = [10, 25, 50, 100]; +const DEFAULT_SORT: SortOrder[] = [['startedAt', 'desc']]; + +const gridStyleOverride = { + border: 'all' as const, + header: 'shade' as const, + stripes: false, +}; + +const tableContainerCss = css` + display: flex; + flex-direction: column; + flex: 1 1 auto; + min-height: 0; +`; + +const gridWrapperCss = css` + flex: 1 1 auto; +`; + +export interface WorkflowExecutionsTableProps { + dataView: DataView; + query: Query; + filters: Filter[]; + timeRange: TimeRange; + spaceId: string; +} + +export const WorkflowExecutionsTable = React.memo( + ({ dataView, query, filters, timeRange, spaceId }) => { + const { + data: dataService, + fieldFormats, + notifications: { toasts }, + storage, + theme, + uiActions, + uiSettings, + } = useKibana().services; + + const [hits, setHits] = useState([]); + const [total, setTotal] = useState(0); + const [loadingState, setLoadingState] = useState(DataLoadingState.loading); + const [error, setError] = useState(null); + + const [pageIndex, setPageIndex] = useState(0); + const [pageSize, setPageSize] = useState(DEFAULT_PAGE_SIZE); + const [sort, setSort] = useState(DEFAULT_SORT); + const [visibleColumns, setVisibleColumns] = useState(Array.from(DEFAULT_COLUMNS)); + const [gridSettings, setGridSettings] = useState({}); + const [expandedDoc, setExpandedDoc] = useState(); + const [retryToken, setRetryToken] = useState(0); + const timeFrom = timeRange.from; + const timeTo = timeRange.to; + + useEffect(() => { + let cancelled = false; + + const fetchExecutions = async () => { + setLoadingState(DataLoadingState.loading); + setError(null); + + try { + const searchSource = await dataService.search.searchSource.create(); + const timeField = dataView.timeFieldName ?? 'startedAt'; + const searchFilters = buildWorkflowExecutionsSearchFilters({ + spaceId, + timeRange: { from: timeFrom, to: timeTo }, + timeField, + userFilters: filters, + }); + + searchSource.setField('index', dataView); + + if (query?.query) { + searchSource.setField('query', query); + } + + searchSource.setField('filter', searchFilters); + searchSource.setField('from', pageIndex * pageSize); + searchSource.setField('size', pageSize); + searchSource.setField( + 'sort', + sort.map(([field, direction]) => ({ + [field]: { + order: direction === 'asc' ? SortDirection.asc : SortDirection.desc, + }, + })) + ); + searchSource.setField('trackTotalHits', true); + + const response = await searchSource.fetch$().pipe(take(1)).toPromise(); + + if (cancelled) { + return; + } + + const rawResponse = response?.rawResponse as + | ESSearchResponse + | undefined; + const responseHits = (rawResponse?.hits?.hits ?? []).filter( + (hit: SearchHit): hit is SearchHit => + hit._source != null + ) as unknown as EsHitRecord[]; + const totalHits = rawResponse?.hits?.total; + const totalCount = + typeof totalHits === 'number' ? totalHits : totalHits?.value ?? responseHits.length; + + setHits(responseHits); + setTotal(totalCount); + setLoadingState(DataLoadingState.loaded); + } catch (err) { + if (cancelled) { + return; + } + + if (isWorkflowExecutionsIndexNotFoundError(err)) { + setHits([]); + setTotal(0); + setError(null); + setLoadingState(DataLoadingState.loaded); + return; + } + + setError(getWorkflowExecutionsFetchErrorMessage()); + setHits([]); + setTotal(0); + setLoadingState(DataLoadingState.loaded); + } + }; + + fetchExecutions(); + + return () => { + cancelled = true; + }; + }, [ + dataService.search.searchSource, + dataView, + filters, + pageIndex, + pageSize, + query, + retryToken, + sort, + spaceId, + timeFrom, + timeTo, + ]); + + useEffect(() => { + setPageIndex(0); + setExpandedDoc(undefined); + }, [query, filters, spaceId, timeFrom, timeTo]); + + const handleRetry = useCallback(() => { + setRetryToken((n) => n + 1); + }, []); + + const rows = useMemo( + () => buildDataTableRecordList({ records: hits, dataView }), + [hits, dataView] + ); + + const services = useMemo( + () => ({ + theme, + fieldFormats, + uiSettings, + toastNotifications: toasts, + storage, + data: dataService, + }), + [dataService, fieldFormats, storage, theme, toasts, uiSettings] + ); + + const handleSort = useCallback((nextSort: string[][]) => { + setSort(nextSort.length === 0 ? DEFAULT_SORT : (nextSort as SortOrder[])); + setPageIndex(0); + }, []); + + const handleSetColumns = useCallback((nextColumns: string[]) => { + setVisibleColumns(nextColumns); + }, []); + + const handleResize = useCallback((resized: { columnId: string; width: number | undefined }) => { + setGridSettings((prev) => ({ + ...prev, + columns: { + ...prev.columns, + [resized.columnId]: { + ...prev.columns?.[resized.columnId], + width: resized.width, + }, + }, + })); + }, []); + + const handlePageChange = useCallback((nextPageIndex: number) => { + setPageIndex(nextPageIndex); + }, []); + + const handlePageSizeChange = useCallback((nextPageSize: number) => { + setPageSize(nextPageSize); + setPageIndex(0); + }, []); + + const handleCloseFlyout = useCallback(() => { + setExpandedDoc(undefined); + }, []); + + const renderDocumentView = useCallback( + (hit: DataTableRecord) => ( + + ), + [handleCloseFlyout] + ); + + const totalPages = Math.max(1, Math.ceil(total / pageSize)); + + if (error) { + return ( + + + + } + body={

{error}

} + actions={ + + + + } + /> + ); + } + + if (loadingState === DataLoadingState.loading && rows.length === 0) { + return ( + + + + ); + } + + if (rows.length === 0) { + return ( + + + + ); + } + + return ( +
+
+ + + +
+ +
+ ); + } +); +WorkflowExecutionsTable.displayName = 'WorkflowExecutionsTable'; diff --git a/src/platform/plugins/shared/workflows_management/public/types.ts b/src/platform/plugins/shared/workflows_management/public/types.ts index d335c27df3c88..cf9f6017ed8a6 100644 --- a/src/platform/plugins/shared/workflows_management/public/types.ts +++ b/src/platform/plugins/shared/workflows_management/public/types.ts @@ -24,6 +24,7 @@ import type { TriggersAndActionsUIPublicPluginSetup, TriggersAndActionsUIPublicPluginStart, } from '@kbn/triggers-actions-ui-plugin/public'; +import type { UiActionsStart } from '@kbn/ui-actions-plugin/public'; import type { UnifiedSearchPublicPluginStart } from '@kbn/unified-search-plugin/public'; import type { WorkflowsExtensionsPublicPluginStart } from '@kbn/workflows-extensions/public'; import type { @@ -79,6 +80,7 @@ export interface WorkflowsPublicPluginStartDependencies { triggersActionsUi: TriggersAndActionsUIPublicPluginStart; workflowsExtensions: WorkflowsExtensionsPublicPluginStart; licensing: LicensingPluginStart; + uiActions: UiActionsStart; cloud?: CloudStart; } From b445b6065ea4d3587a2c66e702970bb3251a10c5 Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Tue, 19 May 2026 14:39:07 +0000 Subject: [PATCH 2/6] Changes from node scripts/lint_ts_projects --fix --- src/platform/plugins/shared/workflows_management/tsconfig.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/platform/plugins/shared/workflows_management/tsconfig.json b/src/platform/plugins/shared/workflows_management/tsconfig.json index 6b7d51a3fbb3d..001f617d6bc82 100644 --- a/src/platform/plugins/shared/workflows_management/tsconfig.json +++ b/src/platform/plugins/shared/workflows_management/tsconfig.json @@ -100,7 +100,8 @@ "@kbn/rule-data-utils", "@kbn/inbox-plugin", "@kbn/inbox-common", - "@kbn/core-saved-objects-common" + "@kbn/core-saved-objects-common", + "@kbn/presentation-publishing" ], "exclude": ["target/**/*"] } From a4ba827a77fea246d0918eb033b13f0e69527a01 Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Tue, 19 May 2026 14:44:57 +0000 Subject: [PATCH 3/6] Changes from node scripts/regenerate_moon_projects.js --update --- src/platform/plugins/shared/workflows_management/moon.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/platform/plugins/shared/workflows_management/moon.yml b/src/platform/plugins/shared/workflows_management/moon.yml index 82eaf053b0280..23c4fc1bf942e 100644 --- a/src/platform/plugins/shared/workflows_management/moon.yml +++ b/src/platform/plugins/shared/workflows_management/moon.yml @@ -103,6 +103,7 @@ dependsOn: - '@kbn/inbox-plugin' - '@kbn/inbox-common' - '@kbn/core-saved-objects-common' + - '@kbn/presentation-publishing' tags: - plugin - prod From 47b69e660064985cbbd94a0fa23ee732ff9c2fa1 Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Tue, 19 May 2026 16:23:16 +0000 Subject: [PATCH 4/6] Changes from make api-docs --- oas_docs/output/kibana.serverless.yaml | 57 ++++++++++++++++++++++++-- oas_docs/output/kibana.yaml | 57 ++++++++++++++++++++++++-- 2 files changed, 106 insertions(+), 8 deletions(-) diff --git a/oas_docs/output/kibana.serverless.yaml b/oas_docs/output/kibana.serverless.yaml index fe6ad86b06e95..ff33182b0828c 100644 --- a/oas_docs/output/kibana.serverless.yaml +++ b/oas_docs/output/kibana.serverless.yaml @@ -15030,6 +15030,8 @@ paths: description: success '403': description: forbidden + '500': + description: internal server error summary: Search dashboards tags: - Dashboards @@ -16025,6 +16027,8 @@ paths: description: forbidden '404': description: not found + '500': + description: internal server error summary: Delete a dashboard tags: - Dashboards @@ -16233,10 +16237,14 @@ paths: updated_at: '2026-04-13T10:00:00.000Z' version: WzEwMiwxXQ== description: success + '400': + description: invalid response '403': description: forbidden '404': description: not found + '500': + description: internal server error summary: Get a dashboard tags: - Dashboards @@ -83360,7 +83368,7 @@ paths: required: false schema: type: string - - description: Page number. + - description: The page of results to return. in: query name: page required: false @@ -83368,7 +83376,7 @@ paths: default: 1 minimum: 1 type: number - - description: Results per page. + - description: The number of results to return per page. in: query name: per_page required: false @@ -83395,11 +83403,18 @@ paths: type: object properties: page: + default: 1 + description: The returned page of results. + minimum: 1 type: number per_page: + default: 20 + description: The number of results returned per page. + maximum: 1000 + minimum: 1 type: number total: - description: Total number of matching visualizations. + description: The total number of results matching the query. type: number required: - total @@ -95967,6 +95982,7 @@ components: - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankBySignificant' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByMetric' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByCustomOperation' + - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByCustomCountOperation' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByPercentileOperation' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByPercentileRankOperation' visible: @@ -104439,6 +104455,7 @@ components: - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankBySignificant' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByMetric' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByCustomOperation' + - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByCustomCountOperation' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByPercentileOperation' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByPercentileRankOperation' required: @@ -111336,6 +111353,7 @@ components: - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankBySignificant' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByMetric' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByCustomOperation' + - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByCustomCountOperation' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByPercentileOperation' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByPercentileRankOperation' required: @@ -111571,6 +111589,7 @@ components: - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankBySignificant' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByMetric' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByCustomOperation' + - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByCustomCountOperation' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByPercentileOperation' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByPercentileRankOperation' required: @@ -114632,6 +114651,7 @@ components: - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankBySignificant' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByMetric' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByCustomOperation' + - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByCustomCountOperation' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByPercentileOperation' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByPercentileRankOperation' required: @@ -116184,6 +116204,7 @@ components: - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankBySignificant' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByMetric' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByCustomOperation' + - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByCustomCountOperation' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByPercentileOperation' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByPercentileRankOperation' required: @@ -119406,6 +119427,7 @@ components: - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankBySignificant' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByMetric' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByCustomOperation' + - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByCustomCountOperation' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByPercentileOperation' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByPercentileRankOperation' required: @@ -119487,6 +119509,7 @@ components: - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankBySignificant' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByMetric' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByCustomOperation' + - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByCustomCountOperation' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByPercentileOperation' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByPercentileRankOperation' required: @@ -119517,6 +119540,29 @@ components: - desc title: termsRankByAlphabeticalDirection type: string + Kibana_HTTP_APIs_termsRankByCustomCountOperation: + additionalProperties: false + description: Terms ranked by count, either of all documents or of a specific field. + properties: + direction: + $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByCustomDirection' + field: + description: Numeric field to be used for the custom operation. + type: string + operation: + enum: + - count + type: string + type: + enum: + - custom + type: string + required: + - type + - direction + - operation + title: Terms Rank By Custom Count Operation + type: object Kibana_HTTP_APIs_termsRankByCustomDirection: description: Sort direction for custom ranking. enum: @@ -119541,7 +119587,6 @@ components: - median - standard_deviation - unique_count - - count - sum - last_value type: string @@ -120387,6 +120432,7 @@ components: - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankBySignificant' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByMetric' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByCustomOperation' + - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByCustomCountOperation' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByPercentileOperation' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByPercentileRankOperation' required: @@ -122362,6 +122408,7 @@ components: - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankBySignificant' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByMetric' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByCustomOperation' + - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByCustomCountOperation' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByPercentileOperation' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByPercentileRankOperation' required: @@ -125878,6 +125925,7 @@ components: - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankBySignificant' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByMetric' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByCustomOperation' + - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByCustomCountOperation' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByPercentileOperation' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByPercentileRankOperation' required: @@ -127919,6 +127967,7 @@ components: - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankBySignificant' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByMetric' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByCustomOperation' + - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByCustomCountOperation' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByPercentileOperation' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByPercentileRankOperation' required: diff --git a/oas_docs/output/kibana.yaml b/oas_docs/output/kibana.yaml index 3fd92df5fee26..c19f8e32ed19e 100644 --- a/oas_docs/output/kibana.yaml +++ b/oas_docs/output/kibana.yaml @@ -17243,6 +17243,8 @@ paths: description: success '403': description: forbidden + '500': + description: internal server error summary: Search dashboards tags: - Dashboards @@ -18238,6 +18240,8 @@ paths: description: forbidden '404': description: not found + '500': + description: internal server error summary: Delete a dashboard tags: - Dashboards @@ -18446,10 +18450,14 @@ paths: updated_at: '2026-04-13T10:00:00.000Z' version: WzEwMiwxXQ== description: success + '400': + description: invalid response '403': description: forbidden '404': description: not found + '500': + description: internal server error summary: Get a dashboard tags: - Dashboards @@ -90844,7 +90852,7 @@ paths: required: false schema: type: string - - description: Page number. + - description: The page of results to return. in: query name: page required: false @@ -90852,7 +90860,7 @@ paths: default: 1 minimum: 1 type: number - - description: Results per page. + - description: The number of results to return per page. in: query name: per_page required: false @@ -90879,11 +90887,18 @@ paths: type: object properties: page: + default: 1 + description: The returned page of results. + minimum: 1 type: number per_page: + default: 20 + description: The number of results returned per page. + maximum: 1000 + minimum: 1 type: number total: - description: Total number of matching visualizations. + description: The total number of results matching the query. type: number required: - total @@ -108434,6 +108449,7 @@ components: - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankBySignificant' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByMetric' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByCustomOperation' + - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByCustomCountOperation' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByPercentileOperation' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByPercentileRankOperation' visible: @@ -116906,6 +116922,7 @@ components: - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankBySignificant' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByMetric' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByCustomOperation' + - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByCustomCountOperation' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByPercentileOperation' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByPercentileRankOperation' required: @@ -123803,6 +123820,7 @@ components: - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankBySignificant' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByMetric' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByCustomOperation' + - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByCustomCountOperation' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByPercentileOperation' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByPercentileRankOperation' required: @@ -124038,6 +124056,7 @@ components: - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankBySignificant' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByMetric' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByCustomOperation' + - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByCustomCountOperation' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByPercentileOperation' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByPercentileRankOperation' required: @@ -127099,6 +127118,7 @@ components: - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankBySignificant' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByMetric' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByCustomOperation' + - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByCustomCountOperation' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByPercentileOperation' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByPercentileRankOperation' required: @@ -128651,6 +128671,7 @@ components: - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankBySignificant' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByMetric' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByCustomOperation' + - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByCustomCountOperation' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByPercentileOperation' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByPercentileRankOperation' required: @@ -131873,6 +131894,7 @@ components: - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankBySignificant' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByMetric' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByCustomOperation' + - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByCustomCountOperation' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByPercentileOperation' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByPercentileRankOperation' required: @@ -131954,6 +131976,7 @@ components: - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankBySignificant' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByMetric' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByCustomOperation' + - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByCustomCountOperation' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByPercentileOperation' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByPercentileRankOperation' required: @@ -131984,6 +132007,29 @@ components: - desc title: termsRankByAlphabeticalDirection type: string + Kibana_HTTP_APIs_termsRankByCustomCountOperation: + additionalProperties: false + description: Terms ranked by count, either of all documents or of a specific field. + properties: + direction: + $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByCustomDirection' + field: + description: Numeric field to be used for the custom operation. + type: string + operation: + enum: + - count + type: string + type: + enum: + - custom + type: string + required: + - type + - direction + - operation + title: Terms Rank By Custom Count Operation + type: object Kibana_HTTP_APIs_termsRankByCustomDirection: description: Sort direction for custom ranking. enum: @@ -132008,7 +132054,6 @@ components: - median - standard_deviation - unique_count - - count - sum - last_value type: string @@ -132854,6 +132899,7 @@ components: - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankBySignificant' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByMetric' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByCustomOperation' + - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByCustomCountOperation' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByPercentileOperation' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByPercentileRankOperation' required: @@ -134829,6 +134875,7 @@ components: - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankBySignificant' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByMetric' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByCustomOperation' + - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByCustomCountOperation' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByPercentileOperation' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByPercentileRankOperation' required: @@ -138345,6 +138392,7 @@ components: - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankBySignificant' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByMetric' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByCustomOperation' + - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByCustomCountOperation' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByPercentileOperation' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByPercentileRankOperation' required: @@ -140386,6 +140434,7 @@ components: - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankBySignificant' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByMetric' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByCustomOperation' + - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByCustomCountOperation' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByPercentileOperation' - $ref: '#/components/schemas/Kibana_HTTP_APIs_termsRankByPercentileRankOperation' required: From c7287dba1b28d6dfdeb1518c5e0a31bd82529ada Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Fri, 22 May 2026 09:23:58 +0000 Subject: [PATCH 5/6] Changes from make api-docs --- oas_docs/output/kibana.serverless.yaml | 3205 +----------------------- oas_docs/output/kibana.yaml | 3205 +----------------------- 2 files changed, 172 insertions(+), 6238 deletions(-) diff --git a/oas_docs/output/kibana.serverless.yaml b/oas_docs/output/kibana.serverless.yaml index 78ce27decf30d..cf9268f9be871 100644 --- a/oas_docs/output/kibana.serverless.yaml +++ b/oas_docs/output/kibana.serverless.yaml @@ -14800,2027 +14800,66 @@ paths: name: product_name /api/dashboards: get: - description: |- - **Spaces method and path for this operation:** - -
get /s/{space_id}/api/dashboards
- - Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-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. - operationId: get-dashboards - parameters: - - description: The page of results to return. Defaults to `1`. - in: query - name: page - required: false - schema: - type: number - - description: The number of results to return per page. Defaults to `20`. - in: query - name: per_page - required: false - schema: - type: number - - description: Filters results by `title` and `description` using Elasticsearch [`simple_query_string`](https://www.elastic.co/docs/reference/query-languages/query-dsl/simple-query-string-query) syntax. Multi-word terms require all words to match. - in: query - name: query - required: false - schema: - type: string - - description: 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. - in: query - name: tags - required: false - schema: - items: - type: string - maxItems: 100 - type: array - - description: 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. - in: query - name: excluded_tags - required: false - schema: - items: - type: string - maxItems: 100 - type: array - responses: - '200': - content: - application/json: - schema: - additionalProperties: false - type: object - properties: - dashboards: - description: List of dashboards matching the query. Each entry includes summary fields but not the full panel layout. - items: - additionalProperties: false - type: object - properties: - data: - additionalProperties: false - type: object - properties: - access_control: - $ref: '#/components/schemas/Kibana_HTTP_APIs_kbn-dashboard-access-control' - description: - description: A short description of the dashboard. - type: string - tags: - description: Tag IDs associated with this dashboard. - items: - type: string - maxItems: 100 - type: array - time_range: - $ref: '#/components/schemas/Kibana_HTTP_APIs_kbn-es-query-server-timeRangeSchema' - title: - description: The dashboard title. - type: string - required: - - time_range - - title - - access_control - id: - description: The dashboard ID. - type: string - meta: - $ref: '#/components/schemas/Kibana_HTTP_APIs_kbn-as-code-meta' - required: - - id - - data - - meta - type: array - page: - description: The current page number. - type: number - total: - description: The total number of dashboards matching the query. - type: number - required: - - dashboards - - total - - page - examples: - searchDashboardsResponse: - summary: Search dashboards response - description: | - 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. - value: - dashboards: - - id: 3c4b8e10-d57a-11ef-9a52-4f3c2a8d0e1b - data: - title: Web logs overview - meta: - created_at: '2026-04-13T10:00:00.000Z' - managed: false - updated_at: '2026-04-13T10:00:00.000Z' - version: WzEwMiwxXQ== - - id: 7f2a1c40-e83b-11ef-a641-7d5b3f9e1c2a - data: - time_range: - from: now-7d - to: now - title: Operations overview - meta: - created_at: '2026-04-12T08:00:00.000Z' - managed: false - updated_at: '2026-04-12T14:22:00.000Z' - version: WzEwMSwxXQ== - page: 1 - total: 2 - description: success - '403': - description: forbidden - '500': - description: internal server error - summary: Search dashboards tags: - Dashboards - x-state: Technical Preview - x-metaTags: - - content: Kibana, Elastic Cloud Serverless - name: product_name - x-codeSamples: - - lang: cURL - label: Search dashboards - cURL - source: | - curl -X GET "${KIBANA_URL}/api/dashboards?query=web+logs&per_page=10" \ - -H "Authorization: ApiKey ${API_KEY}" - - lang: Console - label: Search dashboards - Console - source: | - GET kbn:/api/dashboards?query=web+logs&per_page=10 - post: - description: |- - **Spaces method and path for this operation:** - -
post /s/{space_id}/api/dashboards
- - Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information. - - Creates a new dashboard and returns its ID, full state, and metadata. - operationId: post-dashboards - parameters: - - description: A required header to protect against CSRF attacks - in: header - name: kbn-xsrf - required: true - schema: - example: 'true' - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Kibana_HTTP_APIs_kbn-dashboard-data' - examples: - createDashboard: - summary: Create a simple dashboard - value: - title: Web logs overview - panels: - - grid: - x: 0 - 'y': 0 - w: 24 - h: 15 - type: markdown - config: - content: |- - ## Web logs overview - -   - - Created with the [Dashboards API](https://www.elastic.co/docs/api/doc/kibana) using the Kibana sample web logs dataset (`kibana_sample_data_logs`). Contains: - - This markdown panel - - 2 metrics, showing request count and average response size - - A line chart based on an ES|QL query - -   - -   - - [Learn more about dashboards](https://www.elastic.co/docs/explore-analyze/dashboards) - - grid: - x: 24 - 'y': 0 - w: 12 - h: 5 - type: vis - config: - type: metric - data_source: - type: data_view_spec - index_pattern: kibana_sample_data_logs - time_field: timestamp - metrics: - - type: primary - operation: count - - grid: - x: 36 - 'y': 0 - w: 12 - h: 5 - type: vis - config: - type: metric - data_source: - type: data_view_spec - index_pattern: kibana_sample_data_logs - time_field: timestamp - metrics: - - type: primary - operation: average - field: bytes - - grid: - x: 24 - 'y': 5 - w: 24 - h: 10 - type: vis - config: - type: xy - title: Requests 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 - createDashboardWithSectionsAndControls: - summary: Create a dashboard with sections and controls - value: - title: Operations overview - time_range: - from: now-7d - to: now - pinned_panels: - - type: options_list_control - width: medium - grow: true - config: - title: Response code - data_view_id: 90943e30-9a47-11e8-b64d-95841ca0b247 - field_name: response.keyword - panels: - - title: Key metrics - collapsed: false - grid: - 'y': 0 - panels: - - grid: - x: 0 - 'y': 0 - w: 12 - h: 5 - type: vis - config: - type: metric - data_source: - type: data_view_spec - index_pattern: kibana_sample_data_logs - time_field: timestamp - metrics: - - type: primary - operation: count - - grid: - x: 12 - 'y': 0 - w: 12 - h: 5 - type: vis - config: - type: metric - data_source: - type: data_view_spec - index_pattern: kibana_sample_data_logs - time_field: timestamp - metrics: - - type: primary - operation: average - field: bytes - - title: Traffic trends - collapsed: false - grid: - 'y': 8 - panels: - - grid: - x: 0 - 'y': 0 - w: 24 - h: 10 - type: vis - config: - type: xy - title: Requests 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 - axis: - x: - title: - visible: false - - grid: - x: 24 - 'y': 0 - w: 24 - h: 10 - type: vis - config: - type: xy - title: Requests over time (ES|QL) - 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 + summary: Get dashboards + operationId: get-dashboards-redirect + description: | + > **Technical preview** — The Dashboards API is currently in technical preview and its full reference documentation is temporarily hosted at a separate location. + > + > **[View the full Dashboards API reference →](https://elastic.github.io/dashboards-api-spec/dashboards#tag/Dashboards)** responses: - '201': - content: - application/json: - schema: - additionalProperties: false - type: object - properties: - data: - $ref: '#/components/schemas/Kibana_HTTP_APIs_kbn-dashboard-data' - id: - description: The unique ID of the dashboard, as returned by the create or search endpoints. - type: string - meta: - $ref: '#/components/schemas/Kibana_HTTP_APIs_kbn-as-code-meta' - required: - - id - - data - - meta - examples: - createDashboardResponse: - summary: Create dashboard response - description: | - 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. - value: - id: 3c4b8e10-d57a-11ef-9a52-4f3c2a8d0e1b - data: - options: - hide_panel_titles: false - hide_panel_borders: false - use_margins: true - auto_apply_filters: true - sync_colors: false - sync_cursor: true - sync_tooltips: false - panels: - - grid: - x: 0 - 'y': 0 - w: 24 - h: 15 - config: - content: '## Web logs overview' - id: a1b2c3d4-0001-4000-8000-000000000001 - type: markdown - - grid: - x: 24 - 'y': 0 - w: 12 - h: 5 - config: - title: '' - data_source: - type: data_view_spec - index_pattern: kibana_sample_data_logs - time_field: timestamp - type: metric - sampling: 1 - ignore_global_filters: false - metrics: - - type: primary - operation: count - empty_as_null: false - styling: - primary: - position: bottom - labels: - alignment: left - value: - sizing: auto - alignment: right - id: a1b2c3d4-0001-4000-8000-000000000002 - type: vis - - grid: - x: 36 - 'y': 0 - w: 12 - h: 5 - config: - title: '' - data_source: - type: data_view_spec - index_pattern: kibana_sample_data_logs - time_field: timestamp - type: metric - sampling: 1 - ignore_global_filters: false - metrics: - - type: primary - operation: average - field: bytes - styling: - primary: - position: bottom - labels: - alignment: left - value: - sizing: auto - alignment: right - id: a1b2c3d4-0001-4000-8000-000000000003 - type: vis - - grid: - x: 24 - 'y': 5 - w: 24 - h: 10 - config: - title: Requests over time - type: xy - layers: - - type: line - data_source: - type: esql - query: FROM kibana_sample_data_logs | STATS count = COUNT() BY BUCKET(@timestamp, 75, ?_tstart, ?_tend) - sampling: 1 - ignore_global_filters: false - x: - column: BUCKET(@timestamp, 75, ?_tstart, ?_tend) - 'y': - - column: count - axis_id: 'y' - axis: - x: - title: - visible: false - ticks: - visible: true - grid: - visible: true - domain: - type: fit - rounding: false - labels: - orientation: horizontal - scale: ordinal - 'y': - anchor: start - title: - visible: true - scale: linear - ticks: - visible: true - grid: - visible: true - domain: - type: full - rounding: true - labels: - orientation: horizontal - styling: - overlays: - partial_buckets: - visible: false - current_time_marker: - visible: false - interpolation: linear - points: - visibility: auto - legend: - visibility: hidden - placement: outside - position: right - layout: - type: grid - truncate: - max_lines: 1 - id: a1b2c3d4-0001-4000-8000-000000000003 - type: vis - pinned_panels: [] - access_control: - access_mode: write_restricted - title: Web logs overview - meta: - created_at: '2026-04-13T10:00:00.000Z' - managed: false - updated_at: '2026-04-13T10:00:00.000Z' - version: WzEwMiwxXQ== - description: created - '400': - description: invalid request - '403': - description: forbidden - summary: Create a dashboard + '200': + description: See the full Dashboards API reference for detailed response schemas. + post: tags: - Dashboards - x-state: Technical Preview - x-metaTags: - - content: Kibana, Elastic Cloud Serverless - name: product_name - x-codeSamples: - - lang: cURL - label: Create a dashboard (simple) - cURL - source: | - 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", - "access_control": { "access_mode": "write_restricted" }, - "panels": [ - { - "grid": { - "x": 0, - "y": 0, - "w": 24, - "h": 15 - }, - "type": "markdown", - "config": { - "content": "## Web logs overview\n\n \n\nCreated with the [Dashboards API](https://www.elastic.co/docs/api/doc/kibana) using the Kibana sample web logs dataset (`kibana_sample_data_logs`). Contains:\n- This markdown panel\n- 2 metrics, showing request count and average response size\n- A line chart based on an ES|QL query\n\n \n\n \n\n[Learn more about dashboards](https://www.elastic.co/docs/explore-analyze/dashboards)" - } - }, - { - "grid": { - "x": 24, - "y": 0, - "w": 12, - "h": 5 - }, - "type": "vis", - "config": { - "type": "metric", - "data_source": { - "type": "data_view_spec", - "index_pattern": "kibana_sample_data_logs", - "time_field": "timestamp" - }, - "metrics": [ - { - "type": "primary", - "operation": "count" - } - ] - } - }, - { - "grid": { - "x": 36, - "y": 0, - "w": 12, - "h": 5 - }, - "type": "vis", - "config": { - "type": "metric", - "data_source": { - "type": "data_view_spec", - "index_pattern": "kibana_sample_data_logs", - "time_field": "timestamp" - }, - "metrics": [ - { - "type": "primary", - "operation": "average", - "field": "bytes" - } - ] - } - }, - { - "grid": { - "x": 24, - "y": 5, - "w": 24, - "h": 10 - }, - "type": "vis", - "config": { - "type": "xy", - "title": "Requests 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 - } - } - } - } - } - ] - }' - - lang: Console - label: Create a dashboard (simple) - Console - source: | - POST kbn:/api/dashboards - { - "title": "Web logs overview", - "panels": [ - { - "grid": { - "x": 0, - "y": 0, - "w": 24, - "h": 15 - }, - "type": "markdown", - "config": { - "content": "## Web logs overview\n\n \n\nCreated with the [Dashboards API](https://www.elastic.co/docs/api/doc/kibana) using the Kibana sample web logs dataset (`kibana_sample_data_logs`). Contains:\n- This markdown panel\n- 2 metrics, showing request count and average response size\n- A line chart based on an ES|QL query\n\n \n\n \n\n[Learn more about dashboards](https://www.elastic.co/docs/explore-analyze/dashboards)" - } - }, - { - "grid": { - "x": 24, - "y": 0, - "w": 12, - "h": 5 - }, - "type": "vis", - "config": { - "type": "metric", - "data_source": { - "type": "data_view_spec", - "index_pattern": "kibana_sample_data_logs", - "time_field": "timestamp" - }, - "metrics": [ - { - "type": "primary", - "operation": "count" - } - ] - } - }, - { - "grid": { - "x": 36, - "y": 0, - "w": 12, - "h": 5 - }, - "type": "vis", - "config": { - "type": "metric", - "data_source": { - "type": "data_view_spec", - "index_pattern": "kibana_sample_data_logs", - "time_field": "timestamp" - }, - "metrics": [ - { - "type": "primary", - "operation": "average", - "field": "bytes" - } - ] - } - }, - { - "grid": { - "x": 24, - "y": 5, - "w": 24, - "h": 10 - }, - "type": "vis", - "config": { - "type": "xy", - "title": "Requests 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 - } - } - } - } - } - ] - } - - lang: cURL - label: Create a dashboard (with sections and controls) - cURL - source: | - curl -X POST "${KIBANA_URL}/api/dashboards" \ - -H "Authorization: ApiKey ${API_KEY}" \ - -H "kbn-xsrf: true" \ - -H "Content-Type: application/json" \ - -d '{ - "title": "Operations overview", - "time_range": { - "from": "now-7d", - "to": "now" - }, - "pinned_panels": [ - { - "type": "options_list_control", - "width": "medium", - "grow": true, - "config": { - "title": "Response code", - "data_view_id": "90943e30-9a47-11e8-b64d-95841ca0b247", - "field_name": "response.keyword" - } - } - ], - "panels": [ - { - "title": "Key metrics", - "collapsed": false, - "grid": { - "y": 0 - }, - "panels": [ - { - "grid": { - "x": 0, - "y": 0, - "w": 12, - "h": 5 - }, - "type": "vis", - "config": { - "type": "metric", - "data_source": { - "type": "data_view_spec", - "index_pattern": "kibana_sample_data_logs", - "time_field": "timestamp" - }, - "metrics": [ - { - "type": "primary", - "operation": "count" - } - ] - } - }, - { - "grid": { - "x": 12, - "y": 0, - "w": 12, - "h": 5 - }, - "type": "vis", - "config": { - "type": "metric", - "data_source": { - "type": "data_view_spec", - "index_pattern": "kibana_sample_data_logs", - "time_field": "timestamp" - }, - "metrics": [ - { - "type": "primary", - "operation": "average", - "field": "bytes" - } - ] - } - } - ] - }, - { - "title": "Traffic trends", - "collapsed": false, - "grid": { - "y": 8 - }, - "panels": [ - { - "grid": { - "x": 0, - "y": 0, - "w": 24, - "h": 10 - }, - "type": "vis", - "config": { - "type": "xy", - "title": "Requests 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" - } - ] - } - ], - "axis": { - "x": { - "title": { - "visible": false - } - } - } - } - }, - { - "grid": { - "x": 24, - "y": 0, - "w": 24, - "h": 10 - }, - "type": "vis", - "config": { - "type": "xy", - "title": "Requests over time (ES|QL)", - "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 - } - } - } - } - } - ] - } - ] - }' - - lang: Console - label: Create a dashboard (with sections and controls) - Console - source: | - POST kbn:/api/dashboards - { - "title": "Operations overview", - "time_range": { - "from": "now-7d", - "to": "now" - }, - "pinned_panels": [ - { - "type": "options_list_control", - "width": "medium", - "grow": true, - "config": { - "title": "Response code", - "data_view_id": "90943e30-9a47-11e8-b64d-95841ca0b247", - "field_name": "response.keyword" - } - } - ], - "panels": [ - { - "title": "Key metrics", - "collapsed": false, - "grid": { - "y": 0 - }, - "panels": [ - { - "grid": { - "x": 0, - "y": 0, - "w": 12, - "h": 5 - }, - "type": "vis", - "config": { - "type": "metric", - "data_source": { - "type": "data_view_spec", - "index_pattern": "kibana_sample_data_logs", - "time_field": "timestamp" - }, - "metrics": [ - { - "type": "primary", - "operation": "count" - } - ] - } - }, - { - "grid": { - "x": 12, - "y": 0, - "w": 12, - "h": 5 - }, - "type": "vis", - "config": { - "type": "metric", - "data_source": { - "type": "data_view_spec", - "index_pattern": "kibana_sample_data_logs", - "time_field": "timestamp" - }, - "metrics": [ - { - "type": "primary", - "operation": "average", - "field": "bytes" - } - ] - } - } - ] - }, - { - "title": "Traffic trends", - "collapsed": false, - "grid": { - "y": 8 - }, - "panels": [ - { - "grid": { - "x": 0, - "y": 0, - "w": 24, - "h": 10 - }, - "type": "vis", - "config": { - "type": "xy", - "title": "Requests 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" - } - ] - } - ], - "axis": { - "x": { - "title": { - "visible": false - } - } - } - } - }, - { - "grid": { - "x": 24, - "y": 0, - "w": 24, - "h": 10 - }, - "type": "vis", - "config": { - "type": "xy", - "title": "Requests over time (ES|QL)", - "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 - } - } - } - } - } - ] - } - ] - } - /api/dashboards/{id}: - delete: - description: |- - **Spaces method and path for this operation:** - -
delete /s/{space_id}/api/dashboards/{id}
- - Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information. - - Permanently deletes a dashboard by ID. - operationId: delete-dashboards-id - parameters: - - description: A required header to protect against CSRF attacks - in: header - name: kbn-xsrf - required: true - schema: - example: 'true' - type: string - - description: The dashboard ID, as returned by the create or search endpoints. - in: path - name: id - required: true - schema: - type: string + summary: Create a dashboard + operationId: create-dashboard-redirect + description: | + > **Technical preview** — The Dashboards API is currently in technical preview and its full reference documentation is temporarily hosted at a separate location. + > + > **[View the full Dashboards API reference →](https://elastic.github.io/dashboards-api-spec/dashboards#tag/Dashboards)** responses: '200': - description: deleted - '403': - description: forbidden - '404': - description: not found - '500': - description: internal server error - summary: Delete a dashboard + description: See the full Dashboards API reference for detailed response schemas. + /api/dashboards/{id}: + get: tags: - Dashboards - x-state: Technical Preview - x-metaTags: - - content: Kibana, Elastic Cloud Serverless - name: product_name - x-codeSamples: - - lang: cURL - label: Delete a dashboard - cURL - source: | - curl -X DELETE "${KIBANA_URL}/api/dashboards/3c4b8e10-d57a-11ef-9a52-4f3c2a8d0e1b" \ - -H "Authorization: ApiKey ${API_KEY}" \ - -H "kbn-xsrf: true" - - lang: Console - label: Delete a dashboard - Console - source: | - DELETE kbn:/api/dashboards/3c4b8e10-d57a-11ef-9a52-4f3c2a8d0e1b - get: - description: |- - **Spaces method and path for this operation:** - -
get /s/{space_id}/api/dashboards/{id}
- - Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information. - - Returns the complete state of a dashboard by ID. - operationId: get-dashboards-id - parameters: - - description: The dashboard ID, as returned by the create or search endpoints. - in: path - name: id - required: true - schema: - type: string + summary: Get a dashboard + operationId: get-dashboard-redirect + description: | + > **Technical preview** — The Dashboards API is currently in technical preview and its full reference documentation is temporarily hosted at a separate location. + > + > **[View the full Dashboards API reference →](https://elastic.github.io/dashboards-api-spec/dashboards#tag/Dashboards)** responses: '200': - content: - application/json: - schema: - additionalProperties: false - type: object - properties: - data: - $ref: '#/components/schemas/Kibana_HTTP_APIs_kbn-dashboard-data' - id: - description: The unique ID of the dashboard, as returned by the create or search endpoints. - type: string - meta: - $ref: '#/components/schemas/Kibana_HTTP_APIs_kbn-as-code-meta' - warnings: - description: Panels dropped because their type is not supported by the API. Present only when one or more panels could not be returned. - items: - $ref: '#/components/schemas/Kibana_HTTP_APIs_kbn-dashboard-dropped-panel-warning' - maxItems: 100 - type: array - required: - - id - - data - - meta - examples: - getDashboardResponse: - summary: Get dashboard response - description: | - The full dashboard state including all panels, options, and metadata. - value: - id: 3c4b8e10-d57a-11ef-9a52-4f3c2a8d0e1b - data: - options: - hide_panel_titles: false - hide_panel_borders: false - use_margins: true - auto_apply_filters: true - sync_colors: false - sync_cursor: true - sync_tooltips: false - title: Web logs overview - panels: - - grid: - x: 0 - 'y': 0 - w: 12 - h: 8 - config: - title: Total requests - data_source: - type: data_view_spec - index_pattern: kibana_sample_data_logs - time_field: timestamp - type: metric - sampling: 1 - ignore_global_filters: false - metrics: - - type: primary - operation: count - empty_as_null: false - styling: - primary: - position: bottom - labels: - alignment: left - value: - sizing: auto - alignment: right - id: a1b2c3d4-0001-4000-8000-000000000001 - type: vis - - grid: - x: 12 - 'y': 0 - w: 12 - h: 8 - config: - title: Average response size - data_source: - type: data_view_spec - index_pattern: kibana_sample_data_logs - time_field: timestamp - type: metric - sampling: 1 - ignore_global_filters: false - metrics: - - type: primary - operation: average - field: bytes - styling: - primary: - position: bottom - labels: - alignment: left - value: - sizing: auto - alignment: right - id: a1b2c3d4-0001-4000-8000-000000000002 - type: vis - - grid: - x: 0 - 'y': 15 - w: 24 - h: 10 - config: - title: Requests over time - type: xy - layers: - - type: line - data_source: - type: esql - query: FROM kibana_sample_data_logs | STATS count = COUNT() BY BUCKET(@timestamp, 75, ?_tstart, ?_tend) - sampling: 1 - ignore_global_filters: false - x: - column: BUCKET(@timestamp, 75, ?_tstart, ?_tend) - 'y': - - column: count - axis_id: 'y' - axis: - x: - title: - visible: false - ticks: - visible: true - grid: - visible: true - domain: - type: fit - rounding: false - labels: - orientation: horizontal - scale: ordinal - 'y': - anchor: start - title: - visible: true - scale: linear - ticks: - visible: true - grid: - visible: true - domain: - type: full - rounding: true - labels: - orientation: horizontal - styling: - overlays: - partial_buckets: - visible: false - current_time_marker: - visible: false - interpolation: linear - points: - visibility: auto - legend: - visibility: hidden - placement: outside - position: right - layout: - type: grid - truncate: - max_lines: 1 - id: a1b2c3d4-0001-4000-8000-000000000003 - type: vis - pinned_panels: [] - meta: - created_at: '2026-04-13T10:00:00.000Z' - managed: false - updated_at: '2026-04-13T10:00:00.000Z' - version: WzEwMiwxXQ== - description: success - '400': - description: invalid response - '403': - description: forbidden - '404': - description: not found - '500': - description: internal server error - summary: Get a dashboard + description: See the full Dashboards API reference for detailed response schemas. + put: tags: - Dashboards - x-state: Technical Preview - x-metaTags: - - content: Kibana, Elastic Cloud Serverless - name: product_name - x-codeSamples: - - lang: cURL - label: Get a dashboard - cURL - source: | - curl -X GET "${KIBANA_URL}/api/dashboards/3c4b8e10-d57a-11ef-9a52-4f3c2a8d0e1b" \ - -H "Authorization: ApiKey ${API_KEY}" - - lang: Console - label: Get a dashboard - Console - source: | - GET kbn:/api/dashboards/3c4b8e10-d57a-11ef-9a52-4f3c2a8d0e1b - put: + summary: Update a dashboard + operationId: update-dashboard-redirect description: | - **Spaces method and path for this operation:** - -
put /s/{space_id}/api/dashboards/{id}
- - Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-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. - - You can optionally include `access_control.access_mode` to change the dashboard access mode. - If the authenticated user is not authorized to change access mode for the target dashboard, - the request returns a `403` response with a descriptive `message`. - operationId: put-dashboards-id - parameters: - - description: A required header to protect against CSRF attacks - in: header - name: kbn-xsrf - required: true - schema: - example: 'true' - type: string - - description: The dashboard identifier, as returned by the create or search endpoints. - in: path - name: id - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Kibana_HTTP_APIs_kbn-dashboard-data' - examples: - updateDashboard: - summary: Update a dashboard - value: - title: Web logs overview - panels: - - grid: - x: 0 - 'y': 0 - w: 12 - h: 5 - type: vis - config: - type: metric - data_source: - type: data_view_spec - index_pattern: kibana_sample_data_logs - time_field: timestamp - metrics: - - type: primary - operation: count - - grid: - x: 12 - 'y': 0 - w: 12 - h: 5 - type: vis - config: - type: metric - data_source: - type: data_view_spec - index_pattern: kibana_sample_data_logs - time_field: timestamp - metrics: - - type: primary - operation: average - field: bytes - - grid: - x: 0 - 'y': 8 - w: 24 - h: 10 - type: vis - config: - type: xy - title: Requests 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 - - grid: - x: 24 - 'y': 8 - w: 12 - h: 5 - type: vis - config: - type: metric - data_source: - type: data_view_spec - index_pattern: kibana_sample_data_logs - time_field: timestamp - metrics: - - type: primary - operation: unique_count - field: clientip + > **Technical preview** — The Dashboards API is currently in technical preview and its full reference documentation is temporarily hosted at a separate location. + > + > **[View the full Dashboards API reference →](https://elastic.github.io/dashboards-api-spec/dashboards#tag/Dashboards)** responses: '200': - content: - application/json: - schema: - additionalProperties: false - type: object - properties: - data: - $ref: '#/components/schemas/Kibana_HTTP_APIs_kbn-dashboard-data' - id: - description: The unique ID of the dashboard, as returned by the create or search endpoints. - type: string - meta: - $ref: '#/components/schemas/Kibana_HTTP_APIs_kbn-as-code-meta' - required: - - id - - data - - meta - examples: - updateDashboardResponse: - summary: Update dashboard response - description: | - 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. - value: - id: 3c4b8e10-d57a-11ef-9a52-4f3c2a8d0e1b - data: - options: - hide_panel_titles: false - hide_panel_borders: false - use_margins: true - auto_apply_filters: true - sync_colors: false - sync_cursor: true - sync_tooltips: false - panels: - - grid: - x: 0 - 'y': 0 - w: 24 - h: 15 - config: - content: |- - ## Web logs overview - -   - - Created with the [Dashboards API](https://www.elastic.co/docs/api/doc/kibana) using the Kibana sample web logs dataset (`kibana_sample_data_logs`). Contains: - - This markdown panel - - 2 metrics, showing request count and average response size - - A line chart based on an ES|QL query - -   - -   - - [Learn more about dashboards](https://www.elastic.co/docs/explore-analyze/dashboards) - id: a1b2c3d4-0001-4000-8000-000000000001 - type: markdown - - grid: - x: 24 - 'y': 0 - w: 12 - h: 5 - config: - title: '' - data_source: - type: data_view_spec - index_pattern: kibana_sample_data_logs - time_field: timestamp - type: metric - sampling: 1 - ignore_global_filters: false - metrics: - - type: primary - operation: count - empty_as_null: false - styling: - primary: - position: bottom - labels: - alignment: left - value: - sizing: auto - alignment: right - id: a1b2c3d4-0001-4000-8000-000000000002 - type: vis - - grid: - x: 36 - 'y': 0 - w: 12 - h: 5 - config: - title: '' - data_source: - type: data_view_spec - index_pattern: kibana_sample_data_logs - time_field: timestamp - type: metric - sampling: 1 - ignore_global_filters: false - metrics: - - type: primary - operation: average - field: bytes - styling: - primary: - position: bottom - labels: - alignment: left - value: - sizing: auto - alignment: right - id: a1b2c3d4-0001-4000-8000-000000000003 - type: vis - - grid: - x: 24 - 'y': 5 - w: 24 - h: 10 - config: - title: Requests over time - type: xy - layers: - - type: line - data_source: - type: esql - query: FROM kibana_sample_data_logs | STATS count = COUNT() BY BUCKET(@timestamp, 75, ?_tstart, ?_tend) - sampling: 1 - ignore_global_filters: false - x: - column: BUCKET(@timestamp, 75, ?_tstart, ?_tend) - 'y': - - column: count - axis_id: 'y' - axis: - x: - title: - visible: false - ticks: - visible: true - grid: - visible: true - domain: - type: fit - rounding: false - labels: - orientation: horizontal - scale: ordinal - 'y': - anchor: start - title: - visible: true - scale: linear - ticks: - visible: true - grid: - visible: true - domain: - type: full - rounding: true - labels: - orientation: horizontal - styling: - overlays: - partial_buckets: - visible: false - current_time_marker: - visible: false - interpolation: linear - points: - visibility: auto - legend: - visibility: hidden - placement: outside - position: right - layout: - type: grid - truncate: - max_lines: 1 - id: a1b2c3d4-0001-4000-8000-000000000003 - type: vis - - grid: - x: 24 - 'y': 8 - w: 24 - h: 10 - config: - title: Unique visitors - data_source: - type: data_view_spec - index_pattern: kibana_sample_data_logs - time_field: timestamp - type: metric - sampling: 1 - ignore_global_filters: false - metrics: - - type: primary - operation: unique_count - field: clientip - empty_as_null: false - styling: - primary: - position: bottom - labels: - alignment: left - value: - sizing: auto - alignment: right - id: a1b2c3d4-0001-4000-8000-000000000004 - type: vis - pinned_panels: [] - title: Web logs overview - meta: - managed: false - updated_at: '2026-04-13T11:00:00.000Z' - version: WzEwMywxXQ== - description: updated - '201': - content: - application/json: - schema: - additionalProperties: false - type: object - properties: - data: - $ref: '#/components/schemas/Kibana_HTTP_APIs_kbn-dashboard-data' - id: - description: The unique ID of the dashboard, as returned by the create or search endpoints. - type: string - meta: - $ref: '#/components/schemas/Kibana_HTTP_APIs_kbn-as-code-meta' - required: - - id - - data - - meta - examples: - createDashboardResponse: - summary: Create dashboard response (PUT) - description: | - Response when PUT creates a new dashboard (no existing dashboard with the given ID). Returns the generated state and metadata. Default option values are always returned even when not explicitly set in the request. - value: - id: 3c4b8e10-d57a-11ef-9a52-4f3c2a8d0e1b - data: - options: - hide_panel_titles: false - hide_panel_borders: false - use_margins: true - auto_apply_filters: true - sync_colors: false - sync_cursor: true - sync_tooltips: false - panels: - - grid: - x: 0 - 'y': 0 - w: 12 - h: 5 - config: - title: '' - data_source: - type: data_view_spec - index_pattern: kibana_sample_data_logs - time_field: timestamp - type: metric - sampling: 1 - ignore_global_filters: false - metrics: - - type: primary - operation: count - empty_as_null: false - styling: - primary: - position: bottom - labels: - alignment: left - value: - sizing: auto - alignment: right - id: a1b2c3d4-0001-4000-8000-000000000001 - type: vis - pinned_panels: [] - title: Web logs overview - meta: - created_at: '2026-04-13T10:00:00.000Z' - managed: false - updated_at: '2026-04-13T10:00:00.000Z' - version: WzEwMiwxXQ== - description: created - '400': - description: invalid request - '403': - description: forbidden - '409': - description: conflict - summary: Upsert a dashboard + description: See the full Dashboards API reference for detailed response schemas. + delete: tags: - Dashboards - x-state: Technical Preview - x-metaTags: - - content: Kibana, Elastic Cloud Serverless - name: product_name - x-codeSamples: - - lang: cURL - label: Update a dashboard - cURL - source: | - curl -X PUT "${KIBANA_URL}/api/dashboards/3c4b8e10-d57a-11ef-9a52-4f3c2a8d0e1b" \ - -H "Authorization: ApiKey ${API_KEY}" \ - -H "kbn-xsrf: true" \ - -H "Content-Type: application/json" \ - -d '{ - "title": "Web logs overview", - "panels": [ - { - "grid": { - "x": 0, - "y": 0, - "w": 12, - "h": 5 - }, - "type": "vis", - "config": { - "type": "metric", - "data_source": { - "type": "data_view_spec", - "index_pattern": "kibana_sample_data_logs", - "time_field": "timestamp" - }, - "metrics": [ - { - "type": "primary", - "operation": "count" - } - ] - } - }, - { - "grid": { - "x": 12, - "y": 0, - "w": 12, - "h": 5 - }, - "type": "vis", - "config": { - "type": "metric", - "data_source": { - "type": "data_view_spec", - "index_pattern": "kibana_sample_data_logs", - "time_field": "timestamp" - }, - "metrics": [ - { - "type": "primary", - "operation": "average", - "field": "bytes" - } - ] - } - }, - { - "grid": { - "x": 0, - "y": 8, - "w": 24, - "h": 10 - }, - "type": "vis", - "config": { - "type": "xy", - "title": "Requests 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 - } - } - } - } - }, - { - "grid": { - "x": 24, - "y": 8, - "w": 12, - "h": 5 - }, - "type": "vis", - "config": { - "type": "metric", - "data_source": { - "type": "data_view_spec", - "index_pattern": "kibana_sample_data_logs", - "time_field": "timestamp" - }, - "metrics": [ - { - "type": "primary", - "operation": "unique_count", - "field": "clientip" - } - ] - } - } - ] - }' - - lang: Console - label: Update a dashboard - Console - source: | - PUT kbn:/api/dashboards/3c4b8e10-d57a-11ef-9a52-4f3c2a8d0e1b - { - "title": "Web logs overview", - "panels": [ - { - "grid": { - "x": 0, - "y": 0, - "w": 12, - "h": 5 - }, - "type": "vis", - "config": { - "type": "metric", - "data_source": { - "type": "data_view_spec", - "index_pattern": "kibana_sample_data_logs", - "time_field": "timestamp" - }, - "metrics": [ - { - "type": "primary", - "operation": "count" - } - ] - } - }, - { - "grid": { - "x": 12, - "y": 0, - "w": 12, - "h": 5 - }, - "type": "vis", - "config": { - "type": "metric", - "data_source": { - "type": "data_view_spec", - "index_pattern": "kibana_sample_data_logs", - "time_field": "timestamp" - }, - "metrics": [ - { - "type": "primary", - "operation": "average", - "field": "bytes" - } - ] - } - }, - { - "grid": { - "x": 0, - "y": 8, - "w": 24, - "h": 10 - }, - "type": "vis", - "config": { - "type": "xy", - "title": "Requests 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 - } - } - } - } - }, - { - "grid": { - "x": 24, - "y": 8, - "w": 12, - "h": 5 - }, - "type": "vis", - "config": { - "type": "metric", - "data_source": { - "type": "data_view_spec", - "index_pattern": "kibana_sample_data_logs", - "time_field": "timestamp" - }, - "metrics": [ - { - "type": "primary", - "operation": "unique_count", - "field": "clientip" - } - ] - } - } - ] - } + summary: Delete a dashboard + operationId: delete-dashboard-redirect + description: | + > **Technical preview** — The Dashboards API is currently in technical preview and its full reference documentation is temporarily hosted at a separate location. + > + > **[View the full Dashboards API reference →](https://elastic.github.io/dashboards-api-spec/dashboards#tag/Dashboards)** + responses: + '200': + description: See the full Dashboards API reference for detailed response schemas. /api/data_views: get: description: | @@ -83235,1138 +81274,66 @@ paths: name: product_name /api/visualizations: get: - description: |- - **Spaces method and path for this operation:** - -
get /s/{space_id}/api/visualizations
- - Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information. - - Returns a paginated list of Lens visualizations matching the optional `query` text. - operationId: get-visualizations - parameters: - - description: The saved object fields to include in each result. When omitted, all fields are returned. - in: query - name: fields - required: false - schema: - items: - type: string - maxItems: 100 - type: array - - description: The fields to match the `query` text against. Defaults to `title` when omitted. - in: query - name: search_fields - required: false - schema: - items: - type: string - maxItems: 100 - type: array - - description: Text to match against `search_fields`. - in: query - name: query - required: false - schema: - type: string - - description: The page of results to return. - in: query - name: page - required: false - schema: - default: 1 - minimum: 1 - type: number - - description: The number of results to return per page. - in: query - name: per_page - required: false - schema: - default: 20 - maximum: 1000 - minimum: 1 - type: number - responses: - '200': - content: - application/json: - schema: - additionalProperties: false - type: object - properties: - data: - items: - $ref: '#/components/schemas/Kibana_HTTP_APIs_lensResponseItem' - maxItems: 1000 - type: array - meta: - additionalProperties: false - type: object - properties: - page: - default: 1 - description: The returned page of results. - minimum: 1 - type: number - per_page: - default: 20 - description: The number of results returned per page. - maximum: 1000 - minimum: 1 - type: number - total: - description: The total number of results matching the query. - type: number - required: - - total - required: - - data - - meta - examples: - searchVisualizationsResponse: - summary: Search visualizations response - description: | - 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. - value: - data: - - id: 1e4f0a30-b3c5-11ef-bd7a-2b6b1a8c0f3d - data: - title: Total requests - data_source: - type: data_view_spec - index_pattern: kibana_sample_data_logs - time_field: timestamp - type: metric - sampling: 1 - ignore_global_filters: false - metrics: - - type: primary - operation: count - empty_as_null: false - styling: - primary: - position: bottom - labels: - alignment: left - value: - sizing: auto - alignment: right - meta: - created_at: '2026-04-13T10:00:00.000Z' - managed: false - updated_at: '2026-04-13T10:00:00.000Z' - version: WzU5LDFd - - id: 3a7c2e10-b3c5-11ef-bd7a-2b6b1a8c0f3d - data: - title: Log entries over time - type: xy - layers: - - type: line - data_source: - type: data_view_spec - index_pattern: kibana_sample_data_logs - time_field: timestamp - sampling: 1 - ignore_global_filters: false - x: - operation: date_histogram - field: timestamp - suggested_interval: auto - use_original_time_range: false - include_empty_rows: true - drop_partial_intervals: false - 'y': - - operation: count - empty_as_null: false - axis_id: 'y' - axis: - x: - title: - visible: true - ticks: - visible: true - grid: - visible: true - domain: - type: fit - rounding: false - labels: - orientation: horizontal - 'y': - anchor: start - title: - visible: true - scale: linear - ticks: - visible: true - grid: - visible: true - domain: - type: full - rounding: true - labels: - orientation: horizontal - styling: - overlays: - partial_buckets: - visible: false - current_time_marker: - visible: false - interpolation: linear - points: - visibility: auto - legend: - visibility: hidden - placement: outside - position: right - layout: - type: grid - truncate: - max_lines: 1 - meta: - created_at: '2026-04-13T10:05:00.000Z' - managed: false - updated_at: '2026-04-13T10:05:00.000Z' - version: WzYwLDFd - meta: - page: 1 - per_page: 20 - total: 2 - description: Ok - '400': - description: Malformed request - '401': - description: Unauthorized - '403': - description: Forbidden - '500': - description: Internal Server Error - summary: Search visualizations tags: - Visualizations - x-state: Technical Preview - x-metaTags: - - content: Kibana, Elastic Cloud Serverless - name: product_name - x-codeSamples: - - lang: cURL - label: Search visualizations - cURL - source: | - curl -X GET "${KIBANA_URL}/api/visualizations?query=requests&per_page=10" \ - -H "Authorization: ApiKey ${API_KEY}" - - lang: Console - label: Search visualizations - Console - source: | - GET kbn:/api/visualizations?query=requests&per_page=10 - post: - description: |- - **Spaces method and path for this operation:** - -
post /s/{space_id}/api/visualizations
- - Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information. - - Creates a Lens visualization and saves it to the library. - - ES|QL visualizations cannot be created through this endpoint. - operationId: post-visualizations - parameters: - - description: A required header to protect against CSRF attacks - in: header - name: kbn-xsrf - required: true - schema: - example: 'true' - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Kibana_HTTP_APIs_lensApiConfigNoESQL' - examples: - createMetricVisualization: - summary: Create a metric visualization - value: - type: metric - title: Total requests - data_source: - type: data_view_spec - index_pattern: kibana_sample_data_logs - time_field: timestamp - metrics: - - type: primary - operation: count - createXYVisualization: - summary: Create an XY line chart - value: - type: xy - title: 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 - createPieVisualization: - summary: Create a pie/donut chart - value: - type: pie - title: Requests by response code - donut_hole: m - data_source: - type: data_view_spec - index_pattern: kibana_sample_data_logs - time_field: timestamp - metrics: - - operation: count - group_by: - - operation: terms - fields: - - response.keyword - limit: 5 - createDataTableVisualization: - summary: Create a data table - value: - type: data_table - title: Top response codes - data_source: - type: data_view_spec - index_pattern: kibana_sample_data_logs - time_field: timestamp - metrics: - - operation: count - rows: - - operation: terms - fields: - - response.keyword - limit: 5 - createDataViewReferenceVisualization: - summary: Create a visualization using a library data view - value: - type: metric - title: Total requests (library data view) - data_source: - type: data_view_reference - ref_id: 90943e30-9a47-11e8-b64d-95841ca0b247 - metrics: - - type: primary - operation: count + summary: Get visualizations + operationId: get-visualizations-redirect + description: | + > **Technical preview** — The Visualizations API is currently in technical preview and its full reference documentation is temporarily hosted at a separate location. + > + > **[View the full Visualizations API reference →](https://elastic.github.io/dashboards-api-spec/visualizations#tag/Visualizations)** responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/Kibana_HTTP_APIs_lensResponseItem' - examples: - createMetricVisualizationResponse: - summary: Create a metric visualization - description: | - Response after creating a metric chart (count of requests) using an inline data view. Server-populated defaults are included in the response. - value: - id: 1e4f0a30-b3c5-11ef-bd7a-2b6b1a8c0f3d - data: - title: Total requests - data_source: - type: data_view_spec - index_pattern: kibana_sample_data_logs - time_field: timestamp - type: metric - sampling: 1 - ignore_global_filters: false - metrics: - - type: primary - operation: count - empty_as_null: false - styling: - primary: - position: bottom - labels: - alignment: left - value: - sizing: auto - alignment: right - meta: - created_at: '2026-04-13T10:00:00.000Z' - managed: false - updated_at: '2026-04-13T10:00:00.000Z' - version: WzU5LDFd - createXYVisualizationResponse: - summary: Create an XY line chart - description: | - Response after creating an XY line chart. The response includes server-populated defaults for axis configuration, styling, and legend. - value: - id: 3a7c2e10-b3c5-11ef-bd7a-2b6b1a8c0f3d - data: - title: Log entries over time - type: xy - layers: - - type: line - data_source: - type: data_view_spec - index_pattern: kibana_sample_data_logs - time_field: timestamp - sampling: 1 - ignore_global_filters: false - x: - operation: date_histogram - field: timestamp - suggested_interval: auto - use_original_time_range: false - include_empty_rows: true - drop_partial_intervals: false - 'y': - - operation: count - empty_as_null: false - axis_id: 'y' - axis: - x: - title: - visible: true - ticks: - visible: true - grid: - visible: true - domain: - type: fit - rounding: false - labels: - orientation: horizontal - 'y': - anchor: start - title: - visible: true - scale: linear - ticks: - visible: true - grid: - visible: true - domain: - type: full - rounding: true - labels: - orientation: horizontal - styling: - overlays: - partial_buckets: - visible: false - current_time_marker: - visible: false - interpolation: linear - points: - visibility: auto - legend: - visibility: hidden - placement: outside - position: right - layout: - type: grid - truncate: - max_lines: 1 - meta: - created_at: '2026-04-13T10:05:00.000Z' - managed: false - updated_at: '2026-04-13T10:05:00.000Z' - version: WzYwLDFd - createPieVisualizationResponse: - summary: Create a pie/donut chart - description: | - Response after creating a donut chart broken down by response code. Note that `group_by` items gain a server-populated `rank_by` sort order, and `legend`, `values`, and `labels` are populated with defaults. - value: - id: 2cac466f-ff49-4d34-8d69-487a93a179c2 - data: - title: Requests by response code - type: pie - metrics: - - operation: count - empty_as_null: false - group_by: - - operation: terms - fields: - - response.keyword - limit: 5 - rank_by: - type: metric - metric_index: 0 - direction: desc - data_source: - type: data_view_spec - index_pattern: kibana_sample_data_logs - time_field: timestamp - legend: - visibility: auto - values: - visible: true - mode: percentage - donut_hole: m - labels: - visible: true - position: outside - meta: - created_at: '2026-04-13T10:10:00.000Z' - managed: false - updated_at: '2026-04-13T10:10:00.000Z' - version: Wzc3LDFd - createDataTableVisualizationResponse: - summary: Create a data table - description: | - Response after creating a data table broken down by response code. Note that `rows` items gain a server-populated `rank_by` sort order. - value: - id: 83660652-bc77-46a1-8dca-5d512949eba6 - data: - title: Top response codes - type: data_table - data_source: - type: data_view_spec - index_pattern: kibana_sample_data_logs - time_field: timestamp - sampling: 1 - ignore_global_filters: false - metrics: - - operation: count - empty_as_null: false - rows: - - operation: terms - fields: - - response.keyword - limit: 5 - rank_by: - type: metric - metric_index: 0 - direction: desc - meta: - created_at: '2026-04-13T10:15:00.000Z' - managed: false - updated_at: '2026-04-13T10:15:00.000Z' - version: Wzc4LDFd - createDataViewReferenceResponse: - summary: Create a visualization using a library data view - description: | - Response after creating a metric chart that references an existing saved data view by ID (`ref_id`) instead of defining an inline index pattern. - value: - id: cc44837a-7f20-42ee-b317-9af4f5eacc9c - data: - title: Total requests (library data view) - data_source: - type: data_view_reference - ref_id: 90943e30-9a47-11e8-b64d-95841ca0b247 - type: metric - sampling: 1 - ignore_global_filters: false - metrics: - - type: primary - operation: count - empty_as_null: false - styling: - primary: - position: bottom - labels: - alignment: left - value: - sizing: auto - alignment: right - meta: - created_at: '2026-04-13T10:20:00.000Z' - managed: false - updated_at: '2026-04-13T10:20:00.000Z' - version: Wzc5LDFd - description: Created - '400': - description: Malformed request - '401': - description: Unauthorized - '403': - description: Forbidden - '500': - description: Internal Server Error - summary: Create visualization + '200': + description: See the full Visualizations API reference for detailed response schemas. + post: tags: - Visualizations - x-state: Technical Preview - x-metaTags: - - content: Kibana, Elastic Cloud Serverless - name: product_name - x-codeSamples: - - lang: cURL - label: Create a metric visualization - cURL - source: | - curl -X POST "${KIBANA_URL}/api/visualizations" \ - -H "Authorization: ApiKey ${API_KEY}" \ - -H "kbn-xsrf: true" \ - -H "Content-Type: application/json" \ - -d '{ - "type": "metric", - "title": "Total requests", - "data_source": { - "type": "data_view_spec", - "index_pattern": "kibana_sample_data_logs", - "time_field": "timestamp" - }, - "metrics": [ - { - "type": "primary", - "operation": "count" - } - ] - }' - - lang: Console - label: Create a metric visualization - Console - source: | - POST kbn:/api/visualizations - { - "type": "metric", - "title": "Total requests", - "data_source": { - "type": "data_view_spec", - "index_pattern": "kibana_sample_data_logs", - "time_field": "timestamp" - }, - "metrics": [ - { - "type": "primary", - "operation": "count" - } - ] - } - - lang: cURL - label: Create an XY line chart - cURL - source: | - 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": "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" - } - ] - } - ] - }' - - lang: Console - label: Create an XY line chart - Console - source: | - POST kbn:/api/visualizations - { - "type": "xy", - "title": "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" - } - ] - } - ] - } - - lang: cURL - label: Create a pie/donut chart - cURL - source: | - curl -X POST "${KIBANA_URL}/api/visualizations" \ - -H "Authorization: ApiKey ${API_KEY}" \ - -H "kbn-xsrf: true" \ - -H "Content-Type: application/json" \ - -d '{ - "type": "pie", - "title": "Requests by response code", - "donut_hole": "m", - "data_source": { - "type": "data_view_spec", - "index_pattern": "kibana_sample_data_logs", - "time_field": "timestamp" - }, - "metrics": [ - { - "operation": "count" - } - ], - "group_by": [ - { - "operation": "terms", - "fields": [ - "response.keyword" - ], - "limit": 5 - } - ] - }' - - lang: Console - label: Create a pie/donut chart - Console - source: | - POST kbn:/api/visualizations - { - "type": "pie", - "title": "Requests by response code", - "donut_hole": "m", - "data_source": { - "type": "data_view_spec", - "index_pattern": "kibana_sample_data_logs", - "time_field": "timestamp" - }, - "metrics": [ - { - "operation": "count" - } - ], - "group_by": [ - { - "operation": "terms", - "fields": [ - "response.keyword" - ], - "limit": 5 - } - ] - } - - lang: cURL - label: Create a data table - cURL - source: | - curl -X POST "${KIBANA_URL}/api/visualizations" \ - -H "Authorization: ApiKey ${API_KEY}" \ - -H "kbn-xsrf: true" \ - -H "Content-Type: application/json" \ - -d '{ - "type": "data_table", - "title": "Top response codes", - "data_source": { - "type": "data_view_spec", - "index_pattern": "kibana_sample_data_logs", - "time_field": "timestamp" - }, - "metrics": [ - { - "operation": "count" - } - ], - "rows": [ - { - "operation": "terms", - "fields": [ - "response.keyword" - ], - "limit": 5 - } - ] - }' - - lang: Console - label: Create a data table - Console - source: | - POST kbn:/api/visualizations - { - "type": "data_table", - "title": "Top response codes", - "data_source": { - "type": "data_view_spec", - "index_pattern": "kibana_sample_data_logs", - "time_field": "timestamp" - }, - "metrics": [ - { - "operation": "count" - } - ], - "rows": [ - { - "operation": "terms", - "fields": [ - "response.keyword" - ], - "limit": 5 - } - ] - } - - lang: cURL - label: Create a visualization using a library data view - cURL - source: | - curl -X POST "${KIBANA_URL}/api/visualizations" \ - -H "Authorization: ApiKey ${API_KEY}" \ - -H "kbn-xsrf: true" \ - -H "Content-Type: application/json" \ - -d '{ - "type": "metric", - "title": "Total requests (library data view)", - "data_source": { - "type": "data_view_reference", - "ref_id": "90943e30-9a47-11e8-b64d-95841ca0b247" - }, - "metrics": [ - { - "type": "primary", - "operation": "count" - } - ] - }' - - lang: Console - label: Create a visualization using a library data view - Console - source: | - POST kbn:/api/visualizations - { - "type": "metric", - "title": "Total requests (library data view)", - "data_source": { - "type": "data_view_reference", - "ref_id": "90943e30-9a47-11e8-b64d-95841ca0b247" - }, - "metrics": [ - { - "type": "primary", - "operation": "count" - } - ] - } - /api/visualizations/{id}: - delete: - description: |- - **Spaces method and path for this operation:** - -
delete /s/{space_id}/api/visualizations/{id}
- - Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-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. - operationId: delete-visualizations-id - parameters: - - description: A required header to protect against CSRF attacks - in: header - name: kbn-xsrf - required: true - schema: - example: 'true' - type: string - - description: The visualization identifier, as returned by the create or search endpoints. - in: path - name: id - required: true - schema: - type: string + summary: Create a visualization + operationId: create-visualization-redirect + description: | + > **Technical preview** — The Visualizations API is currently in technical preview and its full reference documentation is temporarily hosted at a separate location. + > + > **[View the full Visualizations API reference →](https://elastic.github.io/dashboards-api-spec/visualizations#tag/Visualizations)** responses: - '204': - description: No Content - '400': - description: Malformed request - '401': - description: Unauthorized - '403': - description: Forbidden - '404': - description: Resource not found - '500': - description: Internal Server Error - summary: Delete visualization + '200': + description: See the full Visualizations API reference for detailed response schemas. + /api/visualizations/{id}: + get: tags: - Visualizations - x-state: Technical Preview - x-metaTags: - - content: Kibana, Elastic Cloud Serverless - name: product_name - x-codeSamples: - - lang: cURL - label: Delete a visualization - cURL - source: | - curl -X DELETE "${KIBANA_URL}/api/visualizations/1e4f0a30-b3c5-11ef-bd7a-2b6b1a8c0f3d" \ - -H "Authorization: ApiKey ${API_KEY}" \ - -H "kbn-xsrf: true" - - lang: Console - label: Delete a visualization - Console - source: | - DELETE kbn:/api/visualizations/1e4f0a30-b3c5-11ef-bd7a-2b6b1a8c0f3d - get: - description: |- - **Spaces method and path for this operation:** - -
get /s/{space_id}/api/visualizations/{id}
- - Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information. - - Returns a single Lens visualization by its ID. - operationId: get-visualizations-id - parameters: - - description: The visualization identifier, as returned by the create or search endpoints. - in: path - name: id - required: true - schema: - type: string + summary: Get a visualization + operationId: get-visualization-redirect + description: | + > **Technical preview** — The Visualizations API is currently in technical preview and its full reference documentation is temporarily hosted at a separate location. + > + > **[View the full Visualizations API reference →](https://elastic.github.io/dashboards-api-spec/visualizations#tag/Visualizations)** responses: '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Kibana_HTTP_APIs_lensResponseItem' - examples: - getVisualizationResponse: - summary: Get visualization response - description: | - The full visualization state including the chart configuration and metadata. - value: - id: 1e4f0a30-b3c5-11ef-bd7a-2b6b1a8c0f3d - data: - title: Total requests - data_source: - type: data_view_spec - index_pattern: kibana_sample_data_logs - time_field: timestamp - type: metric - sampling: 1 - ignore_global_filters: false - metrics: - - type: primary - operation: count - empty_as_null: false - styling: - primary: - position: bottom - labels: - alignment: left - value: - sizing: auto - alignment: right - meta: - created_at: '2026-04-13T10:00:00.000Z' - managed: false - updated_at: '2026-04-13T10:00:00.000Z' - version: WzU5LDFd - description: Ok - '400': - description: Malformed request - '401': - description: Unauthorized - '403': - description: Forbidden - '404': - description: Resource not found - '500': - description: Internal Server Error - summary: Get visualization + description: See the full Visualizations API reference for detailed response schemas. + put: tags: - Visualizations - x-state: Technical Preview - x-metaTags: - - content: Kibana, Elastic Cloud Serverless - name: product_name - x-codeSamples: - - lang: cURL - label: Get a visualization - cURL - source: | - curl -X GET "${KIBANA_URL}/api/visualizations/1e4f0a30-b3c5-11ef-bd7a-2b6b1a8c0f3d" \ - -H "Authorization: ApiKey ${API_KEY}" - - lang: Console - label: Get a visualization - Console - source: | - GET kbn:/api/visualizations/1e4f0a30-b3c5-11ef-bd7a-2b6b1a8c0f3d - put: - description: |- - **Spaces method and path for this operation:** - -
put /s/{space_id}/api/visualizations/{id}
- - Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-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. - operationId: put-visualizations-id - parameters: - - description: A required header to protect against CSRF attacks - in: header - name: kbn-xsrf - required: true - schema: - example: 'true' - type: string - - description: The visualization identifier, as returned by the create or search endpoints. - in: path - name: id - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Kibana_HTTP_APIs_lensApiConfigNoESQL' - examples: - updateVisualization: - summary: Update a visualization - value: - type: metric - title: Total requests (updated) - data_source: - type: data_view_spec - index_pattern: kibana_sample_data_logs - time_field: timestamp - metrics: - - type: primary - operation: count + summary: Update a visualization + operationId: update-visualization-redirect + description: | + > **Technical preview** — The Visualizations API is currently in technical preview and its full reference documentation is temporarily hosted at a separate location. + > + > **[View the full Visualizations API reference →](https://elastic.github.io/dashboards-api-spec/visualizations#tag/Visualizations)** responses: '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Kibana_HTTP_APIs_lensResponseItem' - examples: - updateVisualizationResponse: - summary: Update visualization response - description: | - 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. - value: - id: 1e4f0a30-b3c5-11ef-bd7a-2b6b1a8c0f3d - data: - title: Total requests (updated) - data_source: - type: data_view_spec - index_pattern: kibana_sample_data_logs - time_field: timestamp - type: metric - sampling: 1 - ignore_global_filters: false - metrics: - - type: primary - operation: count - empty_as_null: false - styling: - primary: - position: bottom - labels: - alignment: left - value: - sizing: auto - alignment: right - meta: - created_at: '2026-04-13T11:00:00.000Z' - managed: false - updated_at: '2026-04-13T11:00:00.000Z' - version: WzYxLDFd - description: Ok - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/Kibana_HTTP_APIs_lensResponseItem' - examples: - createdVisualizationResponse: - summary: Update visualization response - description: | - The created visualization state. Server-populated defaults are included in the response. - value: - id: 1e4f0a30-b3c5-11ef-bd7a-2b6b1a8c0f3d - data: - title: Total requests (updated) - data_source: - type: data_view_spec - index_pattern: kibana_sample_data_logs - time_field: timestamp - type: metric - sampling: 1 - ignore_global_filters: false - metrics: - - type: primary - operation: count - empty_as_null: false - styling: - primary: - position: bottom - labels: - alignment: left - value: - sizing: auto - alignment: right - meta: - created_at: '2026-04-13T11:00:00.000Z' - managed: false - updated_at: '2026-04-13T11:00:00.000Z' - version: WzYxLDFd - description: Created - '400': - description: Malformed request - '401': - description: Unauthorized - '403': - description: Forbidden - '500': - description: Internal Server Error - summary: Update visualization + description: See the full Visualizations API reference for detailed response schemas. + delete: tags: - Visualizations - x-state: Technical Preview - x-metaTags: - - content: Kibana, Elastic Cloud Serverless - name: product_name - x-codeSamples: - - lang: cURL - label: Update a visualization - cURL - source: | - curl -X PUT "${KIBANA_URL}/api/visualizations/1e4f0a30-b3c5-11ef-bd7a-2b6b1a8c0f3d" \ - -H "Authorization: ApiKey ${API_KEY}" \ - -H "kbn-xsrf: true" \ - -H "Content-Type: application/json" \ - -d '{ - "type": "metric", - "title": "Total requests (updated)", - "data_source": { - "type": "data_view_spec", - "index_pattern": "kibana_sample_data_logs", - "time_field": "timestamp" - }, - "metrics": [ - { - "type": "primary", - "operation": "count" - } - ] - }' - - lang: Console - label: Update a visualization - Console - source: | - PUT kbn:/api/visualizations/1e4f0a30-b3c5-11ef-bd7a-2b6b1a8c0f3d - { - "type": "metric", - "title": "Total requests (updated)", - "data_source": { - "type": "data_view_spec", - "index_pattern": "kibana_sample_data_logs", - "time_field": "timestamp" - }, - "metrics": [ - { - "type": "primary", - "operation": "count" - } - ] - } + summary: Delete a visualization + operationId: delete-visualization-redirect + description: | + > **Technical preview** — The Visualizations API is currently in technical preview and its full reference documentation is temporarily hosted at a separate location. + > + > **[View the full Visualizations API reference →](https://elastic.github.io/dashboards-api-spec/visualizations#tag/Visualizations)** + responses: + '200': + description: See the full Visualizations API reference for detailed response schemas. /api/workflows: delete: description: |- diff --git a/oas_docs/output/kibana.yaml b/oas_docs/output/kibana.yaml index ff8e2b28bdf73..ca43fb55bf0e3 100644 --- a/oas_docs/output/kibana.yaml +++ b/oas_docs/output/kibana.yaml @@ -17013,2027 +17013,66 @@ paths: name: product_name /api/dashboards: get: - description: |- - **Spaces method and path for this operation:** - -
get /s/{space_id}/api/dashboards
- - Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-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. - operationId: get-dashboards - parameters: - - description: The page of results to return. Defaults to `1`. - in: query - name: page - required: false - schema: - type: number - - description: The number of results to return per page. Defaults to `20`. - in: query - name: per_page - required: false - schema: - type: number - - description: Filters results by `title` and `description` using Elasticsearch [`simple_query_string`](https://www.elastic.co/docs/reference/query-languages/query-dsl/simple-query-string-query) syntax. Multi-word terms require all words to match. - in: query - name: query - required: false - schema: - type: string - - description: 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. - in: query - name: tags - required: false - schema: - items: - type: string - maxItems: 100 - type: array - - description: 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. - in: query - name: excluded_tags - required: false - schema: - items: - type: string - maxItems: 100 - type: array - responses: - '200': - content: - application/json: - schema: - additionalProperties: false - type: object - properties: - dashboards: - description: List of dashboards matching the query. Each entry includes summary fields but not the full panel layout. - items: - additionalProperties: false - type: object - properties: - data: - additionalProperties: false - type: object - properties: - access_control: - $ref: '#/components/schemas/Kibana_HTTP_APIs_kbn-dashboard-access-control' - description: - description: A short description of the dashboard. - type: string - tags: - description: Tag IDs associated with this dashboard. - items: - type: string - maxItems: 100 - type: array - time_range: - $ref: '#/components/schemas/Kibana_HTTP_APIs_kbn-es-query-server-timeRangeSchema' - title: - description: The dashboard title. - type: string - required: - - time_range - - title - - access_control - id: - description: The dashboard ID. - type: string - meta: - $ref: '#/components/schemas/Kibana_HTTP_APIs_kbn-as-code-meta' - required: - - id - - data - - meta - type: array - page: - description: The current page number. - type: number - total: - description: The total number of dashboards matching the query. - type: number - required: - - dashboards - - total - - page - examples: - searchDashboardsResponse: - summary: Search dashboards response - description: | - 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. - value: - dashboards: - - id: 3c4b8e10-d57a-11ef-9a52-4f3c2a8d0e1b - data: - title: Web logs overview - meta: - created_at: '2026-04-13T10:00:00.000Z' - managed: false - updated_at: '2026-04-13T10:00:00.000Z' - version: WzEwMiwxXQ== - - id: 7f2a1c40-e83b-11ef-a641-7d5b3f9e1c2a - data: - time_range: - from: now-7d - to: now - title: Operations overview - meta: - created_at: '2026-04-12T08:00:00.000Z' - managed: false - updated_at: '2026-04-12T14:22:00.000Z' - version: WzEwMSwxXQ== - page: 1 - total: 2 - description: success - '403': - description: forbidden - '500': - description: internal server error - summary: Search dashboards tags: - Dashboards - x-state: Technical Preview; added in 9.4.0 - x-metaTags: - - content: Kibana - name: product_name - x-codeSamples: - - lang: cURL - label: Search dashboards - cURL - source: | - curl -X GET "${KIBANA_URL}/api/dashboards?query=web+logs&per_page=10" \ - -H "Authorization: ApiKey ${API_KEY}" - - lang: Console - label: Search dashboards - Console - source: | - GET kbn:/api/dashboards?query=web+logs&per_page=10 - post: - description: |- - **Spaces method and path for this operation:** - -
post /s/{space_id}/api/dashboards
- - Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information. - - Creates a new dashboard and returns its ID, full state, and metadata. - operationId: post-dashboards - parameters: - - description: A required header to protect against CSRF attacks - in: header - name: kbn-xsrf - required: true - schema: - example: 'true' - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Kibana_HTTP_APIs_kbn-dashboard-data' - examples: - createDashboard: - summary: Create a simple dashboard - value: - title: Web logs overview - panels: - - grid: - x: 0 - 'y': 0 - w: 24 - h: 15 - type: markdown - config: - content: |- - ## Web logs overview - -   - - Created with the [Dashboards API](https://www.elastic.co/docs/api/doc/kibana) using the Kibana sample web logs dataset (`kibana_sample_data_logs`). Contains: - - This markdown panel - - 2 metrics, showing request count and average response size - - A line chart based on an ES|QL query - -   - -   - - [Learn more about dashboards](https://www.elastic.co/docs/explore-analyze/dashboards) - - grid: - x: 24 - 'y': 0 - w: 12 - h: 5 - type: vis - config: - type: metric - data_source: - type: data_view_spec - index_pattern: kibana_sample_data_logs - time_field: timestamp - metrics: - - type: primary - operation: count - - grid: - x: 36 - 'y': 0 - w: 12 - h: 5 - type: vis - config: - type: metric - data_source: - type: data_view_spec - index_pattern: kibana_sample_data_logs - time_field: timestamp - metrics: - - type: primary - operation: average - field: bytes - - grid: - x: 24 - 'y': 5 - w: 24 - h: 10 - type: vis - config: - type: xy - title: Requests 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 - createDashboardWithSectionsAndControls: - summary: Create a dashboard with sections and controls - value: - title: Operations overview - time_range: - from: now-7d - to: now - pinned_panels: - - type: options_list_control - width: medium - grow: true - config: - title: Response code - data_view_id: 90943e30-9a47-11e8-b64d-95841ca0b247 - field_name: response.keyword - panels: - - title: Key metrics - collapsed: false - grid: - 'y': 0 - panels: - - grid: - x: 0 - 'y': 0 - w: 12 - h: 5 - type: vis - config: - type: metric - data_source: - type: data_view_spec - index_pattern: kibana_sample_data_logs - time_field: timestamp - metrics: - - type: primary - operation: count - - grid: - x: 12 - 'y': 0 - w: 12 - h: 5 - type: vis - config: - type: metric - data_source: - type: data_view_spec - index_pattern: kibana_sample_data_logs - time_field: timestamp - metrics: - - type: primary - operation: average - field: bytes - - title: Traffic trends - collapsed: false - grid: - 'y': 8 - panels: - - grid: - x: 0 - 'y': 0 - w: 24 - h: 10 - type: vis - config: - type: xy - title: Requests 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 - axis: - x: - title: - visible: false - - grid: - x: 24 - 'y': 0 - w: 24 - h: 10 - type: vis - config: - type: xy - title: Requests over time (ES|QL) - 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 + summary: Get dashboards + operationId: get-dashboards-redirect + description: | + > **Technical preview** — The Dashboards API is currently in technical preview and its full reference documentation is temporarily hosted at a separate location. + > + > **[View the full Dashboards API reference →](https://elastic.github.io/dashboards-api-spec/dashboards#tag/Dashboards)** responses: - '201': - content: - application/json: - schema: - additionalProperties: false - type: object - properties: - data: - $ref: '#/components/schemas/Kibana_HTTP_APIs_kbn-dashboard-data' - id: - description: The unique ID of the dashboard, as returned by the create or search endpoints. - type: string - meta: - $ref: '#/components/schemas/Kibana_HTTP_APIs_kbn-as-code-meta' - required: - - id - - data - - meta - examples: - createDashboardResponse: - summary: Create dashboard response - description: | - 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. - value: - id: 3c4b8e10-d57a-11ef-9a52-4f3c2a8d0e1b - data: - options: - hide_panel_titles: false - hide_panel_borders: false - use_margins: true - auto_apply_filters: true - sync_colors: false - sync_cursor: true - sync_tooltips: false - panels: - - grid: - x: 0 - 'y': 0 - w: 24 - h: 15 - config: - content: '## Web logs overview' - id: a1b2c3d4-0001-4000-8000-000000000001 - type: markdown - - grid: - x: 24 - 'y': 0 - w: 12 - h: 5 - config: - title: '' - data_source: - type: data_view_spec - index_pattern: kibana_sample_data_logs - time_field: timestamp - type: metric - sampling: 1 - ignore_global_filters: false - metrics: - - type: primary - operation: count - empty_as_null: false - styling: - primary: - position: bottom - labels: - alignment: left - value: - sizing: auto - alignment: right - id: a1b2c3d4-0001-4000-8000-000000000002 - type: vis - - grid: - x: 36 - 'y': 0 - w: 12 - h: 5 - config: - title: '' - data_source: - type: data_view_spec - index_pattern: kibana_sample_data_logs - time_field: timestamp - type: metric - sampling: 1 - ignore_global_filters: false - metrics: - - type: primary - operation: average - field: bytes - styling: - primary: - position: bottom - labels: - alignment: left - value: - sizing: auto - alignment: right - id: a1b2c3d4-0001-4000-8000-000000000003 - type: vis - - grid: - x: 24 - 'y': 5 - w: 24 - h: 10 - config: - title: Requests over time - type: xy - layers: - - type: line - data_source: - type: esql - query: FROM kibana_sample_data_logs | STATS count = COUNT() BY BUCKET(@timestamp, 75, ?_tstart, ?_tend) - sampling: 1 - ignore_global_filters: false - x: - column: BUCKET(@timestamp, 75, ?_tstart, ?_tend) - 'y': - - column: count - axis_id: 'y' - axis: - x: - title: - visible: false - ticks: - visible: true - grid: - visible: true - domain: - type: fit - rounding: false - labels: - orientation: horizontal - scale: ordinal - 'y': - anchor: start - title: - visible: true - scale: linear - ticks: - visible: true - grid: - visible: true - domain: - type: full - rounding: true - labels: - orientation: horizontal - styling: - overlays: - partial_buckets: - visible: false - current_time_marker: - visible: false - interpolation: linear - points: - visibility: auto - legend: - visibility: hidden - placement: outside - position: right - layout: - type: grid - truncate: - max_lines: 1 - id: a1b2c3d4-0001-4000-8000-000000000003 - type: vis - pinned_panels: [] - access_control: - access_mode: write_restricted - title: Web logs overview - meta: - created_at: '2026-04-13T10:00:00.000Z' - managed: false - updated_at: '2026-04-13T10:00:00.000Z' - version: WzEwMiwxXQ== - description: created - '400': - description: invalid request - '403': - description: forbidden - summary: Create a dashboard + '200': + description: See the full Dashboards API reference for detailed response schemas. + post: tags: - Dashboards - x-state: Technical Preview; added in 9.4.0 - x-metaTags: - - content: Kibana - name: product_name - x-codeSamples: - - lang: cURL - label: Create a dashboard (simple) - cURL - source: | - 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", - "access_control": { "access_mode": "write_restricted" }, - "panels": [ - { - "grid": { - "x": 0, - "y": 0, - "w": 24, - "h": 15 - }, - "type": "markdown", - "config": { - "content": "## Web logs overview\n\n \n\nCreated with the [Dashboards API](https://www.elastic.co/docs/api/doc/kibana) using the Kibana sample web logs dataset (`kibana_sample_data_logs`). Contains:\n- This markdown panel\n- 2 metrics, showing request count and average response size\n- A line chart based on an ES|QL query\n\n \n\n \n\n[Learn more about dashboards](https://www.elastic.co/docs/explore-analyze/dashboards)" - } - }, - { - "grid": { - "x": 24, - "y": 0, - "w": 12, - "h": 5 - }, - "type": "vis", - "config": { - "type": "metric", - "data_source": { - "type": "data_view_spec", - "index_pattern": "kibana_sample_data_logs", - "time_field": "timestamp" - }, - "metrics": [ - { - "type": "primary", - "operation": "count" - } - ] - } - }, - { - "grid": { - "x": 36, - "y": 0, - "w": 12, - "h": 5 - }, - "type": "vis", - "config": { - "type": "metric", - "data_source": { - "type": "data_view_spec", - "index_pattern": "kibana_sample_data_logs", - "time_field": "timestamp" - }, - "metrics": [ - { - "type": "primary", - "operation": "average", - "field": "bytes" - } - ] - } - }, - { - "grid": { - "x": 24, - "y": 5, - "w": 24, - "h": 10 - }, - "type": "vis", - "config": { - "type": "xy", - "title": "Requests 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 - } - } - } - } - } - ] - }' - - lang: Console - label: Create a dashboard (simple) - Console - source: | - POST kbn:/api/dashboards - { - "title": "Web logs overview", - "panels": [ - { - "grid": { - "x": 0, - "y": 0, - "w": 24, - "h": 15 - }, - "type": "markdown", - "config": { - "content": "## Web logs overview\n\n \n\nCreated with the [Dashboards API](https://www.elastic.co/docs/api/doc/kibana) using the Kibana sample web logs dataset (`kibana_sample_data_logs`). Contains:\n- This markdown panel\n- 2 metrics, showing request count and average response size\n- A line chart based on an ES|QL query\n\n \n\n \n\n[Learn more about dashboards](https://www.elastic.co/docs/explore-analyze/dashboards)" - } - }, - { - "grid": { - "x": 24, - "y": 0, - "w": 12, - "h": 5 - }, - "type": "vis", - "config": { - "type": "metric", - "data_source": { - "type": "data_view_spec", - "index_pattern": "kibana_sample_data_logs", - "time_field": "timestamp" - }, - "metrics": [ - { - "type": "primary", - "operation": "count" - } - ] - } - }, - { - "grid": { - "x": 36, - "y": 0, - "w": 12, - "h": 5 - }, - "type": "vis", - "config": { - "type": "metric", - "data_source": { - "type": "data_view_spec", - "index_pattern": "kibana_sample_data_logs", - "time_field": "timestamp" - }, - "metrics": [ - { - "type": "primary", - "operation": "average", - "field": "bytes" - } - ] - } - }, - { - "grid": { - "x": 24, - "y": 5, - "w": 24, - "h": 10 - }, - "type": "vis", - "config": { - "type": "xy", - "title": "Requests 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 - } - } - } - } - } - ] - } - - lang: cURL - label: Create a dashboard (with sections and controls) - cURL - source: | - curl -X POST "${KIBANA_URL}/api/dashboards" \ - -H "Authorization: ApiKey ${API_KEY}" \ - -H "kbn-xsrf: true" \ - -H "Content-Type: application/json" \ - -d '{ - "title": "Operations overview", - "time_range": { - "from": "now-7d", - "to": "now" - }, - "pinned_panels": [ - { - "type": "options_list_control", - "width": "medium", - "grow": true, - "config": { - "title": "Response code", - "data_view_id": "90943e30-9a47-11e8-b64d-95841ca0b247", - "field_name": "response.keyword" - } - } - ], - "panels": [ - { - "title": "Key metrics", - "collapsed": false, - "grid": { - "y": 0 - }, - "panels": [ - { - "grid": { - "x": 0, - "y": 0, - "w": 12, - "h": 5 - }, - "type": "vis", - "config": { - "type": "metric", - "data_source": { - "type": "data_view_spec", - "index_pattern": "kibana_sample_data_logs", - "time_field": "timestamp" - }, - "metrics": [ - { - "type": "primary", - "operation": "count" - } - ] - } - }, - { - "grid": { - "x": 12, - "y": 0, - "w": 12, - "h": 5 - }, - "type": "vis", - "config": { - "type": "metric", - "data_source": { - "type": "data_view_spec", - "index_pattern": "kibana_sample_data_logs", - "time_field": "timestamp" - }, - "metrics": [ - { - "type": "primary", - "operation": "average", - "field": "bytes" - } - ] - } - } - ] - }, - { - "title": "Traffic trends", - "collapsed": false, - "grid": { - "y": 8 - }, - "panels": [ - { - "grid": { - "x": 0, - "y": 0, - "w": 24, - "h": 10 - }, - "type": "vis", - "config": { - "type": "xy", - "title": "Requests 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" - } - ] - } - ], - "axis": { - "x": { - "title": { - "visible": false - } - } - } - } - }, - { - "grid": { - "x": 24, - "y": 0, - "w": 24, - "h": 10 - }, - "type": "vis", - "config": { - "type": "xy", - "title": "Requests over time (ES|QL)", - "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 - } - } - } - } - } - ] - } - ] - }' - - lang: Console - label: Create a dashboard (with sections and controls) - Console - source: | - POST kbn:/api/dashboards - { - "title": "Operations overview", - "time_range": { - "from": "now-7d", - "to": "now" - }, - "pinned_panels": [ - { - "type": "options_list_control", - "width": "medium", - "grow": true, - "config": { - "title": "Response code", - "data_view_id": "90943e30-9a47-11e8-b64d-95841ca0b247", - "field_name": "response.keyword" - } - } - ], - "panels": [ - { - "title": "Key metrics", - "collapsed": false, - "grid": { - "y": 0 - }, - "panels": [ - { - "grid": { - "x": 0, - "y": 0, - "w": 12, - "h": 5 - }, - "type": "vis", - "config": { - "type": "metric", - "data_source": { - "type": "data_view_spec", - "index_pattern": "kibana_sample_data_logs", - "time_field": "timestamp" - }, - "metrics": [ - { - "type": "primary", - "operation": "count" - } - ] - } - }, - { - "grid": { - "x": 12, - "y": 0, - "w": 12, - "h": 5 - }, - "type": "vis", - "config": { - "type": "metric", - "data_source": { - "type": "data_view_spec", - "index_pattern": "kibana_sample_data_logs", - "time_field": "timestamp" - }, - "metrics": [ - { - "type": "primary", - "operation": "average", - "field": "bytes" - } - ] - } - } - ] - }, - { - "title": "Traffic trends", - "collapsed": false, - "grid": { - "y": 8 - }, - "panels": [ - { - "grid": { - "x": 0, - "y": 0, - "w": 24, - "h": 10 - }, - "type": "vis", - "config": { - "type": "xy", - "title": "Requests 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" - } - ] - } - ], - "axis": { - "x": { - "title": { - "visible": false - } - } - } - } - }, - { - "grid": { - "x": 24, - "y": 0, - "w": 24, - "h": 10 - }, - "type": "vis", - "config": { - "type": "xy", - "title": "Requests over time (ES|QL)", - "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 - } - } - } - } - } - ] - } - ] - } - /api/dashboards/{id}: - delete: - description: |- - **Spaces method and path for this operation:** - -
delete /s/{space_id}/api/dashboards/{id}
- - Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information. - - Permanently deletes a dashboard by ID. - operationId: delete-dashboards-id - parameters: - - description: A required header to protect against CSRF attacks - in: header - name: kbn-xsrf - required: true - schema: - example: 'true' - type: string - - description: The dashboard ID, as returned by the create or search endpoints. - in: path - name: id - required: true - schema: - type: string + summary: Create a dashboard + operationId: create-dashboard-redirect + description: | + > **Technical preview** — The Dashboards API is currently in technical preview and its full reference documentation is temporarily hosted at a separate location. + > + > **[View the full Dashboards API reference →](https://elastic.github.io/dashboards-api-spec/dashboards#tag/Dashboards)** responses: '200': - description: deleted - '403': - description: forbidden - '404': - description: not found - '500': - description: internal server error - summary: Delete a dashboard + description: See the full Dashboards API reference for detailed response schemas. + /api/dashboards/{id}: + get: tags: - Dashboards - x-state: Technical Preview; added in 9.4.0 - x-metaTags: - - content: Kibana - name: product_name - x-codeSamples: - - lang: cURL - label: Delete a dashboard - cURL - source: | - curl -X DELETE "${KIBANA_URL}/api/dashboards/3c4b8e10-d57a-11ef-9a52-4f3c2a8d0e1b" \ - -H "Authorization: ApiKey ${API_KEY}" \ - -H "kbn-xsrf: true" - - lang: Console - label: Delete a dashboard - Console - source: | - DELETE kbn:/api/dashboards/3c4b8e10-d57a-11ef-9a52-4f3c2a8d0e1b - get: - description: |- - **Spaces method and path for this operation:** - -
get /s/{space_id}/api/dashboards/{id}
- - Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information. - - Returns the complete state of a dashboard by ID. - operationId: get-dashboards-id - parameters: - - description: The dashboard ID, as returned by the create or search endpoints. - in: path - name: id - required: true - schema: - type: string + summary: Get a dashboard + operationId: get-dashboard-redirect + description: | + > **Technical preview** — The Dashboards API is currently in technical preview and its full reference documentation is temporarily hosted at a separate location. + > + > **[View the full Dashboards API reference →](https://elastic.github.io/dashboards-api-spec/dashboards#tag/Dashboards)** responses: '200': - content: - application/json: - schema: - additionalProperties: false - type: object - properties: - data: - $ref: '#/components/schemas/Kibana_HTTP_APIs_kbn-dashboard-data' - id: - description: The unique ID of the dashboard, as returned by the create or search endpoints. - type: string - meta: - $ref: '#/components/schemas/Kibana_HTTP_APIs_kbn-as-code-meta' - warnings: - description: Panels dropped because their type is not supported by the API. Present only when one or more panels could not be returned. - items: - $ref: '#/components/schemas/Kibana_HTTP_APIs_kbn-dashboard-dropped-panel-warning' - maxItems: 100 - type: array - required: - - id - - data - - meta - examples: - getDashboardResponse: - summary: Get dashboard response - description: | - The full dashboard state including all panels, options, and metadata. - value: - id: 3c4b8e10-d57a-11ef-9a52-4f3c2a8d0e1b - data: - options: - hide_panel_titles: false - hide_panel_borders: false - use_margins: true - auto_apply_filters: true - sync_colors: false - sync_cursor: true - sync_tooltips: false - title: Web logs overview - panels: - - grid: - x: 0 - 'y': 0 - w: 12 - h: 8 - config: - title: Total requests - data_source: - type: data_view_spec - index_pattern: kibana_sample_data_logs - time_field: timestamp - type: metric - sampling: 1 - ignore_global_filters: false - metrics: - - type: primary - operation: count - empty_as_null: false - styling: - primary: - position: bottom - labels: - alignment: left - value: - sizing: auto - alignment: right - id: a1b2c3d4-0001-4000-8000-000000000001 - type: vis - - grid: - x: 12 - 'y': 0 - w: 12 - h: 8 - config: - title: Average response size - data_source: - type: data_view_spec - index_pattern: kibana_sample_data_logs - time_field: timestamp - type: metric - sampling: 1 - ignore_global_filters: false - metrics: - - type: primary - operation: average - field: bytes - styling: - primary: - position: bottom - labels: - alignment: left - value: - sizing: auto - alignment: right - id: a1b2c3d4-0001-4000-8000-000000000002 - type: vis - - grid: - x: 0 - 'y': 15 - w: 24 - h: 10 - config: - title: Requests over time - type: xy - layers: - - type: line - data_source: - type: esql - query: FROM kibana_sample_data_logs | STATS count = COUNT() BY BUCKET(@timestamp, 75, ?_tstart, ?_tend) - sampling: 1 - ignore_global_filters: false - x: - column: BUCKET(@timestamp, 75, ?_tstart, ?_tend) - 'y': - - column: count - axis_id: 'y' - axis: - x: - title: - visible: false - ticks: - visible: true - grid: - visible: true - domain: - type: fit - rounding: false - labels: - orientation: horizontal - scale: ordinal - 'y': - anchor: start - title: - visible: true - scale: linear - ticks: - visible: true - grid: - visible: true - domain: - type: full - rounding: true - labels: - orientation: horizontal - styling: - overlays: - partial_buckets: - visible: false - current_time_marker: - visible: false - interpolation: linear - points: - visibility: auto - legend: - visibility: hidden - placement: outside - position: right - layout: - type: grid - truncate: - max_lines: 1 - id: a1b2c3d4-0001-4000-8000-000000000003 - type: vis - pinned_panels: [] - meta: - created_at: '2026-04-13T10:00:00.000Z' - managed: false - updated_at: '2026-04-13T10:00:00.000Z' - version: WzEwMiwxXQ== - description: success - '400': - description: invalid response - '403': - description: forbidden - '404': - description: not found - '500': - description: internal server error - summary: Get a dashboard + description: See the full Dashboards API reference for detailed response schemas. + put: tags: - Dashboards - x-state: Technical Preview; added in 9.4.0 - x-metaTags: - - content: Kibana - name: product_name - x-codeSamples: - - lang: cURL - label: Get a dashboard - cURL - source: | - curl -X GET "${KIBANA_URL}/api/dashboards/3c4b8e10-d57a-11ef-9a52-4f3c2a8d0e1b" \ - -H "Authorization: ApiKey ${API_KEY}" - - lang: Console - label: Get a dashboard - Console - source: | - GET kbn:/api/dashboards/3c4b8e10-d57a-11ef-9a52-4f3c2a8d0e1b - put: + summary: Update a dashboard + operationId: update-dashboard-redirect description: | - **Spaces method and path for this operation:** - -
put /s/{space_id}/api/dashboards/{id}
- - Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-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. - - You can optionally include `access_control.access_mode` to change the dashboard access mode. - If the authenticated user is not authorized to change access mode for the target dashboard, - the request returns a `403` response with a descriptive `message`. - operationId: put-dashboards-id - parameters: - - description: A required header to protect against CSRF attacks - in: header - name: kbn-xsrf - required: true - schema: - example: 'true' - type: string - - description: The dashboard identifier, as returned by the create or search endpoints. - in: path - name: id - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Kibana_HTTP_APIs_kbn-dashboard-data' - examples: - updateDashboard: - summary: Update a dashboard - value: - title: Web logs overview - panels: - - grid: - x: 0 - 'y': 0 - w: 12 - h: 5 - type: vis - config: - type: metric - data_source: - type: data_view_spec - index_pattern: kibana_sample_data_logs - time_field: timestamp - metrics: - - type: primary - operation: count - - grid: - x: 12 - 'y': 0 - w: 12 - h: 5 - type: vis - config: - type: metric - data_source: - type: data_view_spec - index_pattern: kibana_sample_data_logs - time_field: timestamp - metrics: - - type: primary - operation: average - field: bytes - - grid: - x: 0 - 'y': 8 - w: 24 - h: 10 - type: vis - config: - type: xy - title: Requests 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 - - grid: - x: 24 - 'y': 8 - w: 12 - h: 5 - type: vis - config: - type: metric - data_source: - type: data_view_spec - index_pattern: kibana_sample_data_logs - time_field: timestamp - metrics: - - type: primary - operation: unique_count - field: clientip + > **Technical preview** — The Dashboards API is currently in technical preview and its full reference documentation is temporarily hosted at a separate location. + > + > **[View the full Dashboards API reference →](https://elastic.github.io/dashboards-api-spec/dashboards#tag/Dashboards)** responses: '200': - content: - application/json: - schema: - additionalProperties: false - type: object - properties: - data: - $ref: '#/components/schemas/Kibana_HTTP_APIs_kbn-dashboard-data' - id: - description: The unique ID of the dashboard, as returned by the create or search endpoints. - type: string - meta: - $ref: '#/components/schemas/Kibana_HTTP_APIs_kbn-as-code-meta' - required: - - id - - data - - meta - examples: - updateDashboardResponse: - summary: Update dashboard response - description: | - 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. - value: - id: 3c4b8e10-d57a-11ef-9a52-4f3c2a8d0e1b - data: - options: - hide_panel_titles: false - hide_panel_borders: false - use_margins: true - auto_apply_filters: true - sync_colors: false - sync_cursor: true - sync_tooltips: false - panels: - - grid: - x: 0 - 'y': 0 - w: 24 - h: 15 - config: - content: |- - ## Web logs overview - -   - - Created with the [Dashboards API](https://www.elastic.co/docs/api/doc/kibana) using the Kibana sample web logs dataset (`kibana_sample_data_logs`). Contains: - - This markdown panel - - 2 metrics, showing request count and average response size - - A line chart based on an ES|QL query - -   - -   - - [Learn more about dashboards](https://www.elastic.co/docs/explore-analyze/dashboards) - id: a1b2c3d4-0001-4000-8000-000000000001 - type: markdown - - grid: - x: 24 - 'y': 0 - w: 12 - h: 5 - config: - title: '' - data_source: - type: data_view_spec - index_pattern: kibana_sample_data_logs - time_field: timestamp - type: metric - sampling: 1 - ignore_global_filters: false - metrics: - - type: primary - operation: count - empty_as_null: false - styling: - primary: - position: bottom - labels: - alignment: left - value: - sizing: auto - alignment: right - id: a1b2c3d4-0001-4000-8000-000000000002 - type: vis - - grid: - x: 36 - 'y': 0 - w: 12 - h: 5 - config: - title: '' - data_source: - type: data_view_spec - index_pattern: kibana_sample_data_logs - time_field: timestamp - type: metric - sampling: 1 - ignore_global_filters: false - metrics: - - type: primary - operation: average - field: bytes - styling: - primary: - position: bottom - labels: - alignment: left - value: - sizing: auto - alignment: right - id: a1b2c3d4-0001-4000-8000-000000000003 - type: vis - - grid: - x: 24 - 'y': 5 - w: 24 - h: 10 - config: - title: Requests over time - type: xy - layers: - - type: line - data_source: - type: esql - query: FROM kibana_sample_data_logs | STATS count = COUNT() BY BUCKET(@timestamp, 75, ?_tstart, ?_tend) - sampling: 1 - ignore_global_filters: false - x: - column: BUCKET(@timestamp, 75, ?_tstart, ?_tend) - 'y': - - column: count - axis_id: 'y' - axis: - x: - title: - visible: false - ticks: - visible: true - grid: - visible: true - domain: - type: fit - rounding: false - labels: - orientation: horizontal - scale: ordinal - 'y': - anchor: start - title: - visible: true - scale: linear - ticks: - visible: true - grid: - visible: true - domain: - type: full - rounding: true - labels: - orientation: horizontal - styling: - overlays: - partial_buckets: - visible: false - current_time_marker: - visible: false - interpolation: linear - points: - visibility: auto - legend: - visibility: hidden - placement: outside - position: right - layout: - type: grid - truncate: - max_lines: 1 - id: a1b2c3d4-0001-4000-8000-000000000003 - type: vis - - grid: - x: 24 - 'y': 8 - w: 24 - h: 10 - config: - title: Unique visitors - data_source: - type: data_view_spec - index_pattern: kibana_sample_data_logs - time_field: timestamp - type: metric - sampling: 1 - ignore_global_filters: false - metrics: - - type: primary - operation: unique_count - field: clientip - empty_as_null: false - styling: - primary: - position: bottom - labels: - alignment: left - value: - sizing: auto - alignment: right - id: a1b2c3d4-0001-4000-8000-000000000004 - type: vis - pinned_panels: [] - title: Web logs overview - meta: - managed: false - updated_at: '2026-04-13T11:00:00.000Z' - version: WzEwMywxXQ== - description: updated - '201': - content: - application/json: - schema: - additionalProperties: false - type: object - properties: - data: - $ref: '#/components/schemas/Kibana_HTTP_APIs_kbn-dashboard-data' - id: - description: The unique ID of the dashboard, as returned by the create or search endpoints. - type: string - meta: - $ref: '#/components/schemas/Kibana_HTTP_APIs_kbn-as-code-meta' - required: - - id - - data - - meta - examples: - createDashboardResponse: - summary: Create dashboard response (PUT) - description: | - Response when PUT creates a new dashboard (no existing dashboard with the given ID). Returns the generated state and metadata. Default option values are always returned even when not explicitly set in the request. - value: - id: 3c4b8e10-d57a-11ef-9a52-4f3c2a8d0e1b - data: - options: - hide_panel_titles: false - hide_panel_borders: false - use_margins: true - auto_apply_filters: true - sync_colors: false - sync_cursor: true - sync_tooltips: false - panels: - - grid: - x: 0 - 'y': 0 - w: 12 - h: 5 - config: - title: '' - data_source: - type: data_view_spec - index_pattern: kibana_sample_data_logs - time_field: timestamp - type: metric - sampling: 1 - ignore_global_filters: false - metrics: - - type: primary - operation: count - empty_as_null: false - styling: - primary: - position: bottom - labels: - alignment: left - value: - sizing: auto - alignment: right - id: a1b2c3d4-0001-4000-8000-000000000001 - type: vis - pinned_panels: [] - title: Web logs overview - meta: - created_at: '2026-04-13T10:00:00.000Z' - managed: false - updated_at: '2026-04-13T10:00:00.000Z' - version: WzEwMiwxXQ== - description: created - '400': - description: invalid request - '403': - description: forbidden - '409': - description: conflict - summary: Upsert a dashboard + description: See the full Dashboards API reference for detailed response schemas. + delete: tags: - Dashboards - x-state: Technical Preview; added in 9.4.0 - x-metaTags: - - content: Kibana - name: product_name - x-codeSamples: - - lang: cURL - label: Update a dashboard - cURL - source: | - curl -X PUT "${KIBANA_URL}/api/dashboards/3c4b8e10-d57a-11ef-9a52-4f3c2a8d0e1b" \ - -H "Authorization: ApiKey ${API_KEY}" \ - -H "kbn-xsrf: true" \ - -H "Content-Type: application/json" \ - -d '{ - "title": "Web logs overview", - "panels": [ - { - "grid": { - "x": 0, - "y": 0, - "w": 12, - "h": 5 - }, - "type": "vis", - "config": { - "type": "metric", - "data_source": { - "type": "data_view_spec", - "index_pattern": "kibana_sample_data_logs", - "time_field": "timestamp" - }, - "metrics": [ - { - "type": "primary", - "operation": "count" - } - ] - } - }, - { - "grid": { - "x": 12, - "y": 0, - "w": 12, - "h": 5 - }, - "type": "vis", - "config": { - "type": "metric", - "data_source": { - "type": "data_view_spec", - "index_pattern": "kibana_sample_data_logs", - "time_field": "timestamp" - }, - "metrics": [ - { - "type": "primary", - "operation": "average", - "field": "bytes" - } - ] - } - }, - { - "grid": { - "x": 0, - "y": 8, - "w": 24, - "h": 10 - }, - "type": "vis", - "config": { - "type": "xy", - "title": "Requests 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 - } - } - } - } - }, - { - "grid": { - "x": 24, - "y": 8, - "w": 12, - "h": 5 - }, - "type": "vis", - "config": { - "type": "metric", - "data_source": { - "type": "data_view_spec", - "index_pattern": "kibana_sample_data_logs", - "time_field": "timestamp" - }, - "metrics": [ - { - "type": "primary", - "operation": "unique_count", - "field": "clientip" - } - ] - } - } - ] - }' - - lang: Console - label: Update a dashboard - Console - source: | - PUT kbn:/api/dashboards/3c4b8e10-d57a-11ef-9a52-4f3c2a8d0e1b - { - "title": "Web logs overview", - "panels": [ - { - "grid": { - "x": 0, - "y": 0, - "w": 12, - "h": 5 - }, - "type": "vis", - "config": { - "type": "metric", - "data_source": { - "type": "data_view_spec", - "index_pattern": "kibana_sample_data_logs", - "time_field": "timestamp" - }, - "metrics": [ - { - "type": "primary", - "operation": "count" - } - ] - } - }, - { - "grid": { - "x": 12, - "y": 0, - "w": 12, - "h": 5 - }, - "type": "vis", - "config": { - "type": "metric", - "data_source": { - "type": "data_view_spec", - "index_pattern": "kibana_sample_data_logs", - "time_field": "timestamp" - }, - "metrics": [ - { - "type": "primary", - "operation": "average", - "field": "bytes" - } - ] - } - }, - { - "grid": { - "x": 0, - "y": 8, - "w": 24, - "h": 10 - }, - "type": "vis", - "config": { - "type": "xy", - "title": "Requests 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 - } - } - } - } - }, - { - "grid": { - "x": 24, - "y": 8, - "w": 12, - "h": 5 - }, - "type": "vis", - "config": { - "type": "metric", - "data_source": { - "type": "data_view_spec", - "index_pattern": "kibana_sample_data_logs", - "time_field": "timestamp" - }, - "metrics": [ - { - "type": "primary", - "operation": "unique_count", - "field": "clientip" - } - ] - } - } - ] - } + summary: Delete a dashboard + operationId: delete-dashboard-redirect + description: | + > **Technical preview** — The Dashboards API is currently in technical preview and its full reference documentation is temporarily hosted at a separate location. + > + > **[View the full Dashboards API reference →](https://elastic.github.io/dashboards-api-spec/dashboards#tag/Dashboards)** + responses: + '200': + description: See the full Dashboards API reference for detailed response schemas. /api/data_views: get: description: | @@ -90719,1138 +88758,66 @@ paths: name: product_name /api/visualizations: get: - description: |- - **Spaces method and path for this operation:** - -
get /s/{space_id}/api/visualizations
- - Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information. - - Returns a paginated list of Lens visualizations matching the optional `query` text. - operationId: get-visualizations - parameters: - - description: The saved object fields to include in each result. When omitted, all fields are returned. - in: query - name: fields - required: false - schema: - items: - type: string - maxItems: 100 - type: array - - description: The fields to match the `query` text against. Defaults to `title` when omitted. - in: query - name: search_fields - required: false - schema: - items: - type: string - maxItems: 100 - type: array - - description: Text to match against `search_fields`. - in: query - name: query - required: false - schema: - type: string - - description: The page of results to return. - in: query - name: page - required: false - schema: - default: 1 - minimum: 1 - type: number - - description: The number of results to return per page. - in: query - name: per_page - required: false - schema: - default: 20 - maximum: 1000 - minimum: 1 - type: number - responses: - '200': - content: - application/json: - schema: - additionalProperties: false - type: object - properties: - data: - items: - $ref: '#/components/schemas/Kibana_HTTP_APIs_lensResponseItem' - maxItems: 1000 - type: array - meta: - additionalProperties: false - type: object - properties: - page: - default: 1 - description: The returned page of results. - minimum: 1 - type: number - per_page: - default: 20 - description: The number of results returned per page. - maximum: 1000 - minimum: 1 - type: number - total: - description: The total number of results matching the query. - type: number - required: - - total - required: - - data - - meta - examples: - searchVisualizationsResponse: - summary: Search visualizations response - description: | - 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. - value: - data: - - id: 1e4f0a30-b3c5-11ef-bd7a-2b6b1a8c0f3d - data: - title: Total requests - data_source: - type: data_view_spec - index_pattern: kibana_sample_data_logs - time_field: timestamp - type: metric - sampling: 1 - ignore_global_filters: false - metrics: - - type: primary - operation: count - empty_as_null: false - styling: - primary: - position: bottom - labels: - alignment: left - value: - sizing: auto - alignment: right - meta: - created_at: '2026-04-13T10:00:00.000Z' - managed: false - updated_at: '2026-04-13T10:00:00.000Z' - version: WzU5LDFd - - id: 3a7c2e10-b3c5-11ef-bd7a-2b6b1a8c0f3d - data: - title: Log entries over time - type: xy - layers: - - type: line - data_source: - type: data_view_spec - index_pattern: kibana_sample_data_logs - time_field: timestamp - sampling: 1 - ignore_global_filters: false - x: - operation: date_histogram - field: timestamp - suggested_interval: auto - use_original_time_range: false - include_empty_rows: true - drop_partial_intervals: false - 'y': - - operation: count - empty_as_null: false - axis_id: 'y' - axis: - x: - title: - visible: true - ticks: - visible: true - grid: - visible: true - domain: - type: fit - rounding: false - labels: - orientation: horizontal - 'y': - anchor: start - title: - visible: true - scale: linear - ticks: - visible: true - grid: - visible: true - domain: - type: full - rounding: true - labels: - orientation: horizontal - styling: - overlays: - partial_buckets: - visible: false - current_time_marker: - visible: false - interpolation: linear - points: - visibility: auto - legend: - visibility: hidden - placement: outside - position: right - layout: - type: grid - truncate: - max_lines: 1 - meta: - created_at: '2026-04-13T10:05:00.000Z' - managed: false - updated_at: '2026-04-13T10:05:00.000Z' - version: WzYwLDFd - meta: - page: 1 - per_page: 20 - total: 2 - description: Ok - '400': - description: Malformed request - '401': - description: Unauthorized - '403': - description: Forbidden - '500': - description: Internal Server Error - summary: Search visualizations tags: - Visualizations - x-state: Technical Preview; added in 9.4.0 - x-metaTags: - - content: Kibana - name: product_name - x-codeSamples: - - lang: cURL - label: Search visualizations - cURL - source: | - curl -X GET "${KIBANA_URL}/api/visualizations?query=requests&per_page=10" \ - -H "Authorization: ApiKey ${API_KEY}" - - lang: Console - label: Search visualizations - Console - source: | - GET kbn:/api/visualizations?query=requests&per_page=10 - post: - description: |- - **Spaces method and path for this operation:** - -
post /s/{space_id}/api/visualizations
- - Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information. - - Creates a Lens visualization and saves it to the library. - - ES|QL visualizations cannot be created through this endpoint. - operationId: post-visualizations - parameters: - - description: A required header to protect against CSRF attacks - in: header - name: kbn-xsrf - required: true - schema: - example: 'true' - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Kibana_HTTP_APIs_lensApiConfigNoESQL' - examples: - createMetricVisualization: - summary: Create a metric visualization - value: - type: metric - title: Total requests - data_source: - type: data_view_spec - index_pattern: kibana_sample_data_logs - time_field: timestamp - metrics: - - type: primary - operation: count - createXYVisualization: - summary: Create an XY line chart - value: - type: xy - title: 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 - createPieVisualization: - summary: Create a pie/donut chart - value: - type: pie - title: Requests by response code - donut_hole: m - data_source: - type: data_view_spec - index_pattern: kibana_sample_data_logs - time_field: timestamp - metrics: - - operation: count - group_by: - - operation: terms - fields: - - response.keyword - limit: 5 - createDataTableVisualization: - summary: Create a data table - value: - type: data_table - title: Top response codes - data_source: - type: data_view_spec - index_pattern: kibana_sample_data_logs - time_field: timestamp - metrics: - - operation: count - rows: - - operation: terms - fields: - - response.keyword - limit: 5 - createDataViewReferenceVisualization: - summary: Create a visualization using a library data view - value: - type: metric - title: Total requests (library data view) - data_source: - type: data_view_reference - ref_id: 90943e30-9a47-11e8-b64d-95841ca0b247 - metrics: - - type: primary - operation: count + summary: Get visualizations + operationId: get-visualizations-redirect + description: | + > **Technical preview** — The Visualizations API is currently in technical preview and its full reference documentation is temporarily hosted at a separate location. + > + > **[View the full Visualizations API reference →](https://elastic.github.io/dashboards-api-spec/visualizations#tag/Visualizations)** responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/Kibana_HTTP_APIs_lensResponseItem' - examples: - createMetricVisualizationResponse: - summary: Create a metric visualization - description: | - Response after creating a metric chart (count of requests) using an inline data view. Server-populated defaults are included in the response. - value: - id: 1e4f0a30-b3c5-11ef-bd7a-2b6b1a8c0f3d - data: - title: Total requests - data_source: - type: data_view_spec - index_pattern: kibana_sample_data_logs - time_field: timestamp - type: metric - sampling: 1 - ignore_global_filters: false - metrics: - - type: primary - operation: count - empty_as_null: false - styling: - primary: - position: bottom - labels: - alignment: left - value: - sizing: auto - alignment: right - meta: - created_at: '2026-04-13T10:00:00.000Z' - managed: false - updated_at: '2026-04-13T10:00:00.000Z' - version: WzU5LDFd - createXYVisualizationResponse: - summary: Create an XY line chart - description: | - Response after creating an XY line chart. The response includes server-populated defaults for axis configuration, styling, and legend. - value: - id: 3a7c2e10-b3c5-11ef-bd7a-2b6b1a8c0f3d - data: - title: Log entries over time - type: xy - layers: - - type: line - data_source: - type: data_view_spec - index_pattern: kibana_sample_data_logs - time_field: timestamp - sampling: 1 - ignore_global_filters: false - x: - operation: date_histogram - field: timestamp - suggested_interval: auto - use_original_time_range: false - include_empty_rows: true - drop_partial_intervals: false - 'y': - - operation: count - empty_as_null: false - axis_id: 'y' - axis: - x: - title: - visible: true - ticks: - visible: true - grid: - visible: true - domain: - type: fit - rounding: false - labels: - orientation: horizontal - 'y': - anchor: start - title: - visible: true - scale: linear - ticks: - visible: true - grid: - visible: true - domain: - type: full - rounding: true - labels: - orientation: horizontal - styling: - overlays: - partial_buckets: - visible: false - current_time_marker: - visible: false - interpolation: linear - points: - visibility: auto - legend: - visibility: hidden - placement: outside - position: right - layout: - type: grid - truncate: - max_lines: 1 - meta: - created_at: '2026-04-13T10:05:00.000Z' - managed: false - updated_at: '2026-04-13T10:05:00.000Z' - version: WzYwLDFd - createPieVisualizationResponse: - summary: Create a pie/donut chart - description: | - Response after creating a donut chart broken down by response code. Note that `group_by` items gain a server-populated `rank_by` sort order, and `legend`, `values`, and `labels` are populated with defaults. - value: - id: 2cac466f-ff49-4d34-8d69-487a93a179c2 - data: - title: Requests by response code - type: pie - metrics: - - operation: count - empty_as_null: false - group_by: - - operation: terms - fields: - - response.keyword - limit: 5 - rank_by: - type: metric - metric_index: 0 - direction: desc - data_source: - type: data_view_spec - index_pattern: kibana_sample_data_logs - time_field: timestamp - legend: - visibility: auto - values: - visible: true - mode: percentage - donut_hole: m - labels: - visible: true - position: outside - meta: - created_at: '2026-04-13T10:10:00.000Z' - managed: false - updated_at: '2026-04-13T10:10:00.000Z' - version: Wzc3LDFd - createDataTableVisualizationResponse: - summary: Create a data table - description: | - Response after creating a data table broken down by response code. Note that `rows` items gain a server-populated `rank_by` sort order. - value: - id: 83660652-bc77-46a1-8dca-5d512949eba6 - data: - title: Top response codes - type: data_table - data_source: - type: data_view_spec - index_pattern: kibana_sample_data_logs - time_field: timestamp - sampling: 1 - ignore_global_filters: false - metrics: - - operation: count - empty_as_null: false - rows: - - operation: terms - fields: - - response.keyword - limit: 5 - rank_by: - type: metric - metric_index: 0 - direction: desc - meta: - created_at: '2026-04-13T10:15:00.000Z' - managed: false - updated_at: '2026-04-13T10:15:00.000Z' - version: Wzc4LDFd - createDataViewReferenceResponse: - summary: Create a visualization using a library data view - description: | - Response after creating a metric chart that references an existing saved data view by ID (`ref_id`) instead of defining an inline index pattern. - value: - id: cc44837a-7f20-42ee-b317-9af4f5eacc9c - data: - title: Total requests (library data view) - data_source: - type: data_view_reference - ref_id: 90943e30-9a47-11e8-b64d-95841ca0b247 - type: metric - sampling: 1 - ignore_global_filters: false - metrics: - - type: primary - operation: count - empty_as_null: false - styling: - primary: - position: bottom - labels: - alignment: left - value: - sizing: auto - alignment: right - meta: - created_at: '2026-04-13T10:20:00.000Z' - managed: false - updated_at: '2026-04-13T10:20:00.000Z' - version: Wzc5LDFd - description: Created - '400': - description: Malformed request - '401': - description: Unauthorized - '403': - description: Forbidden - '500': - description: Internal Server Error - summary: Create visualization + '200': + description: See the full Visualizations API reference for detailed response schemas. + post: tags: - Visualizations - x-state: Technical Preview; added in 9.4.0 - x-metaTags: - - content: Kibana - name: product_name - x-codeSamples: - - lang: cURL - label: Create a metric visualization - cURL - source: | - curl -X POST "${KIBANA_URL}/api/visualizations" \ - -H "Authorization: ApiKey ${API_KEY}" \ - -H "kbn-xsrf: true" \ - -H "Content-Type: application/json" \ - -d '{ - "type": "metric", - "title": "Total requests", - "data_source": { - "type": "data_view_spec", - "index_pattern": "kibana_sample_data_logs", - "time_field": "timestamp" - }, - "metrics": [ - { - "type": "primary", - "operation": "count" - } - ] - }' - - lang: Console - label: Create a metric visualization - Console - source: | - POST kbn:/api/visualizations - { - "type": "metric", - "title": "Total requests", - "data_source": { - "type": "data_view_spec", - "index_pattern": "kibana_sample_data_logs", - "time_field": "timestamp" - }, - "metrics": [ - { - "type": "primary", - "operation": "count" - } - ] - } - - lang: cURL - label: Create an XY line chart - cURL - source: | - 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": "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" - } - ] - } - ] - }' - - lang: Console - label: Create an XY line chart - Console - source: | - POST kbn:/api/visualizations - { - "type": "xy", - "title": "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" - } - ] - } - ] - } - - lang: cURL - label: Create a pie/donut chart - cURL - source: | - curl -X POST "${KIBANA_URL}/api/visualizations" \ - -H "Authorization: ApiKey ${API_KEY}" \ - -H "kbn-xsrf: true" \ - -H "Content-Type: application/json" \ - -d '{ - "type": "pie", - "title": "Requests by response code", - "donut_hole": "m", - "data_source": { - "type": "data_view_spec", - "index_pattern": "kibana_sample_data_logs", - "time_field": "timestamp" - }, - "metrics": [ - { - "operation": "count" - } - ], - "group_by": [ - { - "operation": "terms", - "fields": [ - "response.keyword" - ], - "limit": 5 - } - ] - }' - - lang: Console - label: Create a pie/donut chart - Console - source: | - POST kbn:/api/visualizations - { - "type": "pie", - "title": "Requests by response code", - "donut_hole": "m", - "data_source": { - "type": "data_view_spec", - "index_pattern": "kibana_sample_data_logs", - "time_field": "timestamp" - }, - "metrics": [ - { - "operation": "count" - } - ], - "group_by": [ - { - "operation": "terms", - "fields": [ - "response.keyword" - ], - "limit": 5 - } - ] - } - - lang: cURL - label: Create a data table - cURL - source: | - curl -X POST "${KIBANA_URL}/api/visualizations" \ - -H "Authorization: ApiKey ${API_KEY}" \ - -H "kbn-xsrf: true" \ - -H "Content-Type: application/json" \ - -d '{ - "type": "data_table", - "title": "Top response codes", - "data_source": { - "type": "data_view_spec", - "index_pattern": "kibana_sample_data_logs", - "time_field": "timestamp" - }, - "metrics": [ - { - "operation": "count" - } - ], - "rows": [ - { - "operation": "terms", - "fields": [ - "response.keyword" - ], - "limit": 5 - } - ] - }' - - lang: Console - label: Create a data table - Console - source: | - POST kbn:/api/visualizations - { - "type": "data_table", - "title": "Top response codes", - "data_source": { - "type": "data_view_spec", - "index_pattern": "kibana_sample_data_logs", - "time_field": "timestamp" - }, - "metrics": [ - { - "operation": "count" - } - ], - "rows": [ - { - "operation": "terms", - "fields": [ - "response.keyword" - ], - "limit": 5 - } - ] - } - - lang: cURL - label: Create a visualization using a library data view - cURL - source: | - curl -X POST "${KIBANA_URL}/api/visualizations" \ - -H "Authorization: ApiKey ${API_KEY}" \ - -H "kbn-xsrf: true" \ - -H "Content-Type: application/json" \ - -d '{ - "type": "metric", - "title": "Total requests (library data view)", - "data_source": { - "type": "data_view_reference", - "ref_id": "90943e30-9a47-11e8-b64d-95841ca0b247" - }, - "metrics": [ - { - "type": "primary", - "operation": "count" - } - ] - }' - - lang: Console - label: Create a visualization using a library data view - Console - source: | - POST kbn:/api/visualizations - { - "type": "metric", - "title": "Total requests (library data view)", - "data_source": { - "type": "data_view_reference", - "ref_id": "90943e30-9a47-11e8-b64d-95841ca0b247" - }, - "metrics": [ - { - "type": "primary", - "operation": "count" - } - ] - } - /api/visualizations/{id}: - delete: - description: |- - **Spaces method and path for this operation:** - -
delete /s/{space_id}/api/visualizations/{id}
- - Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-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. - operationId: delete-visualizations-id - parameters: - - description: A required header to protect against CSRF attacks - in: header - name: kbn-xsrf - required: true - schema: - example: 'true' - type: string - - description: The visualization identifier, as returned by the create or search endpoints. - in: path - name: id - required: true - schema: - type: string + summary: Create a visualization + operationId: create-visualization-redirect + description: | + > **Technical preview** — The Visualizations API is currently in technical preview and its full reference documentation is temporarily hosted at a separate location. + > + > **[View the full Visualizations API reference →](https://elastic.github.io/dashboards-api-spec/visualizations#tag/Visualizations)** responses: - '204': - description: No Content - '400': - description: Malformed request - '401': - description: Unauthorized - '403': - description: Forbidden - '404': - description: Resource not found - '500': - description: Internal Server Error - summary: Delete visualization + '200': + description: See the full Visualizations API reference for detailed response schemas. + /api/visualizations/{id}: + get: tags: - Visualizations - x-state: Technical Preview; added in 9.4.0 - x-metaTags: - - content: Kibana - name: product_name - x-codeSamples: - - lang: cURL - label: Delete a visualization - cURL - source: | - curl -X DELETE "${KIBANA_URL}/api/visualizations/1e4f0a30-b3c5-11ef-bd7a-2b6b1a8c0f3d" \ - -H "Authorization: ApiKey ${API_KEY}" \ - -H "kbn-xsrf: true" - - lang: Console - label: Delete a visualization - Console - source: | - DELETE kbn:/api/visualizations/1e4f0a30-b3c5-11ef-bd7a-2b6b1a8c0f3d - get: - description: |- - **Spaces method and path for this operation:** - -
get /s/{space_id}/api/visualizations/{id}
- - Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information. - - Returns a single Lens visualization by its ID. - operationId: get-visualizations-id - parameters: - - description: The visualization identifier, as returned by the create or search endpoints. - in: path - name: id - required: true - schema: - type: string + summary: Get a visualization + operationId: get-visualization-redirect + description: | + > **Technical preview** — The Visualizations API is currently in technical preview and its full reference documentation is temporarily hosted at a separate location. + > + > **[View the full Visualizations API reference →](https://elastic.github.io/dashboards-api-spec/visualizations#tag/Visualizations)** responses: '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Kibana_HTTP_APIs_lensResponseItem' - examples: - getVisualizationResponse: - summary: Get visualization response - description: | - The full visualization state including the chart configuration and metadata. - value: - id: 1e4f0a30-b3c5-11ef-bd7a-2b6b1a8c0f3d - data: - title: Total requests - data_source: - type: data_view_spec - index_pattern: kibana_sample_data_logs - time_field: timestamp - type: metric - sampling: 1 - ignore_global_filters: false - metrics: - - type: primary - operation: count - empty_as_null: false - styling: - primary: - position: bottom - labels: - alignment: left - value: - sizing: auto - alignment: right - meta: - created_at: '2026-04-13T10:00:00.000Z' - managed: false - updated_at: '2026-04-13T10:00:00.000Z' - version: WzU5LDFd - description: Ok - '400': - description: Malformed request - '401': - description: Unauthorized - '403': - description: Forbidden - '404': - description: Resource not found - '500': - description: Internal Server Error - summary: Get visualization + description: See the full Visualizations API reference for detailed response schemas. + put: tags: - Visualizations - x-state: Technical Preview; added in 9.4.0 - x-metaTags: - - content: Kibana - name: product_name - x-codeSamples: - - lang: cURL - label: Get a visualization - cURL - source: | - curl -X GET "${KIBANA_URL}/api/visualizations/1e4f0a30-b3c5-11ef-bd7a-2b6b1a8c0f3d" \ - -H "Authorization: ApiKey ${API_KEY}" - - lang: Console - label: Get a visualization - Console - source: | - GET kbn:/api/visualizations/1e4f0a30-b3c5-11ef-bd7a-2b6b1a8c0f3d - put: - description: |- - **Spaces method and path for this operation:** - -
put /s/{space_id}/api/visualizations/{id}
- - Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-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. - operationId: put-visualizations-id - parameters: - - description: A required header to protect against CSRF attacks - in: header - name: kbn-xsrf - required: true - schema: - example: 'true' - type: string - - description: The visualization identifier, as returned by the create or search endpoints. - in: path - name: id - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Kibana_HTTP_APIs_lensApiConfigNoESQL' - examples: - updateVisualization: - summary: Update a visualization - value: - type: metric - title: Total requests (updated) - data_source: - type: data_view_spec - index_pattern: kibana_sample_data_logs - time_field: timestamp - metrics: - - type: primary - operation: count + summary: Update a visualization + operationId: update-visualization-redirect + description: | + > **Technical preview** — The Visualizations API is currently in technical preview and its full reference documentation is temporarily hosted at a separate location. + > + > **[View the full Visualizations API reference →](https://elastic.github.io/dashboards-api-spec/visualizations#tag/Visualizations)** responses: '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Kibana_HTTP_APIs_lensResponseItem' - examples: - updateVisualizationResponse: - summary: Update visualization response - description: | - 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. - value: - id: 1e4f0a30-b3c5-11ef-bd7a-2b6b1a8c0f3d - data: - title: Total requests (updated) - data_source: - type: data_view_spec - index_pattern: kibana_sample_data_logs - time_field: timestamp - type: metric - sampling: 1 - ignore_global_filters: false - metrics: - - type: primary - operation: count - empty_as_null: false - styling: - primary: - position: bottom - labels: - alignment: left - value: - sizing: auto - alignment: right - meta: - created_at: '2026-04-13T11:00:00.000Z' - managed: false - updated_at: '2026-04-13T11:00:00.000Z' - version: WzYxLDFd - description: Ok - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/Kibana_HTTP_APIs_lensResponseItem' - examples: - createdVisualizationResponse: - summary: Update visualization response - description: | - The created visualization state. Server-populated defaults are included in the response. - value: - id: 1e4f0a30-b3c5-11ef-bd7a-2b6b1a8c0f3d - data: - title: Total requests (updated) - data_source: - type: data_view_spec - index_pattern: kibana_sample_data_logs - time_field: timestamp - type: metric - sampling: 1 - ignore_global_filters: false - metrics: - - type: primary - operation: count - empty_as_null: false - styling: - primary: - position: bottom - labels: - alignment: left - value: - sizing: auto - alignment: right - meta: - created_at: '2026-04-13T11:00:00.000Z' - managed: false - updated_at: '2026-04-13T11:00:00.000Z' - version: WzYxLDFd - description: Created - '400': - description: Malformed request - '401': - description: Unauthorized - '403': - description: Forbidden - '500': - description: Internal Server Error - summary: Update visualization + description: See the full Visualizations API reference for detailed response schemas. + delete: tags: - Visualizations - x-state: Technical Preview; added in 9.4.0 - x-metaTags: - - content: Kibana - name: product_name - x-codeSamples: - - lang: cURL - label: Update a visualization - cURL - source: | - curl -X PUT "${KIBANA_URL}/api/visualizations/1e4f0a30-b3c5-11ef-bd7a-2b6b1a8c0f3d" \ - -H "Authorization: ApiKey ${API_KEY}" \ - -H "kbn-xsrf: true" \ - -H "Content-Type: application/json" \ - -d '{ - "type": "metric", - "title": "Total requests (updated)", - "data_source": { - "type": "data_view_spec", - "index_pattern": "kibana_sample_data_logs", - "time_field": "timestamp" - }, - "metrics": [ - { - "type": "primary", - "operation": "count" - } - ] - }' - - lang: Console - label: Update a visualization - Console - source: | - PUT kbn:/api/visualizations/1e4f0a30-b3c5-11ef-bd7a-2b6b1a8c0f3d - { - "type": "metric", - "title": "Total requests (updated)", - "data_source": { - "type": "data_view_spec", - "index_pattern": "kibana_sample_data_logs", - "time_field": "timestamp" - }, - "metrics": [ - { - "type": "primary", - "operation": "count" - } - ] - } + summary: Delete a visualization + operationId: delete-visualization-redirect + description: | + > **Technical preview** — The Visualizations API is currently in technical preview and its full reference documentation is temporarily hosted at a separate location. + > + > **[View the full Visualizations API reference →](https://elastic.github.io/dashboards-api-spec/visualizations#tag/Visualizations)** + responses: + '200': + description: See the full Visualizations API reference for detailed response schemas. /api/workflows: delete: description: |- From 0c6674e88d7546d75342a62fc12ff85734fee9be Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Mon, 1 Jun 2026 08:18:40 +0000 Subject: [PATCH 6/6] Changes from node scripts/regenerate_moon_projects.js --update --- src/platform/plugins/shared/workflows_management/moon.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/platform/plugins/shared/workflows_management/moon.yml b/src/platform/plugins/shared/workflows_management/moon.yml index d94c478813194..9019cbc51887d 100644 --- a/src/platform/plugins/shared/workflows_management/moon.yml +++ b/src/platform/plugins/shared/workflows_management/moon.yml @@ -107,10 +107,13 @@ dependsOn: - '@kbn/rule-data-utils' - '@kbn/std' - '@kbn/core-saved-objects-common' - - '@kbn/datemath' - - '@kbn/presentation-publishing' + - '@kbn/esql-types' + - '@kbn/esql-language' + - '@kbn/esql-utils' - '@kbn/inbox-plugin' - '@kbn/inbox-common' + - '@kbn/datemath' + - '@kbn/presentation-publishing' tags: - plugin - prod