Update data dashboard

Update the name, description, and data source of the specified data dashboard.

PATCH https://api.moi.matrixorigin.cn/v5/data-dashboards/{dashboard_id}

Preparation before calling

Prepare a personal access token and target workspace ID that has access to the target workspace.

The example below uses:

  • $AI_STUDIO_API_KEY: The actual personal access token, passed through the X-API-Key Header.

  • $WORKSPACE_ID: Target workspace ID, passed through X-Workspace-ID Header.

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

Request body

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

namestringRequired
Data dashboard name.
descriptionstring
Data dashboard description; omission saves an empty string.
sourcesarrayRequired
List of data sources.
sources[].table_idintegerRequired
Data source table ID.

Request example

curl -X PATCH "https://api.moi.matrixorigin.cn/v5/data-dashboards/$DASHBOARD_ID" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "销售概览",
    "description": "更新后的说明",
    "sources": [{"table_id": 1001}]
  }'

Successful response

When the update is successful, the data.updated in the response is true.

{
  "code": "OK",
  "msg": "OK",
  "data": {"updated": true}
}

The response fields are as follows.

Field

Type

Description

data.updated

boolean

Whether it has been updated.

Error response

This example corresponds to HTTP 400.

codestring
Error code, such as ErrParamInvalid or ErrDataDashboardNotFound.
msgstring
HTTP status text, such as Bad Request or Not Found.
{
  "code": "ErrParamInvalid",
  "msg": "Bad Request"
}

Data sources still referenced by charts

Removing a referenced source returns HTTP 409 with a separate error structure.

Field

Type

Description

code

integer

4 for this conflict.

message

string

Localized error message.

details.reason

string

DATA_DASHBOARD_SOURCE_IN_USE.

details.domain

string

moi-core.catalog.data_dashboard.

details.request_id

string

Request ID, returned when nonempty.

details.tables

array of object

Referenced tables.

details.tables[].table_id

integer

Table ID.

details.tables[].database_name

string

Database name.

details.tables[].table_name

string

Table name.

details.tables[].charts

array of object

Charts referencing the table.

details.tables[].charts[].id

string

Chart ID.

details.tables[].charts[].name

string

Chart name.

Last updated on