Skip to main content
An online document is a tree composed of multiple block elements. Different types of BlockElement can nest different types of elements inside. For example, a Callout block can nest any BlockElement, but a Paragraph block can only nest InlineElement. The data structure of a single block element is as follows:
{
  "blockType": enum(BlockType),             // Block element type. See the `BlockType` enum at the bottom of this document.
  /**
   * The following are all supported Block types, such as Heading and Paragraph.
   * Each Block type has its own property.
  */
  "blockquote": Object(Callout),
  "callout": Object(Callout),
  "columns": Object(Columns),
  "heading": Object(Heading),
  "paragraph": Object(Paragraph),
  "orderedList": Object(OrderedList)
  "unorderedList": Object(UnorderedList),
  "table": Object(Table),
  // Each Block type has its own supported BlockChildren. See the `children` description under each Block type.

  "children": BlockChildren[ ],

}

Block element data structure

An online document is a tree structure composed of multiple block elements. Different types of block elements support different types of nested child elements:
  • The children of callout and columns must be a BlockElement array.
  • The children of paragraph, heading, orderedList, unorderedList, and blockquote must be an InlineElement array.
  • table does not currently support specifying children.

BlockType enum

Enum valueDescription
paragraphParagraph block.
headingHeading block.
blockquoteQuote block.
calloutCallout block.
columnsColumns block.
orderedListNumbered list block.
unorderedListBulleted list block.
tableSpreadsheet block.
tableRowTable row block (child of a table block).
tableCellTable cell block (child of a table block).
Unsupported element types uniformly return Undefined.

Paragraph

{
  "blockType": "paragraph",
  "paragraph": {
    "text": "Paragraph text content",
    "indent": { "left": 32 },
    "folded": false
  },
  "children": [InlineElement]
}
Field nameTypeRequiredDescription
textstringNoText content of the paragraph.
indentobject(Indent)NoIndent value. left must be an integer greater than 0.
foldedbooleanNoWhether to fold the paragraph (folds block elements with an indent value greater than the current paragraph).
  • children: InlineElement array.
  • The paragraph object cannot be omitted. When the content is empty, pass {}.

Heading

{
  "blockType": "heading",
  "heading": {
    "level": 1,
    "text": "Level 1 heading"
  },
  "children": [InlineElement]
}
Field nameTypeRequiredDescription
textstringNoText content of the heading.
levelinteger(enum)NoHeading level. Value range: 1 to 6. 1 indicates a level 1 heading.
  • children: InlineElement array.

Quote

{
  "blockType": "blockquote",
  "blockquote": {
    "text": "Quoted content",
    "indent": { "left": 32 }
  },
  "children": [InlineElement]
}
Field nameTypeRequiredDescription
textstringNoText inside the quote.
indentobject(Indent)NoSpecific indent value.
  • children: InlineElement array.

Callout block

{
  "blockType": "callout",
  "callout": {
    "sticker": "灯泡",
    "showstk": true,
    "color": "#333333",
    "border": "#FFD700",
    "bgcolor": "#FFF9C4"
  },
  "children": [BlockElement]
}
Field nameTypeRequiredDescription
stickerstring(enum Emoji)NoEmoji code. See Emoji enum values.
showstkbooleanNoWhether to display the emoji.
colorstringNoText color.
borderstringNoBorder color.
bgcolorstringNoBackground color.
  • children: BlockElement array (InlineElement is not allowed).

Columns

{
  "blockType": "columns",
  "columns": {
    "size": 2,
    "noFill": false
  },
  "children": [BlockElement]
}
Field nameTypeRequiredDescription
sizenumberNoNumber of columns.
noFillbooleanNoWhether to automatically fill the background color.
  • children: BlockElement array (InlineElement is not allowed).

Numbered list

{
  "blockType": "orderedList",
  "orderedList": {
    "list": {
      "listId": "list-001",
      "level": 0,
      "listStyleType": "decimal",
      "listStyle": {
        "format": "decimal",
        "text": "%1.",
        "align": "left"
      },
      "symbolStyle": {
        "bold": false
      }
    },
    "indent": { "left": 32 }
  },
  "children": [InlineElement]
}
Field nameTypeRequiredDescription
listobject(ListObject)YesSpecific attributes of the numbered list. See ListObject.
indentobject(Indent)NoIndent value. left must be an integer greater than 0.
  • children: InlineElement array.

Bulleted list

{
  "blockType": "unorderedList",
  "unorderedList": {
    "list": {
      "listId": "list-002",
      "level": 0,
      "listStyleType": "disc",
      "listStyle": {
        "format": "disc",
        "text": "%1",
        "align": "left"
      },
      "symbolStyle": {
        "bold": false
      }
    },
    "indent": { "left": 32 }
  },
  "children": [InlineElement]
}
Field nameTypeRequiredDescription
listobject(ListObject)YesSpecific attributes of the bulleted list. See ListObject.
indentobject(Indent)NoIndent value. left must be an integer greater than 0.
  • children: InlineElement array.

Spreadsheet

{
  "blockType": "table",
  "table": {
    "rolSize": 3,
    "colSize": 4,
    "cells": [
      ["Row1-Col1", "Row1-Col2", "Row1-Col3", "Row1-Col4"],
      ["Row2-Col1", "Row2-Col2", "Row2-Col3", "Row2-Col4"],
      ["Row3-Col1", "Row3-Col2", "Row3-Col3", "Row3-Col4"]
    ]
  }
}
Field nameTypeRequiredDescription
rolSizenumberYesNumber of rows.
colSizenumberYesNumber of columns.
cellsString[][]NoCell text content. A two-dimensional String array.
  • children: Not supported. Specifying children is not currently allowed.

InlineElement data structure

Inline elements are used in the children of text-based block elements (paragraphs, headings, lists, and so on).

InlineType enum

Enum valueDescription
textText.
stickerEmoji.
imageImage.
linkLink.

Text

{
  "text": "Bold red text",
  "sz": 16,
  "color": "red",
  "highlight": "yellow",
  "bold": true,
  "italic": false,
  "stike": false,
  "underline": false,
  "fonts": "monospace"
}
Field nameTypeRequiredDescription
textstringYesText content.
sznumberNoFont size (default unit: px).
colorstringNoText color.
highlightstringNoHighlight background color.
boldbooleanNoWhether to apply bold.
italicbooleanNoWhether to apply italic.
stikebooleanNoWhether to apply strikethrough.
underlinebooleanNoWhether to apply underline.
fontsstring(enum Fonts)NoFont. Enum values: - monospace: monospace font - STSong: STSong - Microsoft YaHei: Microsoft YaHei - FangSong_GB2312: FangSong GB2312 - Helvetica: Helvetica - Helvetica Neue: Helvetica Neue - Consolas: Consolas - 宋体: SimSun - Impact: Impact - sanrif: sanrif - Calibri: Calibri

Emoji

{
  "elementType": "sticker",
  "properties": {
    "code": "大笑"
  }
}
Field nameTypeRequiredDescription
codestring(enum Emoji)YesEmoji code. See Emoji enum values.

Image

{
  "elementType": "image",
  "properties": {
    "src": "https://example.com/image.jpg"
  }
}
Field nameTypeRequiredDescription
srcstringNoImage resource URL.
{
  "elementType": "link",
  "properties": {
    "href": "https://example.com"
  },
  "children": [
    { "text": "Click to open the link" }
  ]
}
Field nameTypeRequiredDescription
hrefstringNoLink URL.
  • children: Text array. When inserting a link, children must be specified and contain at least one text node whose text is not empty.

Common data structures

Indent

Field nameTypeRequiredDescriptionExample
leftnumberNoSpecific indent value. Must be an integer greater than 0, otherwise an error is returned.32

ListObject

Field nameTypeRequiredDescription
listIdstringNoID of the current list. When inserting a multi-level numbered list, ensure that listId is consistent across the same group of multi-level lists, otherwise the display will be incorrect.
levelnumberYesList tier (starting from 0).
listStyleTypestringYesList style type.
listStyleobject(ListStyle)YesSpecific list style. See ListStyle.
symbolStyleobject(SymbolStyle)NoStyle of the list symbol. See SymbolStyle.

ListStyle

Field nameTypeRequiredDescription
formatstringYesBullet list format.
textstringYesText.
alignstringYesAlignment, such as left, center, or right.

SymbolStyle

Field nameTypeRequiredDescription
sznumberNoFont size of the bullet list symbol.
shdstringNoBackground color of the bullet list symbol.
fontsstringNoFont format of the bullet list symbol.
colorstringNoFont color of the bullet list symbol.
boldbooleanNoWhether to apply bold.
strikebooleanNoWhether to display strikethrough.
italicbooleanNoWhether to display italic.

Emoji enum values (complete list of emoji codes)

The following enum values can be used for callout.sticker and the inline emoji element sticker.properties.code.
EmojiEmojiEmojiEmoji
优先级: 1 // Priority: 1优先级: 2 // Priority: 2优先级: 3 // Priority: 3优先级: 4 // Priority: 4
优先级: 5 // Priority: 5优先级: 6 // Priority: 6优先级: 7 // Priority: 7进度: 未开始 // Progress: Not started
进度: 20% // Progress: 20%进度: 40% // Progress: 40%进度: 50% // Progress: 50%进度: 70% // Progress: 70%
进度: 90% // Progress: 90%进度: 已完成 // Progress: Completed微笑 // Smile憨笑 // Grin
大笑 // Laugh加油 // Cheer // Drool偷笑 // Snicker
跳舞 // Dance捂脸哭 // Facepalm cry笑哭 // Laughing tears流泪 // Tear
疑问 // Question傻笑 // Silly grin流鼻血 // Nosebleed狗子 // Doggy
// Thumbs upOK抱拳 // Cupped hands向上 // Up
向下 // Down向左 // Left向右 // Right资料 // Profile
本子 // Notebook笔记本 // Laptop折线图 // Line柱状图 // Column
羽毛笔 // Quill钢笔 // Pen警告 // Warning问号 // Question mark
禁止 // Forbidden禁行 // No entry // Lock气泡 // Speech bubble
沙漏 // Hourglass公文包 // Briefcase火箭 // Rocket // Fire
奖牌 // Medal灯泡 // Lightbulb钉子 // Nail旗子 // Flag
// Tea休假 // Vacation气球 // Balloon锦鲤 // Koi
咖啡 // Coffee奶茶 // Milk tea调色板 // Palette感谢 // Thanks
打招呼 // Wave666握手 // Handshake胜利 // Victory
一点点 // A little鼓掌 // Applause送花花 // Send flowers比心 // Finger heart
加一 // +1100分 // 100 pointsKPI对勾 // Check
爱心 // Heart可爱 // Cute发呆 // Stunned老板 // Boss
害羞 // Shy闭嘴 // Zip it // Sleep大哭 // Bawl
尴尬 // Awkward调皮 // Mischievous惊讶 // Surprised流汗 // Sweat
广播 // Broadcast自信 // Confident你强 // You rock怒吼 // Roar
惊愕 // Shocked快哭了 // About to cry无聊 // Bored // Puke
算账 // Settle accounts // Dizzy摸摸 // Pat飞吻 // Blow kiss
鄙视 // Disdain // Shush思考 // Think亲亲 // Kiss
感冒 // Cold对不起 // Sorry再见 // Goodbye投降 // Surrender
// Hmph欠扁 // Asking for it坏笑 // Sly smile拜托 // Please
可怜 // Pitiful舒服 // Comfy爱意 // Love财迷 // Money lover
迷惑 // ConfusedPK委屈 // Aggrieved灵感 // Inspiration
天使 // Angel鬼脸 // Ghost face凄凉 // Forlorn郁闷 // Gloomy
吃瓜 // Watching drama嘿嘿 // Hehe抠鼻 // Nose pick呲牙 // Toothy grin
彩虹 // Rainbow // Yay捂眼睛 // Cover eyes推眼镜 // Push glasses
暗中观察 // Watching quietly开心 // Happy惊喜 // Surprise回头 // Look back
发怒 // Angry忍者 // Ninja // Unlucky脑暴 // Brainstorm
冷笑 // Smirk黑眼圈 // Dark circles恭喜 // Congrats费解 // Puzzled
收到 // Received炸弹 // Bomb白眼 // Eye roll一团乱麻 // Mess
无奈 // Helpless敲打 // Knock专注 // Focused忙疯了 // Swamped
鞠躬 // Bow摊手 // Shrug抱抱 // Hug举手 // Raise hand
跪了 // Kneel猫咪 // Kitty二哈 // Husky三多 // Sanduo
承让 // You let me win撒花 // Confetti邮件 // Mail文档 // Document
演示 // Presentation表格 // Spreadsheet生日快乐 // Happy birthday心碎 // Heartbreak
红包 // Red packet嘴唇 // Lips鲜花 // Fresh flower残花 // Wilted flower
干杯 // Cheers出差 // Business trip时间 // Time // Fortune
月饼 // Mooncake礼物 // Gift幼苗 // Sprout烟花 // Fireworks
灯笼 // Lantern爆竹 // Firecracker鸡腿 // Chicken leg高铁 // High-speed rail
三连 // Triple comboOKRDone