View SQL workbook version content

View the SQL content in a workbook version without executing it.

POST https://moi.matrixorigin.cn/newmoi/workbook/detail

Preparation before calling

Prepare the personal access token, workspace ID, workbook ID, and version ID. You can first View SQL workbook version list to obtain version_id.

In the example below, $WORKBOOK_ID is the ID of the SQL saved record, and $VERSION_ID is the version ID to view.

Request body

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

workbook_idstringRequired
The ID of the SQL saved record.
version_idstringRequired
The version ID in the SQL save record.

Request example

curl -X POST "https://moi.matrixorigin.cn/newmoi/workbook/detail" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  -H 'Content-Type: application/json' \
  -d "{
    \"workbook_id\": \"$WORKBOOK_ID\",
    \"version_id\": \"$VERSION_ID\"
  }"

Successful response

data.sql_content is the SQL text saved by this version; created_at and updated_at are the creation and update times of this version respectively.

{
  "code": 200,
  "data": {
    "sql_content": "SELECT 1",
    "created_at": "2026-01-01T00:00:00Z",
    "updated_at": "2026-01-01T00:00:00Z"
  }
}

The response fields are as follows.

Field

Type

Description

data.sql_content

string

SQL content in version.

data.created_at

string

Creation time.

data.updated_at

string

Update time.

Error response

codeinteger or string
Error code or status.
messagestring
Error message.

Error response example

{
  "code": 404,
  "message": "SQL 工作簿或版本不存在"
}

Follow-up operations

When a name change is required, Update SQL workbook name. View SQL workbook list when returning to the list.

Last updated on