Skip to main content
Skip to main content

API reference

ClickStack exposes a REST API for programmatically managing dashboards, alerts, and data sources. The API is available for both Managed ClickStack (ClickHouse Cloud) and ClickStack Open Source deployments, though the endpoints and authentication differ between the two.

API reference documentation​

For Managed ClickStack, the API is accessed through the ClickHouse Cloud API. The ClickStack endpoints are available in the Cloud API specification.

The following endpoints are available:

ResourceOperations
DashboardsCreate, list, get, update, and delete dashboards
AlertsCreate, list, get, update, and delete alerts
SourcesList data sources

Authentication​

Managed ClickStack uses the ClickHouse Cloud API key for authentication via HTTP Basic Authentication. To create and manage API keys, see Managing API keys.

Include the key ID and secret using HTTP Basic Authentication:

export KEY_ID=<your_key_id>
export KEY_SECRET=<your_key_secret>

curl --user $KEY_ID:$KEY_SECRET \
  https://api.clickhouse.cloud/v1/organizations/<ORG_ID>/services/<SERVICE_ID>/clickstack/dashboards

Base URL and request format​

All Managed ClickStack API requests are sent to the ClickHouse Cloud API:

https://api.clickhouse.cloud/v1/organizations/<ORG_ID>/services/<SERVICE_ID>/clickstack/<resource>

You can find your Organization ID in the ClickHouse Cloud console under Organization → Organization details. Your Service ID is visible in the service URL or on the service details page.

Example: List dashboards​

curl --user $KEY_ID:$KEY_SECRET \
  https://api.clickhouse.cloud/v1/organizations/<ORG_ID>/services/<SERVICE_ID>/clickstack/dashboards

Example: Create an alert​

curl -X POST --user $KEY_ID:$KEY_SECRET \
  -H "Content-Type: application/json" \
  -d '{
    "dashboardId": "<DASHBOARD_ID>",
    "tileId": "<TILE_ID>",
    "threshold": 100,
    "interval": "1h",
    "source": "tile",
    "thresholdType": "above",
    "channel": {
      "type": "webhook",
      "webhookId": "<WEBHOOK_ID>"
    },
    "name": "Error Spike Alert",
    "message": "Error rate exceeded 100 in the last hour"
  }' \
  https://api.clickhouse.cloud/v1/organizations/<ORG_ID>/services/<SERVICE_ID>/clickstack/alerts