服务端 API/云文档/电子表格/表格/创建表格
# 创建表格

使用该接口可以在指定的目录下创建在线表格。

## 请求

基本 | &nbsp;
---|---
HTTP URL | https://open.larksuite.com/open-apis/sheets/v3/spreadsheets
HTTP Method | POST
支持的应用类型 | Custom App、Store App
权限要求<br>**调用该 API 所需的权限。开启其中任意一项权限即可调用**<br>开启任一权限即可 | 查看、评论、编辑和管理云空间中所有文件(drive:drive)<br>查看、评论、编辑和管理电子表格(sheets:spreadsheet)

### 请求头

名称 | 类型 | 必填 | 描述
---|---|---|---
Authorization | string | 是 | `tenant_access_token`<br>或<br>`user_access_token`<br>**值格式**："Bearer `access_token`"<br>**示例值**："Bearer u-7f1bcd13fc57d46bac21793a18e560"<br>[了解更多：获取与使用access_token](https://open.larksuite.com/document/ukTMukTMukTM/uMTNz4yM1MjLzUzM)
Content-Type | string | 是 | **固定值**："application/json; charset=utf-8"

### 请求体

名称 | 类型 | 必填 | 描述
---|---|---|---
title | string | 否 | 表格标题<br>**示例值**："title"
folder_token | string | 否 | 文件夹token，获取方式见[概述](https://open.larksuite.com/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/files/guide/introduction)<br>**示例值**："fldcnMsNb*****hIW9IjG1LVswg"

### 请求体示例
```json
{
    "title": "title",
    "folder_token": "fldcnMsNb*****hIW9IjG1LVswg"
}
```

```
curl --location --request POST 'https://open.larksuite.com/open-apis/sheets/v3/spreadsheets' \
--header 'Authorization: Bearer u-3iqkd6KWzRLzNdXfeuCMEb' \
--header 'Content-Type: application/json' \
--data-raw '{
    "title":"title",
    "folder_token":"fldcnMsNb*****hIW9IjG1LVswg"
}'
```

## 响应

### 响应体

名称 | 类型 | 描述
---|---|---
code | int | 错误码，非 0 表示失败
msg | string | 错误描述
data | \- | \-
spreadsheet | spreadsheet | 表格
title | string | 表格标题
folder_token | string | 文件夹token，获取方式见[概述](https://open.larksuite.com/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/files/guide/introduction)
url | string | 文档url
spreadsheet_token | string | 表格token

### 响应体示例
```json
{
    "code": 0,
    "msg": "success",
    "data": {
        "spreadsheet": {
            "title": "title",
            "folder_token": "fldcnMsNb*****hIW9IjG1LVswg",
            "url": "https://example.larksuite.com/sheets/shtcnmBA*****yGehy8",
            "spreadsheet_token": "shtcnmBA*****yGehy8"
        }
    }
}
```

### 错误码

HTTP状态码 | 错误码 | 描述 | 排查建议
---|---|---|---
500 | 1315203 | Server Error | 服务内部错误，[详询客服](https://applink.larksuite.com/client/helpdesk/open?id=6626260912531570952)
400 | 1310229 | Wrong URL Param | 检查 url 参数
400 | 1310204 | Wrong Request Body | 检查请求体参数
400 | 1310213 | Permission Fail | 没有文档相应权限
400 | 1310235 | Retry Later | 稍后重试
500 | 1315201 | Server Error | 服务内部错误，[详询客服](https://applink.larksuite.com/client/helpdesk/open?id=6626260912531570952)
400 | 1310226 | Excess Limit | 超出限制，参考响应体中的错误提示

