**版本：202601**

# 删除卡片内的块

**DELETE** `/openapi/2026-01/themes/edit-sessions/:oseid/sections/:section_id/blocks`

在编辑会话中，按下标删除某张卡片内的一个块。

## 请求

**Path参数**

- `oseid` string (required)

  编辑会话 ID
- `section_id` string (required)

  文档内的 section 实例 ID；也可传全局卡片 id（`header`、`footer`、`announcement`、`cart_drawer`）

**application/json**

**请求体 | 示例**

**请求体 (required)**

- `doc_id` string (required)

  文档（模板文件）ID
- `theme_id` string (required)

  主题 ID（拼渲染上下文 url）
- `block_index` int32

  要删除的块在「父容器」blocks 中的 0 基下标（`parent_path` 为空时即 section 根）
- `parent_path` int32[]

  从 section 根到目标块「父容器」的祖先下标路径（每个元素是某层 blocks 数组的 0 基下标）；空 = 顶层。如 `parent_path=[1,0]` 配合 `block_index=2` 删除 `section.blocks[1].blocks[0].blocks[2]`
- `template_name` string

  模板名；默认取文件 location 去掉 `.liquid`
- `locale` string

  渲染语言；默认 en\_US

```json
{
  "doc_id": "string",
  "theme_id": "string",
  "block_index": 0,
  "parent_path": [
    0
  ],
  "template_name": "string",
  "locale": "string"
}
```

## 响应

**200**

OK

**application/json**

**数据结构 | 示例**

**数据结构**

- `code` string

  错误码
- `message` string

  错误信息
- `data` object

  - `section` object

    更新后的 section 对象
  - `html` string

    渲染后的 section HTML。目标为全局卡片（header / footer 等）时为空 —— 这类卡片不单独返回渲染结果

```json
{
  "code": "string",
  "message": "string",
  "data": {
    "section": {},
    "html": "string"
  }
}
```
