# 删除条件格式

删除已有的条件格式。支持跨工作表删除多个条件格式。

## 使用限制
单次调用该接口，最多支持删除 10 个条件格式。

## 请求

基本 | &nbsp;
---|---
HTTP URL | https://open.feishu.cn/open-apis/sheets/v2/spreadsheets/:spreadsheet_token/condition_formats/batch_delete
HTTP Method | DELETE
接口频率限制 | [100 次/秒](https://open.feishu.cn/document/ukTMukTMukTM/uUzN04SN3QjL1cDN)
支持的应用类型 | Custom App、Store App
权限要求<br>**调用该 API 所需的权限。开启其中任意一项权限即可调用**<br>开启任一权限即可 | 查看、评论、编辑和管理云空间中所有文件(drive:drive)<br>查看、评论、编辑和管理电子表格(sheets:spreadsheet)

### 请求头

名称 | 类型 | 必填 | 描述
---|---|---|---
Authorization | string | 是 | 通过访问凭证（access_token）对调用者身份进行鉴权。可选值：<br>- `tenant_access_token`：	租户授权凭证。应用代表租户（即企业或团队）执行对应操作。示例值："Bearer t-7f1bcd13fc57d46bac21793aabcef"<br>- `user_access_token`：用户授权凭证。应用代表用户执行对应操作。示例值："Bearer u-7f1bcd13fc57d46bac21793aabcef"<br>了解更多，参考[获取访问凭证](https://open.feishu.cn/document/ukTMukTMukTM/uMTNz4yM1MjLzUzM)。
Content-Type | string | 是 | **固定值**："application/json; charset=utf-8"

### 路径参数

名称 | 类型 | 描述
---|---|---
spreadsheet_token | string | 电子表格的 token。可通过以下两种方式获取。了解更多，参考[电子表格概述](https://open.feishu.cn/document/ukTMukTMukTM/uATMzUjLwEzM14CMxMTN/overview)。<br>-  电子表格的 URL：https://sample.feishu.cn/sheets/==Iow7sNNEphp3WbtnbCscPqabcef==<br>- 调用[获取文件夹中的文件清单](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file/list) | **示例值**："Iow7sNNEphp3WbtnbCscPqabcef"

### 请求体

参数 | 类型 | 说明
---|---|---
sheet_cf_ids | array | 要删除的电子表格条件格式的 ID。最多可删除 10 个条件格式。<br>**注意**：<br>响应体中将返回每个条件格式的删除结果，包括成功或具体的失败信息。
sheet_id | string | 电子表格工作表的 ID。调用[获取工作表](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet/query)获取 ID。
cf_id | string | 条件格式的 ID。调用[获取条件格式](https://open.feishu.cn/document/ukTMukTMukTM/uATMzUjLwEzM14CMxMTN/conditionformat/condition-format-get)获取 ID。

### 请求体示例
```json
{
    "sheet_cf_ids": [
        {
            "sheet_id": "40a7b0",
            "cf_id": "6hP6Dj6gsd"
        }
    ]
}
```
###  cURL 请求示例
```bash
curl --location --request DELETE 'https://open.feishu.cn/open-apis/sheets/v2/spreadsheets/shtcngNygNfuqhxTBf588jwgWbJ/condition_formats/batch_delete' \
--header 'Authorization: Bearer t-e346617a4acfc3a11d4ed24dca0d0c0fc8e0067e' \
--header 'Content-Type: application/json' \
--data-raw '{
    "sheet_cf_ids": [
        {
            "sheet_id": "Q7PlXT",
            "cf_id": "KjRm0JyS1P"
        }
    ]
}'
```
## 响应
### 响应体

参数 | 类型 | 说明
---|---|---
code | int | 错误码，非 0 表示失败。
msg | <md-text type="field-type">string | 错误描述
data | / | /
responses | <md-text type="field-type">array&lt;interface&gt; | 响应信息
sheet_id | <md-text type="field-type">string | 工作表的 ID
<md-text type="field-name">cf_id | <md-text type="field-type">string | 删除的条件格式的 ID
<md-text type="field-name">res_code | <md-text type="field-type">int | 条件格式删除的状态码。0 表示成功创建，非 0 表示失败。
<md-text type="field-name">res_msg | <md-text type="field-type">string | 删除当前条件格式返回的状态信息，success 表示成功，非 success 将返回失败原因。

### 响应体示例
```json
{
    "code": 0,
    "data": {
        "responses": [
            {
                "cf_id": "6hP6Dj6gsd",
                "res_code": 555554047,
                "res_msg": "cfId not exist",
                "sheet_id": "40a7b0"
            }
        ]
    },
    "msg": "Success"
}
```
### 错误码

具体可参考：[服务端错误码说明](https://open.feishu.cn/document/ukTMukTMukTM/ugjM14COyUjL4ITN)