Domain name for API request: databuddy.intl.tencentcloudapi.com.
Update file contents and running configuration (computational resource, default catalog/schema, parameters), and return the file metadata after the update.
Prerequisite
Error codes (Module: Studio)
| Error Code (Code) | InnerCode | Description | Handling Suggestions |
|---|---|---|---|
MissingParameter.WorkspaceId |
1030001 | lack of WorkspaceId | Please input WorkspaceId |
MissingParameter.FileId |
1030003 | lack of FileId | Please import FileId |
InvalidParameterValue.FileType |
1030102 | FileType value not supported | FileType takes FILE/NOTEBOOK_FILE/SQL_FILE |
InvalidParameterValue.ResourceId |
1030104 | Compute resource type and file type mismatch | Select a computational resource for Python/Notebook and a data analysis resource for SQL |
ResourceNotFound.FileNotFound |
1030203 | File does not exist or has been deleted | confirm the FileId or call GetFile to check the file status |
UnauthorizedOperation.FileWriteDenied |
1030302 | No write permission for this file | Contact the file owner or space admin for authorization |
FailedOperation.FileStorageUpdateFailed |
1030401 | Failed to write file content to storage | Try again later. If the failure persists, contact support with the RequestId. |
InternalError |
1030900 | Internal service error | Please carry the RequestId and contact support |
A maximum of 20 requests can be initiated per second for this API.
The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.
| Parameter Name | Required | Type | Description |
|---|---|---|---|
| Action | Yes | String | Common Params. The value used for this API: UpdateFile. |
| Version | Yes | String | Common Params. The value used for this API: 2026-07-15. |
| Region | Yes | String | Common Params. For more information, please see the list of regions supported by the product. |
| WorkspaceId | Yes | String | Workspace ID. Source: WorkspaceId returned by the ListWorkspaces API |
| FileId | Yes | String | File ID. Source: FileId returned by the CreateFile / ListFiles / GetFile APIs |
| FileConfig | No | FileConfig | File operation configuration. If not passed, the configuration will not be updated. |
| FileType | No | String | File type. Parameter Value: FILE (regular file/script), NOTEBOOK_FILE (Notebook), SQL_FILE (SQL file). Corresponds to common/domain/entity.proto EntityType |
| BundleId | No | String | Bound BundleId. Source: BundleId returned by the ListBundles API |
| BundleInfo | No | String | Bound BundleInfo, JSON string |
| Storage | No | FileStorage | File content. If not passed, the content will not be updated. |
| FileName | No | String | Target file name. When it is not empty and different from the current file name, perform the rename action. Length not exceeding SCRIPT_NAME_MAX_LENGTH. It must not begin or end with . or .., and spaces, double dots, control characters, and Linux reserved names are forbidden (see docs/linux_filename_rules.md). Validate the suffix legitimacy together with ExtensionType. |
| ParentFolderPath | No | String | Target parent directory path. If not empty, execute the move action. For the root directory, pass /; it can simultaneously appear with FileName, with the semantics of "move + rename". It should be consistent with ParentFolderPath of CreateFile. |
| TargetFileType | No | String | FileType of the target parent directory. Value: FOLDER, GIT_FOLDER. Used only when ParentFolderPath is not empty; by default, it is handled based on the actual type of the parsed parent directory |
| UpdateAction | No | Integer | Action type (optional, default value: 1, mandatory verification in future versions). Value: 1 = UPDATE_CONTENT (only refresh FileConfig / Storage / Bundle, forbid passing FileName / ParentFolderPath / TargetFileType); 2 = RENAME (rename only, must pass FileName, forbid passing ParentFolderPath / FileConfig / Storage / Bundle); 3 = MOVE (move only, must pass ParentFolderPath, forbid passing FileName / FileConfig / Storage / Bundle*). A ParamIllegal error will be returned if parameter mutual exclusion verification fails |
| Parameter Name | Type | Description |
|---|---|---|
| Data | FileInfo | Returned results |
| RequestId | String | The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem. |
POST / HTTP/1.1
Host: databuddy.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: UpdateFile
<Common request parameters>
{
"WorkspaceId": "17676920188276733",
"FileId": "872597305364471808",
"FileType": "NOTEBOOK_FILE",
"BundleId": "create_test",
"BundleInfo": "{'key1': 'value1'}",
"Storage": {
"StorageType": 1,
"Content": "ewogICJjZWxscyI6IFsKICAgIHsKICAgICAgImNlbGxfdHlwZSI6ICJjb2RlIiwKICAgICAgImV4ZWN1dGlvbl9jb3VudCI6IG51bGwsCiAgICAgICJtZXRhZGF0YSI6IHt9LAogICAgICAib3V0cHV0cyI6IFtdLAogICAgICAic291cmNlIjogWwogICAgICAgICJwcmludCgxKSIKICAgICAgXSwKICAgICAgImlkIjogImNlbGwtMC0xNzg1ODUxNDg2MTM4IgogICAgfQogIF0sCiAgIm1ldGFkYXRhIjoge30sCiAgIm5iZm9ybWF0IjogNCwKICAibmJmb3JtYXRfbWlub3IiOiA1Cn0="
}
}
{
"Response": {
"Data": {
"AppId": "251436191",
"BundleId": "create_test",
"BundleInfo": "{'key1': 'value1'}",
"CreateTime": "1785851410",
"CreateUserUin": "700002164618",
"FileConfig": {
"AdvanceConfig": "",
"DefaultCatalog": "",
"DefaultSchema": "",
"ExtraParams": "",
"OutputConf": [],
"Params": "eyJtbGZsb3dfcHJlX2V4ZWN1dGVfY29zX3BhdGgiOiJodHRwczovL2J1Y2tldC0zMC0yNTE0MzYxOTEuY29zLmFwLWd1YW5nemhvdS5teXFjbG91ZC5jb20vc2NpLzE3Njc2OTIwMTg4Mjc2NzMzL3BlcnNvbmFsLzcwMDAwMjE2NDYxOC84NzI1OTczMDUzNjQ0NzE4MDgvbm90ZWJvb2tfcHJlbG9hZF9zY3JpcHQucHkifQ==",
"ResourceId": ""
},
"FileId": "872597305364471808",
"FileName": "create_by_api3.ipynb",
"FileType": "NOTEBOOK_FILE",
"OwnerUserName": "wedata30-dev@tencent.com",
"Path": "/Workspace/Users/create_by_api3.ipynb",
"Permissions": "[MANAGE]",
"ReleaseStatus": false,
"ResourceMode": 0,
"Status": "active",
"Storage": {
"Content": "",
"StoragePath": "",
"StorageType": 0
},
"UpdateTime": "1785851538",
"UpdateUserUin": "700002164618",
"WorkspaceId": "17676920188276733"
},
"RequestId": "e5e3c887-81f6-45d4-982e-6d43364fe366"
}
}
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.
There is no error code related to the API business logic. For other error codes, please see Common Error Codes.
文档反馈