Update dashboard chart

Updates the SQL query, display, and refresh configuration of the specified chart.

HTTP
PATCH $CLOUDSIGMA_API_BASE/data-dashboards/{dashboard_id}/charts/{chart_id}

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. Prepare personal access token and target workspace ID that can access the target workspace. Get the kanban ID from Query data kanban list. Get the chart ID from Query data dashboard details.

Request body

Shell
curl -X PATCH "$CLOUDSIGMA_API_BASE/data-dashboards/$DASHBOARD_ID/charts/$CHART_ID" \
  -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

dashboard_id

string

Yes

Data dashboard ID.

chart_id

string

Yes

Chart ID.

Request body

Field

Type

Required

Description

name

string

Yes

Chart name. Cannot be empty.

chart_type

string

Yes

Chart type. Cannot be empty.

sql_text

string

Yes

Chart SQL. Cannot be empty.

chart_config

string

No

Chart configuration.

layout_config

string

No

Layout configuration.

refresh_interval

string

No

refresh cycle.

alert_enabled

boolean

No

Whether to enable alarms.

alert_config

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

JSON
{
  "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": 2,
    "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

data.ID

string

Chart ID.

data.DashboardID

string

The ID of the data dashboard it belongs to.

data.Name

string

Chart name.

data.ChartType

string

Chart type.

data.SQLText

string

Chart SQL.

data.DatabaseName

string

Database name to use for chart queries.

data.ChartConfig

string

Chart configuration.

data.LayoutConfig

string

Layout configuration.

data.RefreshInterval

string

refresh cycle.

data.SchedulerTaskID

string

Scheduled task ID. It is empty when no scheduled task is created.

data.ScheduleVersion

integer

Scheduling configuration version.

data.ScheduleStatus

string

Scheduling status.

data.ScheduleError

string

Scheduling error. Empty if there are no errors.

data.AlertEnabled

boolean

Whether to enable alarms.

data.AlertConfig

string

Alarm configuration.

data.SnapshotEpochAt

string

Result snapshot start time. RFC 3339 time.

data.CreatedAt

string

Creation time. RFC 3339 time.

data.UpdatedAt

string

Update time. RFC 3339 time.

Error response

The following example corresponds to HTTP 400.

JSON
{
  "code": "ErrParamInvalid",
  "msg": "Bad Request"
}

Field

Type

Description

code

string

Error code, such as ErrParamInvalid or ErrDataDashboardNotFound.

msg

string

HTTP status description, such as Bad Request or Not Found.

Last updated on