Update file¶
This interface preserves the request shape for file updates, but the current implementation does not persist changes to name. Please do not interpret a successful response as indicating that the file name has been updated.
POST https://moi.matrixorigin.cn/newmoi/catalog/file/update
Preparation before calling¶
First query the file list to obtain the target file ID. Prepare the personal access token, target workspace ID, and file ID that have access to the target workspace.
The example below uses:
$AI_STUDIO_API_KEY: The actual personal access token, passed through theX-API-KeyHeader.$WORKSPACE_ID: Target workspace ID, passed throughX-Workspace-IDHeader.$FILE_ID: File ID used to locate files and perform permission verification.
Request example¶
curl -X POST "https://moi.matrixorigin.cn/newmoi/catalog/file/update" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d '{
"file_id": "'"$FILE_ID"'",
"name": "<FILE_NAME>"
}'
Request body¶
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
The file ID used to locate the file and perform permission verification. |
|
string |
No |
The name of the file to be updated; the current implementation does not save this value. |
Successful response¶
Returns 200 on success, data is null. The current implementation returns successfully but does not change the file name or other file attributes.
{
"code": "OK",
"msg": "OK",
"data": null
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
|
|
null |
Fixed to |
Error response¶
{
"code": "ErrParamInvalid",
"msg": "请求参数无效",
"data": null
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
The request body is not valid JSON. |
Check JSON format. |
|
|
The current identity does not have write permissions on the root volume to which it belongs. |
Use credentials with write access, or contact your administrator for authorization. |
|
|
The server failed to process the request. |
Record the request time and error message and try again; if it continues to fail, contact support. |
Follow-up operations¶
Use the same resource identifier Query file details to confirm the update result.