Delete an unreferenced workspace file¶
Delete a workspace file with reference count0.
DELETE https://api.moi.matrixorigin.cn/v5/workspaces/{id}/files/{file_id}
Before you call this API¶
BASE_URL uses the product API prefix https://api.moi.matrixorigin.cn/v5. For a dedicated deployment, use its corresponding product API address.
Prepare a personal access token for the target workspace. WORKSPACE_ID must match the path workspace, and FILE_ID must come from actual file results. BASE_URL includes the same environment’s product prefix. Example files/IDs are placeholders.
Request parameters¶
curl --fail-with-body -sS -X DELETE "$BASE_URL/workspaces/$WORKSPACE_ID/files/$FILE_ID" \
-H "X-API-Key: $MOI_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID"
No business request body. Use the actual target workspace and file ID in the path.
Success returns HTTP 204 without a body. Positive references, built-in samples, and concurrent cleanup state may reject deletion. Volume-file detachment and global file deletion are separate. External files remove MOI metadata only, not connector source objects.
Successful response¶
HTTP/1.1 204 No Content
HTTP 204, no JSON body.
Error response¶
{
"code": 2,
"message": "示例错误信息"
}
Unreleased references or inability to claim cleanup may return 409/4; invalid input400/2; missing files404/3. Handle built-in-file protection according to actual errors.