tencent cloud

APIs

CreateFile

下载
聚焦模式
字号
最后更新时间: 2026-10-11 15:48:33

1. API Description

Domain name for API request: databuddy.intl.tencentcloudapi.com.

Create a new file (Notebook/SQL/Python, etc.) in the workspace file tree of Studio (unified development IDE), and return the complete meta-information of the file upon success.

Prerequisite

  1. WorkspaceId corresponds to an existent workspace, and the caller is a space member of this workspace;
  2. The parent folder corresponding to ParentFolderPath must exist, and the caller must have write permission on it (pass / for the root directory);
  3. FileName must be unique under the same parent folder, including suffix comparison.
  4. The FileName suffix must be consistent with FileType (.ipynb↔NOTEBOOK_FILE, .sql↔SQL_FILE);
  5. To create with file content, pass it through Storage (large files are transferred via COS, and small files are placed in Storage.Content).

A maximum of 20 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

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: CreateFile.
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

FileName Yes String

File name with suffix, up to 255 bytes. It cannot begin or end with . or .., and cannot contain spaces or control characters.

ParentFolderPath No String

Parent folder path, starting with / and not ending with /. Pass / for the root directory. Source: Path returned by the ListFiles API

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

FileConfig No FileConfig

File operation configuration.

BundleId No String

Bound BundleId. Source: BundleId returned by the ListBundles API

BundleInfo No String

Bound BundleInfo, JSON string

Storage No FileStorage

Initial file content. If not passed, default content will be generated based on FileType.

ExtractArchive No Boolean Whether to asynchronously decompress and create ZIP files in Storage. false by default. When true, the async job is fully managed by Workspace throughout its lifecycle, and the response only returns job information through AsyncOperation (FileId is empty). Job progress querying is implemented by the basic platform WS interface and is not defined in this agreement.

3. Output Parameters

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.

4. Example

Example1 Creating a File Example

Input Example

POST / HTTP/1.1
Host: databuddy.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: CreateFile
<Common request parameters>

{
    "WorkspaceId": "17678671667189298",
    "FileName": "test_max_0820_1.ipynb",
    "ParentFolderPath": "/Workspace/Users/wedata30-test1@tencent.com@700002164619",
    "FileType": "NOTEBOOK_FILE"
}

Output Example

{
    "Response": {
        "Data": null,
        "RequestId": "56f39b22-e3c6-446b-b69f-dc06a4bfb792"
    }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

There is no error code related to the API business logic. For other error codes, please see Common Error Codes.

帮助和支持

本页内容是否解决了您的问题?

填写满意度调查问卷,共创更好文档体验。

文档反馈