Delete a workspace¶
Delete a specified workspace. Before deleting it, confirm that it is no longer needed and complete any required data-sharing cleanup. After a successful response, list workspaces to confirm that it no longer appears.
DELETE https://moi.matrixorigin.cn/newmoi/workspaces/{id}
Before you call this API¶
Identify the workspace to delete. Prepare a personal access token and the workspace ID.
The following example uses:
$AI_STUDIO_API_KEY: Your personal access token, passed in theX-API-Keyheader.$WORKSPACE_ID: The workspace ID to delete, passed in the URL path.
If the workspace has associated data-sharing cleanup requirements, complete them before deletion.
Request example¶
curl -X DELETE "https://moi.matrixorigin.cn/newmoi/workspaces/$WORKSPACE_ID" \
-H "X-API-Key: $AI_STUDIO_API_KEY"
Path parameters¶
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
ID of the workspace to delete. |
Successful response¶
On success, the API returns 200, indicating that the service accepted the deletion. This response does not replace a subsequent list check.
{
"code": "OK",
"msg": "OK"
}
Response fields:
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
|
Error response¶
{
"code": "ErrWorkspaceNotFound",
"msg": "Workspace not found",
"data": null
}
Common HTTP errors¶
HTTP status |
Error code |
Common cause |
Recommended action |
|---|---|---|---|
|
|
The workspace ID is invalid. |
Check the workspace ID in the path and retry. |
|
|
Credentials are missing or invalid. |
Check the personal access token. |
|
|
The current identity has not been synchronized or cannot delete workspaces. |
Complete account synchronization, or ask an administrator for access before retrying. |
|
|
The workspace does not exist, or the current identity cannot access it. |
Check the workspace ID and the current identity’s permissions. |
|
|
The workspace’s data-sharing cleanup is incomplete. |
Complete the data-sharing cleanup, then retry deletion. |
|
|
The data-sharing precheck or a dependent service is temporarily unavailable. |
Retry later. |
|
|
The service could not delete the workspace. |
Record the request time and error message, then retry. |
Next steps¶
Use the workspace name to list workspaces. Confirm the deletion only after the workspace no longer appears in the list.