Delete SQL workbook¶
Delete a SQL save record and all its versions. It cannot be restored after deletion.
POST https://moi.matrixorigin.cn/newmoi/workbook/delete
Preparation before calling¶
Prepare your personal access token, workspace ID, and save record ID with delete permissions. $AI_STUDIO_API_KEY is the personal access token used as the value of the X-API-Key request header; $WORKSPACE_ID is the target workspace ID used as the value of the X-Workspace-ID request header. It cannot be restored after deletion.
$WORKBOOK_ID in the example below is the SQL saved record ID to be deleted, which can be obtained from the View Saved SQL response.
Request body¶
Replace caller-specific values in the example with actual values.
workbook_idstringRequired- The ID of the SQL saved record.
Request example
curl -X POST "https://moi.matrixorigin.cn/newmoi/workbook/delete" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d "{
\"workbook_id\": \"$WORKBOOK_ID\"
}"
Successful response¶
data is empty on success. You can then View saved SQL to confirm that the record will no longer appear.
{
"code": 200,
"data": null
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
null |
Fixed to |
Error response¶
codeinteger or string- Error code or status.
messagestring- Error message.
Error response example
{
"code": 404,
"message": "SQL 工作簿不存在"
}
Follow-up operations¶
View saved SQL, confirm target no longer appears.