# Create a file

Create a Sheet or Bitable in a defined folders in the user's Space.

**Notice**：- This interface is an older version and is no longer recommended for use. We have split and upgraded this API to a more detailed level, which is recommended:

- If you need to create a Sheets, you can also call the [Create spreadsheet](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet/create) API.
  -  If you need to create a Bitable, you can also call the [Create Base App](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app/create) API.

## Limits
- The maximum number of nodes in a single level of folders in Space is 1500, beyond this limit the API will return a failure. If there is a need to create a large number of nodes, consider creating documents under separate folders;
- This API doesn't allow you to concurrently create multiple documents, and supports up to 5 queries per second (QPS) and 10,000 queries per day.
- This API does not support creating [Documents](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-overview). You can call the [Create a document]( https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/document-docx/docx-v1/document/create) API if you need to create a document.
## Request

Facts | &nbsp;
---|---
HTTP URL | https://open.feishu.cn/open-apis/drive/explorer/v2/file/:folderToken
HTTP Method | POST
Supported app types | Custom App、Store App
Required scopes<br>**The scopes required to call this API. You can call the API with any of the scopes.**<br>Enable any scope from the list | View, comment, edit, and manage all files in My Space(drive:drive)<br>View, comment, edit, and manage Docs(docs:doc)<br>View, comment, edit, and manage Sheets(sheets:spreadsheet)

### Request header

Parameter | Type | Required | Description
---|---|---|---
Authorization | string | Yes | Authenticate the caller's identity through the access token. Optional values:<br>- `tenant_access_token`: Tenant authorization credential. The application acts on behalf of the tenant (i.e., a company or team) to perform corresponding operations. Example value: "Bearer t-7f1bcd13fc57d46bac21793aabcef"<br>- `user_access_token`: User authorization credential. The application acts on behalf of the user to perform corresponding operations. Example value: "Bearer u-7f1bcd13fc57d46bac21793aabcef"<br>For more information, refer to [Obtaining Access Tokens](https://open.feishu.cn/document/ukTMukTMukTM/uMTNz4yM1MjLzUzM).
Content-Type | string | Yes | **Fixed value**: "application/json; charset=utf-8"

For more information on the permissions, see [FAQs](https://open.feishu.cn/document/ukTMukTMukTM/uczNzUjL3czM14yN3MTN).
<br>

### Path parameters

Parameter | Type | Description
---|---|---
folderToken | string | Token of the folder. For more information about how to obtain the token, see [Folder overview](https://open.feishu.cn/document/ukTMukTMukTM/ugTNzUjL4UzM14CO1MTN/folder-overview).

### Request body

Parameter | Type | Required | Description
---|---|---|---
title | string | Yes | Title of the document to create.
type | string | Yes | Type of the file to create. Optional values are:<br>- sheet：Sheet. You can also use [Create Spreadsheet](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet/create)<br>- bitable：The base app. You can also use [Create App](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app/create)

### Request body example
```json
{
   "title":"test sheet",
   "type":"sheet"
}
```

## Response
### Response body

|Parameter|Type|Description|
|--|--|--|
|url|string|URL of the new file|
|token|string|Token of the new file|
|revision|int|Version number of the new file|

### Response body example
```json
{
   "code":0,
   "msg":"Success",
   "data":{
      "url":"https://example.feishu.cn/sheets/shtcnOko1Ad0HU48HH8KHabcef",
      "token":"shtcnOko1Ad0HU48HH8KHabcef",
      "revision":0
   }
}
```
### Error codes
The following are the error codes related to this API. For other common error codes, refer to [Server-side error codes](https://open.feishu.cn/document/ukTMukTMukTM/ugjM14COyUjL4ITN).

Error code | Description | Troubleshooting suggestions
---|---|---
91201 | FAILED | Failed to process, try again later.
91202 | PARAMERR | parameter error, check whether the parameters are correct, such as: `type`, `fileToken`, `dstFolderToken`.
91203 | NOTEXIST | Please check whether the request parameters are correct.
91204 | FORBIDDEN | Check the permissions of the current account to documents and folders. Refer to [Access Process Authorization](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/docs-overview#6d744fe3)
91205 | DELETED | The source file has been deleted, check if it still exists.
91206 | OUT_OF_LIMIT | Limit exceeded.
91207 | DUPLICATE | Duplicate record.
91208 | REVIEW | Content review failed.
91210 | doc type is deprecated, please use docx. | The creation capability for Docs 1.0 has been deprecated. For more details, please refer to [Scheduled offline of Docs 1.0 creation capability](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/breaking-change/docs-create-ability-offline).

