Create dashboard chart¶
Create a chart in the specified data dashboard.
POST $CLOUDSIGMA_API_BASE/data-dashboards/{dashboard_id}/charts
Before you call¶
Configure the CloudSigma regional endpoint and authentication before calling. The endpoint, credentials, workspace, and resource IDs must belong to the same region. First select the data dashboard to which you want to add a chart in Query Data Kanban List.
Prepare personal access token and target workspace ID that can access the target workspace.
Request body¶
curl -X POST "$CLOUDSIGMA_API_BASE/data-dashboards/$DASHBOARD_ID/charts" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H "Content-Type: application/json" \
-d '{
"name": "每日订单数",
"chart_type": "line",
"sql_text": "SELECT * FROM analytics.daily_sales LIMIT 10",
"chart_config": "{}",
"layout_config": "{}",
"refresh_interval": "manual",
"alert_enabled": false
}'
Replace the credentials and IDs in the example with actual values. The example uses analytics.daily_sales. Please first add the actually queryable table to the current Kanban source, or change the SQL to the currently saved source table.
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
Data dashboard ID. |
Request body
Field |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
Chart name. Cannot be empty. |
|
string |
Yes |
Chart type. Cannot be empty. |
|
string |
Yes |
Chart SQL. Cannot be empty. |
|
string |
No |
Chart configuration. |
|
string |
No |
Layout configuration. |
|
string |
No |
refresh cycle. |
|
boolean |
No |
Whether to enable alarms. |
|
string |
No |
Alarm configuration. |
sql_text must refer to the actual saved table of the current Kanban board. The current identity must have table query and database SQL permissions. When multiple databases are involved, use database qualified names as required. SELECT 1 The source table is not referenced and cannot be used for this interface.
name, chart_type and sql_text are required, other fields use default values. When closing the alarm and not configuring the alarm, omit alert_config or fill in the blank string. Filling in "{}" will still verify the alarm configuration.
When enabling an alarm, fill in the alarm conditions according to the parameter table. field, operator, level, and notification_interval must match the chart axis configuration.
Successful response¶
{
"code": "OK",
"msg": "OK",
"data": {
"ID": "0198ce79-2320-76aa-9d34-7f8e9d0c1b2a",
"DashboardID": "0198ce73-3d20-7c12-9a11-1a2b3c4d5e6f",
"Name": "每日订单数",
"ChartType": "line",
"SQLText": "SELECT 1",
"DatabaseName": "analytics",
"ChartConfig": "{}",
"LayoutConfig": "{}",
"RefreshInterval": "manual",
"SchedulerTaskID": "",
"ScheduleVersion": 1,
"ScheduleStatus": "ready",
"ScheduleError": "",
"AlertEnabled": false,
"AlertConfig": "{}",
"SnapshotEpochAt": "2026-08-21T07:00:00Z",
"CreatedAt": "2026-08-21T07:00:00Z",
"UpdatedAt": "2026-08-21T07:00:00Z"
}
}
Field |
Type |
Description |
|---|---|---|
|
string |
Chart ID. |
|
string |
The ID of the data dashboard it belongs to. |
|
string |
Chart name. |
|
string |
Chart type. |
|
string |
Chart SQL. |
|
string |
Database name to use for chart queries. |
|
string |
Chart configuration. |
|
string |
Layout configuration. |
|
string |
refresh cycle. |
|
string |
Scheduled task ID. It is empty when no scheduled task is created. |
|
integer |
Scheduling configuration version. |
|
string |
Scheduling status. |
|
string |
Scheduling error. Empty if there are no errors. |
|
boolean |
Whether to enable alarms. |
|
string |
Alarm configuration. |
|
string |
Result snapshot start time. RFC 3339 time. |
|
string |
Creation time. RFC 3339 time. |
|
string |
Update time. RFC 3339 time. |
Error response¶
The following example corresponds to HTTP 400.
{
"code": "ErrParamInvalid",
"msg": "Bad Request"
}
Field |
Type |
Description |
|---|---|---|
|
string |
Error code, such as |
|
string |
HTTP status description, such as |