Create dashboard chart

Create a chart in the specified data dashboard.

HTTP
POST $CLOUDSIGMA_API_BASE/data-dashboards/{dashboard_id}/charts

Before you call this API

Configure the regional API endpoint and authentication, and select the target workspace.

Set the operation-specific values used in the request:

  • $DASHBOARD_ID: dashboard_id to use, specifying the target resource via the request path.

Request

Replace caller-specific values in the example with actual values.

Shell
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 1",
    "chart_config": "{}",
    "layout_config": "{}",
    "refresh_interval": "manual",
    "alert_enabled": false,
    "alert_config": "{}"
  }'

Request body

ParameterTypeRequiredDescription
namestringRequiredChart name.
chart_typestringRequiredChart type.
sql_textstringRequiredChart SQL.
chart_configstringRequiredChart configuration.
layout_configstringRequiredLayout configuration.
refresh_intervalstringRequiredRefresh cycle.
alert_enabledbooleanRequiredWhether to enable alarms.
alert_configstringRequiredAlarm configuration.

Successful response

When the creation is successful, the HTTP status code is 201, and the code in the response body is 0.

JSON
{
  "code": 0,
  "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": "",
    "ScheduleOperationID": "operation-001",
    "AlertEnabled": false,
    "AlertConfig": "{}",
    "SnapshotEpochAt": "2026-08-21T07:00:00Z",
    "CreatedAt": "2026-08-21T07:00:00Z",
    "UpdatedAt": "2026-08-21T07:00:00Z"
  }
}

The response fields are as follows.

Field

Type

Description

data.ID

string

Chart ID.

data.DashboardID

string

The ID of the data dashboard.

data.Name

string

Chart name.

data.ChartType

string

Chart type.

data.SQLText

string

Chart SQL.

data.DatabaseName

string

Database name used for chart query.

data.ChartConfig

string

Chart configuration.

data.LayoutConfig

string

Layout configuration.

data.RefreshInterval

string

Refresh cycle.

data.SchedulerTaskID

string

Scheduling task ID; empty when no scheduling task is created.

data.ScheduleVersion

integer

Scheduling configuration version.

data.ScheduleStatus

string

Scheduling status.

data.ScheduleError

string

Scheduling error; empty if there is no error.

data.ScheduleOperationID

string

ID of this scheduling operation.

data.AlertEnabled

boolean

Whether to enable alarms.

data.AlertConfig

string

Alarm configuration.

data.SnapshotEpochAt

string

Result snapshot starting time.

data.CreatedAt

string

Creation time.

data.UpdatedAt

string

Update time.

Error response

JSON
{
  "code": 2,
  "message": "invalid argument",
  "details": {
    "domain": "moi-core.catalog.data_dashboard",
    "reason": "DATA_DASHBOARD_INVALID_REQUEST"
  }
}
FieldTypeDescription
codeinteger or stringError code or status.
messagestringError message.
Last updated on