From b44c576df99c8d80e11fd09cfa4ee3ee460230ed Mon Sep 17 00:00:00 2001 From: Nick Peihl Date: Thu, 5 Mar 2026 12:11:04 -0500 Subject: [PATCH 1/5] Make dashboard endpoints public with elastic-api-version 2023-10-31 --- .../shared/dashboard/common/constants.ts | 3 ++- .../dashboard_client/dashboard_client.ts | 7 +++--- .../dashboard/server/api/get_route_config.ts | 23 ++++++++----------- .../test/scout/api/fixtures/constants.ts | 3 ++- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/platform/plugins/shared/dashboard/common/constants.ts b/src/platform/plugins/shared/dashboard/common/constants.ts index 9c743e52107ba..dd66420946f8e 100644 --- a/src/platform/plugins/shared/dashboard/common/constants.ts +++ b/src/platform/plugins/shared/dashboard/common/constants.ts @@ -12,7 +12,8 @@ import { DASHBOARD_GRID_COLUMN_COUNT } from './page_bundle_constants'; /** The base API path for dashboard endpoints. */ export const DASHBOARD_API_PATH = '/api/dashboards'; export const DASHBOARD_APP_API_PATH = '/internal/dashboards/app'; -export const DASHBOARD_API_VERSION = '1'; +export const DASHBOARD_API_VERSION = '2023-10-31'; +export const DASHBOARD_APP_API_VERSION = '1'; export const DASHBOARD_SAVED_OBJECT_TYPE = 'dashboard'; diff --git a/src/platform/plugins/shared/dashboard/public/dashboard_client/dashboard_client.ts b/src/platform/plugins/shared/dashboard/public/dashboard_client/dashboard_client.ts index 0939ae5a6c17a..4b6df523b3817 100644 --- a/src/platform/plugins/shared/dashboard/public/dashboard_client/dashboard_client.ts +++ b/src/platform/plugins/shared/dashboard/public/dashboard_client/dashboard_client.ts @@ -16,6 +16,7 @@ import { DASHBOARD_API_PATH, DASHBOARD_API_VERSION, DASHBOARD_APP_API_PATH, + DASHBOARD_APP_API_VERSION, DASHBOARD_SAVED_OBJECT_TYPE, } from '../../common/constants'; import type { @@ -40,7 +41,7 @@ export const dashboardClient = { accessMode?: SavedObjectAccessControl['accessMode'] ) => { return coreServices.http.post(DASHBOARD_APP_API_PATH, { - version: DASHBOARD_API_VERSION, + version: DASHBOARD_APP_API_VERSION, body: JSON.stringify({ ...dashboardState, ...(accessMode && { access_control: { access_mode: accessMode } }), @@ -60,7 +61,7 @@ export const dashboardClient = { const result = await coreServices.http .get(`${DASHBOARD_APP_API_PATH}/${id}`, { - version: DASHBOARD_API_VERSION, + version: DASHBOARD_APP_API_VERSION, }) .catch((e) => { if (e.response?.status === 404) { @@ -95,7 +96,7 @@ export const dashboardClient = { const updateResponse = await coreServices.http.put( `${DASHBOARD_APP_API_PATH}/${id}`, { - version: DASHBOARD_API_VERSION, + version: DASHBOARD_APP_API_VERSION, body: JSON.stringify(dashboardState), } ); diff --git a/src/platform/plugins/shared/dashboard/server/api/get_route_config.ts b/src/platform/plugins/shared/dashboard/server/api/get_route_config.ts index e4fac24f5e9b1..fbac39fd877c6 100644 --- a/src/platform/plugins/shared/dashboard/server/api/get_route_config.ts +++ b/src/platform/plugins/shared/dashboard/server/api/get_route_config.ts @@ -7,7 +7,12 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { DASHBOARD_API_PATH, DASHBOARD_APP_API_PATH } from '../../common/constants'; +import { + DASHBOARD_API_PATH, + DASHBOARD_API_VERSION, + DASHBOARD_APP_API_PATH, + DASHBOARD_APP_API_VERSION, +} from '../../common/constants'; export function getRouteConfig(isDashboardAppRequest: boolean) { return isDashboardAppRequest @@ -27,26 +32,19 @@ export function getRouteConfig(isDashboardAppRequest: boolean) { }, }, } as const, - routeVersion: '1', + routeVersion: DASHBOARD_APP_API_VERSION, } : { basePath: DASHBOARD_API_PATH, routeConfig: { - // TODO change to public before FF - access: 'internal', - /** - * `enableQueryVersion` is a temporary solution for testing internal endpoints. - * Requests to these internal endpoints from Kibana Dev Tools or external clients - * should include the ?apiVersion=1 query parameter. - * This will be removed when the API is finalized and moved to a stable version. - */ - enableQueryVersion: true, + access: 'public', description: 'This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.', options: { tags: ['oas-tag:Dashboards'], availability: { stability: 'experimental', + since: '9.4.0', }, }, security: { @@ -56,7 +54,6 @@ export function getRouteConfig(isDashboardAppRequest: boolean) { }, }, } as const, - // TODO change to '2023-10-31' before FF - routeVersion: '1', + routeVersion: DASHBOARD_API_VERSION, }; } diff --git a/src/platform/plugins/shared/dashboard/test/scout/api/fixtures/constants.ts b/src/platform/plugins/shared/dashboard/test/scout/api/fixtures/constants.ts index 106f3181d5906..1544f07a98bbf 100644 --- a/src/platform/plugins/shared/dashboard/test/scout/api/fixtures/constants.ts +++ b/src/platform/plugins/shared/dashboard/test/scout/api/fixtures/constants.ts @@ -9,12 +9,13 @@ /** The base API path for dashboard endpoints (no leading slash for apiClient). */ export const DASHBOARD_API_PATH = 'api/dashboards'; +export const DASHBOARD_API_VERSION = '2023-10-31'; /** Common headers for Dashboard API requests (internal API version 1) */ export const COMMON_HEADERS = { 'kbn-xsrf': 'some-xsrf-token', 'x-elastic-internal-origin': 'kibana', - 'elastic-api-version': '1', + 'elastic-api-version': DASHBOARD_API_VERSION, } as const; /** Test data paths */ From 83f76b512ac9edf0f24c849b73c566e906483867 Mon Sep 17 00:00:00 2001 From: Nick Peihl Date: Thu, 2 Apr 2026 15:47:36 -0400 Subject: [PATCH 2/5] Update tests to use public elastic-api-version header --- .../apis/content_management/created_by.ts | 4 ++-- .../apis/content_management/updated_by.ts | 14 +++++++------- .../apis/spaces/get_content_summary.ts | 6 +++--- .../slo/test/scout/api/fixtures/constants.ts | 4 ++-- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/x-pack/platform/test/api_integration/apis/content_management/created_by.ts b/x-pack/platform/test/api_integration/apis/content_management/created_by.ts index be33b7d0fc956..778544d0986f1 100644 --- a/x-pack/platform/test/api_integration/apis/content_management/created_by.ts +++ b/x-pack/platform/test/api_integration/apis/content_management/created_by.ts @@ -19,7 +19,7 @@ export default function ({ getService }: FtrProviderContext) { const { body, status } = await supertest .post(DASHBOARD_API_PATH) .set('kbn-xsrf', 'true') - .set('elastic-api-version', '1') + .set('elastic-api-version', '2023-10-31') .send({ title: 'Sample dashboard', }); @@ -48,7 +48,7 @@ export default function ({ getService }: FtrProviderContext) { .post(DASHBOARD_API_PATH) .set(interactiveUser.headers) .set('kbn-xsrf', 'true') - .set('elastic-api-version', '1') + .set('elastic-api-version', '2023-10-31') .send({ title: 'Sample dashboard', }); diff --git a/x-pack/platform/test/api_integration/apis/content_management/updated_by.ts b/x-pack/platform/test/api_integration/apis/content_management/updated_by.ts index 0bf5eaf101f93..7a72c7d5717cb 100644 --- a/x-pack/platform/test/api_integration/apis/content_management/updated_by.ts +++ b/x-pack/platform/test/api_integration/apis/content_management/updated_by.ts @@ -19,7 +19,7 @@ export default function ({ getService }: FtrProviderContext) { const createResponse = await supertest .post(DASHBOARD_API_PATH) .set('kbn-xsrf', 'true') - .set('elastic-api-version', '1') + .set('elastic-api-version', '2023-10-31') .send({ title: 'Sample dashboard', }); @@ -31,7 +31,7 @@ export default function ({ getService }: FtrProviderContext) { const updateResponse = await supertest .put(`${DASHBOARD_API_PATH}/${createResponse.body.id}`) .set('kbn-xsrf', 'true') - .set('elastic-api-version', '1') + .set('elastic-api-version', '2023-10-31') .send({ title: 'updated title', }); @@ -58,7 +58,7 @@ export default function ({ getService }: FtrProviderContext) { .post(DASHBOARD_API_PATH) .set(interactiveUser.headers) .set('kbn-xsrf', 'true') - .set('elastic-api-version', '1') + .set('elastic-api-version', '2023-10-31') .send({ title: 'Sample dashboard', }); @@ -79,7 +79,7 @@ export default function ({ getService }: FtrProviderContext) { const updateResponse = await supertestWithAuth .put(`${DASHBOARD_API_PATH}/${createResponse.body.id}`) .set('kbn-xsrf', 'true') - .set('elastic-api-version', '1') + .set('elastic-api-version', '2023-10-31') .send({ title: 'updated title', }); @@ -89,7 +89,7 @@ export default function ({ getService }: FtrProviderContext) { const getResponse = await supertestWithAuth .get(`${DASHBOARD_API_PATH}/${createResponse.body.id}`) .set('kbn-xsrf', 'true') - .set('elastic-api-version', '1') + .set('elastic-api-version', '2023-10-31') .send(); expect(getResponse.status).to.be(200); @@ -114,7 +114,7 @@ export default function ({ getService }: FtrProviderContext) { .put(`${DASHBOARD_API_PATH}/${createResponse.body.id}`) .set(interactiveUser2.headers) .set('kbn-xsrf', 'true') - .set('elastic-api-version', '1') + .set('elastic-api-version', '2023-10-31') .send({ title: 'updated title', }); @@ -124,7 +124,7 @@ export default function ({ getService }: FtrProviderContext) { const getResponse = await supertestWithAuth .get(`${DASHBOARD_API_PATH}/${createResponse.body.id}`) .set('kbn-xsrf', 'true') - .set('elastic-api-version', '1') + .set('elastic-api-version', '2023-10-31') .send(); expect(getResponse.status).to.be(200); diff --git a/x-pack/platform/test/api_integration/apis/spaces/get_content_summary.ts b/x-pack/platform/test/api_integration/apis/spaces/get_content_summary.ts index 6350125be5c53..f9b053b190767 100644 --- a/x-pack/platform/test/api_integration/apis/spaces/get_content_summary.ts +++ b/x-pack/platform/test/api_integration/apis/spaces/get_content_summary.ts @@ -61,7 +61,7 @@ export default function ({ getService }: FtrProviderContext) { .post(`/s/${ATestSpace}${DASHBOARD_API_PATH}`) .set('kbn-xsrf', 'xxx') .set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana') - .set('elastic-api-version', '1') + .set('elastic-api-version', '2023-10-31') .send({ title: 'Sample dashboard', }); @@ -70,7 +70,7 @@ export default function ({ getService }: FtrProviderContext) { .post(`/s/${ATestSpace}${DASHBOARD_API_PATH}`) .set('kbn-xsrf', 'xxx') .set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana') - .set('elastic-api-version', '1') + .set('elastic-api-version', '2023-10-31') .send({ title: 'Sample dashboard', }); @@ -99,7 +99,7 @@ export default function ({ getService }: FtrProviderContext) { .post(`/s/${BTestSpace}${DASHBOARD_API_PATH}`) .set('kbn-xsrf', 'xxx') .set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana') - .set('elastic-api-version', '1') + .set('elastic-api-version', '2023-10-31') .send({ title: 'Sample dashboard', }); diff --git a/x-pack/solutions/observability/plugins/slo/test/scout/api/fixtures/constants.ts b/x-pack/solutions/observability/plugins/slo/test/scout/api/fixtures/constants.ts index 6de8635b3a7cc..94f33c97a053e 100644 --- a/x-pack/solutions/observability/plugins/slo/test/scout/api/fixtures/constants.ts +++ b/x-pack/solutions/observability/plugins/slo/test/scout/api/fixtures/constants.ts @@ -17,9 +17,9 @@ export const SLO_ERROR_BUDGET_ID = 'slo_error_budget'; export const SLO_BURN_RATE_EMBEDDABLE_ID = 'slo_burn_rate'; export const SLO_ALERTS_EMBEDDABLE_ID = 'slo_alerts'; -/** Common headers for Dashboard API requests (internal API version 1) */ +/** Common headers for Dashboard API requests */ export const COMMON_HEADERS = { 'kbn-xsrf': 'some-xsrf-token', 'x-elastic-internal-origin': 'kibana', - 'elastic-api-version': '1', + 'elastic-api-version': '2023-10-31', } as const; From 1e80b1d2ba07e77522b7e48becd4ab097270bc45 Mon Sep 17 00:00:00 2001 From: Nick Peihl Date: Thu, 2 Apr 2026 15:48:09 -0400 Subject: [PATCH 3/5] Remove `apiVersion` fallback for export json flyout link to dev tools --- .../dashboard/public/share/export_json_share_utils.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/platform/plugins/shared/dashboard/public/share/export_json_share_utils.ts b/src/platform/plugins/shared/dashboard/public/share/export_json_share_utils.ts index 395b37880ceb8..b7a70eb12d936 100644 --- a/src/platform/plugins/shared/dashboard/public/share/export_json_share_utils.ts +++ b/src/platform/plugins/shared/dashboard/public/share/export_json_share_utils.ts @@ -7,7 +7,7 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { DASHBOARD_API_PATH, DASHBOARD_API_VERSION } from '../../common/constants'; +import { DASHBOARD_API_PATH } from '../../common/constants'; const DEFAULT_FILENAME_BASE = 'export'; @@ -41,11 +41,5 @@ export function buildExportJsonFilename(filenameBase: string, fileExtension: str * The console will open with the HTTP verb + kbn: path, followed by a JSON body. */ export function buildCreateDashboardRequestForConsole(jsonBody: string): string { - // TODO remove these conditionals once the dashboard endpoints are public - // adds the `apiVersion` query parameter to the dashboard API path for internal requests - const dashboardApiPath = - DASHBOARD_API_VERSION === '1' - ? `${DASHBOARD_API_PATH}?apiVersion=${DASHBOARD_API_VERSION}` - : DASHBOARD_API_PATH; - return `POST kbn:${dashboardApiPath}\n${jsonBody}`; + return `POST kbn:${DASHBOARD_API_PATH}\n${jsonBody}`; } From 86369755fc1e7d6958193de1c10d34a6c0ded4c6 Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Tue, 7 Apr 2026 12:46:23 +0000 Subject: [PATCH 4/5] Changes from node scripts/eslint_all_files --no-cache --fix --- .../tests/workflow_execution/workflow_error_trigger.spec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/platform/plugins/shared/workflows_management/test/scout_workflows_ui/api/tests/workflow_execution/workflow_error_trigger.spec.ts b/src/platform/plugins/shared/workflows_management/test/scout_workflows_ui/api/tests/workflow_execution/workflow_error_trigger.spec.ts index c40550f106362..130ca33d2b359 100644 --- a/src/platform/plugins/shared/workflows_management/test/scout_workflows_ui/api/tests/workflow_execution/workflow_error_trigger.spec.ts +++ b/src/platform/plugins/shared/workflows_management/test/scout_workflows_ui/api/tests/workflow_execution/workflow_error_trigger.spec.ts @@ -166,7 +166,7 @@ spaceTest.describe.skip( const firstHandlerExecution = handlerExecutions[0]; expect(firstHandlerExecution).toBeDefined(); - const handlerExecutionId = (firstHandlerExecution as typeof handlerExecutions[number]).id; + const handlerExecutionId = (firstHandlerExecution as (typeof handlerExecutions)[number]).id; const handlerExecution = await waitForExecution(workflowsApi, handlerExecutionId); expect(handlerExecution?.triggeredBy).toBe('workflows.failed'); @@ -245,7 +245,7 @@ spaceTest.describe.skip( const firstHandlerExecution = handlerExecutions[0]; expect(firstHandlerExecution).toBeDefined(); - const handlerExecutionId = (firstHandlerExecution as typeof handlerExecutions[number]).id; + const handlerExecutionId = (firstHandlerExecution as (typeof handlerExecutions)[number]).id; const handlerExecution = await waitForExecution(workflowsApi, handlerExecutionId); expect(handlerExecution?.triggeredBy).toBe('workflows.failed'); expect(handlerExecution?.status).toBe(ExecutionStatus.COMPLETED); From 03c23163b55bbf2bc9d8bfdaae08a80a017b1604 Mon Sep 17 00:00:00 2001 From: Nick Partridge Date: Tue, 7 Apr 2026 08:53:45 -0700 Subject: [PATCH 5/5] enable public lens api access --- x-pack/platform/plugins/shared/lens/common/constants.ts | 4 ++-- .../shared/lens/server/api/routes/visualizations/create.ts | 1 - .../shared/lens/server/api/routes/visualizations/delete.ts | 3 +-- .../shared/lens/server/api/routes/visualizations/get.ts | 1 - .../shared/lens/server/api/routes/visualizations/search.ts | 1 - .../shared/lens/server/api/routes/visualizations/update.ts | 1 - 6 files changed, 3 insertions(+), 8 deletions(-) diff --git a/x-pack/platform/plugins/shared/lens/common/constants.ts b/x-pack/platform/plugins/shared/lens/common/constants.ts index f3b65098355cc..229f8324d27a4 100644 --- a/x-pack/platform/plugins/shared/lens/common/constants.ts +++ b/x-pack/platform/plugins/shared/lens/common/constants.ts @@ -24,8 +24,8 @@ export const LENS_EDIT_BY_VALUE = 'edit_by_value'; export const LENS_ICON = 'lensApp'; export const STAGE_ID = 'production'; -export const LENS_API_VERSION = '1'; // TODO repalce with '2023-10-31' before 9.4 FF -export const LENS_API_ACCESS: RouteAccess = 'internal'; // TODO replace with 'public' before 9.4 FF +export const LENS_API_VERSION = '2023-10-31'; +export const LENS_API_ACCESS: RouteAccess = 'public'; export const LENS_INTERNAL_API_VERSION = '1'; /** * In the OpenAPISpec this represents the endpoint group name diff --git a/x-pack/platform/plugins/shared/lens/server/api/routes/visualizations/create.ts b/x-pack/platform/plugins/shared/lens/server/api/routes/visualizations/create.ts index 7ba63af6689e7..a804c436ae05f 100644 --- a/x-pack/platform/plugins/shared/lens/server/api/routes/visualizations/create.ts +++ b/x-pack/platform/plugins/shared/lens/server/api/routes/visualizations/create.ts @@ -33,7 +33,6 @@ export const registerLensVisualizationsCreateAPIRoute: RegisterAPIRouteFn = ( const createRoute = router.post({ path: LENS_VIS_API_PATH, access: LENS_API_ACCESS, - enableQueryVersion: true, summary: 'Create visualization', description: 'Create a new visualization.', options: { diff --git a/x-pack/platform/plugins/shared/lens/server/api/routes/visualizations/delete.ts b/x-pack/platform/plugins/shared/lens/server/api/routes/visualizations/delete.ts index c3a0e9da76563..0d726ef424576 100644 --- a/x-pack/platform/plugins/shared/lens/server/api/routes/visualizations/delete.ts +++ b/x-pack/platform/plugins/shared/lens/server/api/routes/visualizations/delete.ts @@ -23,8 +23,7 @@ export const registerLensVisualizationsDeleteAPIRoute: RegisterAPIRouteFn = ( ) => { const deleteRoute = router.delete({ path: `${LENS_VIS_API_PATH}/{id}`, - access: LENS_API_ACCESS, // to go public in 9.4 - enableQueryVersion: true, + access: LENS_API_ACCESS, summary: 'Delete visualization', description: 'Delete a visualization by id.', options: { diff --git a/x-pack/platform/plugins/shared/lens/server/api/routes/visualizations/get.ts b/x-pack/platform/plugins/shared/lens/server/api/routes/visualizations/get.ts index d4ee1b0ce348d..af419606aef4c 100644 --- a/x-pack/platform/plugins/shared/lens/server/api/routes/visualizations/get.ts +++ b/x-pack/platform/plugins/shared/lens/server/api/routes/visualizations/get.ts @@ -28,7 +28,6 @@ export const registerLensVisualizationsGetAPIRoute: RegisterAPIRouteFn = ( const getRoute = router.get({ path: `${LENS_VIS_API_PATH}/{id}`, access: LENS_API_ACCESS, - enableQueryVersion: true, summary: 'Get visualization', description: 'Get a visualization from id.', options: { diff --git a/x-pack/platform/plugins/shared/lens/server/api/routes/visualizations/search.ts b/x-pack/platform/plugins/shared/lens/server/api/routes/visualizations/search.ts index 0a67a6cc7244f..d886e8b894943 100644 --- a/x-pack/platform/plugins/shared/lens/server/api/routes/visualizations/search.ts +++ b/x-pack/platform/plugins/shared/lens/server/api/routes/visualizations/search.ts @@ -27,7 +27,6 @@ export const registerLensVisualizationsSearchAPIRoute: RegisterAPIRouteFn = ( const searchRoute = router.get({ path: LENS_VIS_API_PATH, access: LENS_API_ACCESS, - enableQueryVersion: true, summary: 'Search visualizations', description: 'Get list of visualizations.', options: { diff --git a/x-pack/platform/plugins/shared/lens/server/api/routes/visualizations/update.ts b/x-pack/platform/plugins/shared/lens/server/api/routes/visualizations/update.ts index 70a4ac585514f..269a1028b3f61 100644 --- a/x-pack/platform/plugins/shared/lens/server/api/routes/visualizations/update.ts +++ b/x-pack/platform/plugins/shared/lens/server/api/routes/visualizations/update.ts @@ -37,7 +37,6 @@ export const registerLensVisualizationsUpdateAPIRoute: RegisterAPIRouteFn = ( const updateRoute = router.put({ path: `${LENS_VIS_API_PATH}/{id}`, access: LENS_API_ACCESS, - enableQueryVersion: true, summary: 'Create or update visualization', description: 'Create or update a visualization with the given id. When no visualization exists for the id, one is created.',