doc_create_blocks
Inserts child blocks under a specified block in Feishu documents. Use block_type definitions to add paragraphs, headings, lists, code, quotes, dividers, and other content.
Instructions
在飞书文档指定块下插入子块。
支持的 block_type 及对应字段名: 2=文本段落(text) 示例: {"block_type":2,"text":{"elements":[{"text_run":{"content":"段落文本"}}]}} 3=H1(heading1) 示例: {"block_type":3,"heading1":{"elements":[{"text_run":{"content":"一级标题"}}]}} 4=H2(heading2) 示例: {"block_type":4,"heading2":{"elements":[{"text_run":{"content":"二级标题"}}]}} 5=H3(heading3), 6=H4(heading4), 7=H5(heading5), 8=H6(heading6), 9=H7(heading7) — 格式同上 11=无序列表(bullet) 示例: {"block_type":11,"bullet":{"elements":[{"text_run":{"content":"列表项"}}]}} 12=有序列表(ordered) 示例: {"block_type":12,"ordered":{"elements":[{"text_run":{"content":"步骤一"}}]}} 14=代码块(code) 示例: {"block_type":14,"code":{"elements":[{"text_run":{"content":"print('hi')"}}],"style":{"language":49}}} 15=引用(quote) 示例: {"block_type":15,"quote":{"elements":[{"text_run":{"content":"引用文本"}}]}} 34=高亮块(callout) 示例: {"block_type":34,"callout":{"elements":[{"text_run":{"content":"提示内容"}}]}} 22=分割线(divider) 示例: {"block_type":22,"divider":{}}
文本样式(text_element_style): bold=加粗, italic=斜体, underline=下划线, strikethrough=删除线, inline_code=行内代码 示例: {"text_run":{"content":"加粗文字","text_element_style":{"bold":true}}}
注意: elements 数组中可包含多个 text_run 实现混合样式。每种块的字段名必须与 block_type 对应(如 block_type=4 用 heading2, block_type=11 用 bullet)。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| index | No | 插入位置(0-based),不填则追加到末尾 | |
| block_id | Yes | 父块 ID(通常用文档根块 ID,即 document_id) | |
| children | Yes | 要插入的块数组,每个元素为飞书 Block 对象(含 block_type 及对应内容字段) | |
| document_id | Yes | 文档 ID |