Get workspace file metadata¶
Read workspace file metadata by file ID.
GET 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 GET "$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 uses numeric code=0. Source conversation/task/call/tool fields are hidden according to visibility; missing fields do not imply no source.
Successful response¶
{
"code": 0,
"data": {
"file_id": "file-example",
"original_name": "sample.txt",
"size": 7,
"md5": "5177a58dc65c8a14dc90c69db3bf3dd2",
"ref_count": 1,
"created_at": 1794390000,
"created_by": "user-example",
"updated_at": 1794390001,
"source": "user_upload",
"content_type": "text/plain",
"storage_mode": "managed"
}
}
Success uses numeric code=0 with 17-field metadata in data; scalar zero values may be omitted.
Error response¶
{
"code": 2,
"message": "示例错误信息"
}
Missing business objects return 404/3, permission denial403/5, and unavailable authorization dependencies503/15. Handle numeric code/message separately from list string envelopes.