Skip to main content

dashboards

Creates, updates, deletes, gets or lists a dashboards resource.

Overview

Namedashboards
TypeResource
Idclickhouse.clickstack.dashboards

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringDashboard ID (example: 65f5e4a3b9e77c001a567890)
namestringDashboard name (example: Service Overview)
containersarrayOptional grouping containers. Each tile may join a container via tile.containerId, and a tab inside it via tile.tabId.
filtersarrayDashboard filter keys added to the dashboard and applied to all tiles
saved_filter_valuesarrayOptional default dashboard filter values restored when loading the dashboard. (wire: savedFilterValues)
saved_querystringOptional default dashboard query restored when loading the dashboard. (example: service.name = 'api') (wire: savedQuery)
saved_query_languagestringQuery language used by savedQuery. (sql, lucene) (example: sql) (wire: savedQueryLanguage)
tagsarrayTags for organizing and filtering dashboards
tilesarrayList of tiles/charts in the dashboard

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectservice_id, click_stack_dashboard_id, organization_idThis endpoint is in beta. API contract is stable, and no breaking changes are expected in the future. <br /><br /> ClickStack: Retrieves a specific dashboard by ID
listselectservice_id, organization_idThis endpoint is in beta. API contract is stable, and no breaking changes are expected in the future. <br /><br /> ClickStack: Retrieves a list of all dashboards for the authenticated team
createinsertservice_id, organization_id, name, tilesThis endpoint is in beta. API contract is stable, and no breaking changes are expected in the future. <br /><br /> ClickStack: Creates a new dashboard
updateupdateservice_id, click_stack_dashboard_id, organization_id, name, tilesThis endpoint is in beta. API contract is stable, and no breaking changes are expected in the future. <br /><br /> ClickStack: Updates an existing dashboard. Concurrency: This endpoint does not support optimistic concurrency control. Concurrent PUT requests for the same dashboard may silently overwrite each other, which can leave orphan tile-to-container references on layout-shape edits. Clients should serialize edits to a given dashboard.
deletedeleteservice_id, click_stack_dashboard_id, organization_idThis endpoint is in beta. API contract is stable, and no breaking changes are expected in the future. <br /><br /> ClickStack: Deletes a dashboard
validateexecserviceId, organization_id, name, tilesThis endpoint is in beta. API contract is stable, and no breaking changes are expected in the future. <br /><br /> ClickStack: Validates a dashboard body against the same schema and tile rules used by POST /api/v2/dashboards. The dashboard is never persisted. Use this endpoint at plan time (e.g. from a Terraform provider) to check that a dashboard configuration is valid before applying it.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
click_stack_dashboard_idstringClickStack Dashboard ID (wire: clickStackDashboardId)
organization_idstringClickHouse Cloud organization ID. Resolved from the CLICKHOUSE_ORG_ID environment variable when it is set (x-stackQL-envVar); otherwise it must be supplied on every query as WHERE organization_id = <uuid>. A WHERE value always takes precedence over the environment. (x-stackQL-envVar: CLICKHOUSE_ORG_ID)
serviceIdstring (uuid)ID of the ClickStack service.
service_idstring (uuid)ID of the ClickStack service. (wire: serviceId)

SELECT examples

This endpoint is in beta. API contract is stable, and no breaking changes are expected in the future. <br /><br /> ClickStack: Retrieves a specific dashboard by ID

SELECT
id,
name,
containers,
filters,
saved_filter_values,
saved_query,
saved_query_language,
tags,
tiles
FROM clickhouse.clickstack.dashboards
WHERE service_id = '{{ service_id }}' -- required
AND click_stack_dashboard_id = '{{ click_stack_dashboard_id }}' -- required
AND organization_id = '{{ organization_id }}' -- required unless CLICKHOUSE_ORG_ID is set
;

INSERT examples

This endpoint is in beta. API contract is stable, and no breaking changes are expected in the future. <br /><br /> ClickStack: Creates a new dashboard

INSERT INTO clickhouse.clickstack.dashboards (
name,
tiles,
tags,
filters,
saved_query,
saved_query_language,
saved_filter_values,
containers,
service_id,
organization_id
)
SELECT
'{{ name }}' /* required */,
'{{ tiles }}' /* required */,
'{{ tags }}',
'{{ filters }}',
'{{ saved_query }}',
'{{ saved_query_language }}',
'{{ saved_filter_values }}',
'{{ containers }}',
'{{ service_id }}',
'{{ organization_id }}'
RETURNING
request_id,
result,
status
;

UPDATE examples

This endpoint is in beta. API contract is stable, and no breaking changes are expected in the future. <br /><br /> ClickStack: Updates an existing dashboard. Concurrency: This endpoint does not support optimistic concurrency control. Concurrent PUT requests for the same dashboard may silently overwrite each other, which can leave orphan tile-to-container references on layout-shape edits. Clients should serialize edits to a given dashboard.

UPDATE clickhouse.clickstack.dashboards
SET
name = '{{ name }}',
tiles = '{{ tiles }}',
tags = '{{ tags }}',
filters = '{{ filters }}',
saved_query = '{{ saved_query }}',
saved_query_language = '{{ saved_query_language }}',
saved_filter_values = '{{ saved_filter_values }}',
containers = '{{ containers }}'
WHERE
service_id = '{{ service_id }}' --required
AND click_stack_dashboard_id = '{{ click_stack_dashboard_id }}' --required
AND organization_id = '{{ organization_id }}' --required unless CLICKHOUSE_ORG_ID is set
AND name = '{{ name }}' --required
AND tiles = '{{ tiles }}' --required
RETURNING
request_id,
result,
status;

DELETE examples

This endpoint is in beta. API contract is stable, and no breaking changes are expected in the future. <br /><br /> ClickStack: Deletes a dashboard

DELETE FROM clickhouse.clickstack.dashboards
WHERE service_id = '{{ service_id }}' --required
AND click_stack_dashboard_id = '{{ click_stack_dashboard_id }}' --required
AND organization_id = '{{ organization_id }}' --required unless CLICKHOUSE_ORG_ID is set
;

Lifecycle Methods

EXEC variables use wire (API) names.

This endpoint is in beta. API contract is stable, and no breaking changes are expected in the future. <br /><br /> ClickStack: Validates a dashboard body against the same schema and tile rules used by POST /api/v2/dashboards. The dashboard is never persisted. Use this endpoint at plan time (e.g. from a Terraform provider) to check that a dashboard configuration is valid before applying it.

EXEC clickhouse.clickstack.dashboards.validate
@serviceId='{{ serviceId }}' --required,
@organization_id='{{ organization_id }}' --required unless CLICKHOUSE_ORG_ID is set
@@json=
'{
"name": "{{ name }}",
"tiles": "{{ tiles }}",
"tags": "{{ tags }}",
"filters": "{{ filters }}",
"savedQuery": "{{ savedQuery }}",
"savedQueryLanguage": "{{ savedQueryLanguage }}",
"savedFilterValues": "{{ savedFilterValues }}",
"containers": "{{ containers }}"
}'
;