Concepts
Many objects store body content in blocks — structured trees attached to block properties (for example a page's main content or a daily note's notes field).
On GET /object, block trees appear under blocks, keyed by property definition id:
{
"blocks": {
"content": [
/* array of root-level blocks */
]
}
}
type | Role |
|---|---|
TextBlock | Paragraph or heading with inline text tokens and optional nested blocks |
GroupBlock | Container for nested blocks (lists, toggles) |
GridBlock | Multi-column layout (columns is an array of block arrays) |
CodeBlock | Fenced code (lang, text) |
MathBlock | Display math (LaTeX in text) |
EntityBlock | Embedded Capacities object (entityId) |
HorizontalLineBlock | Divider |
unsupported | Placeholder when the type is not yet exposed |
Each TextBlock has a tokens array of text tokens (TextToken, LinkToken, MathToken, CodeToken). See that page for types, fields, and examples.
TextBlock includes hierarchy: { key, val } for outline level. Optional fields include list (bullet/numbered), todo, toggle, and quote.
When creating or appending blocks, you send writable block objects. You may omit id on new blocks — the server assigns ids. For patching a single block (PATCH /blocks/block), the existing block id is preserved.
EntityBlock references use entityId to link to another object by id.
POST /blocks/append and POST /blocks/markdown/append accept optional position, parentBlockId, and propertyId (defaults to the structure’s main content property when omitted).
position.type | Behavior |
|---|---|
end | End of the target list (default) |
start | Beginning of the list |
after_block | Immediately after after_block.id (do not set parentBlockId) |
For end / start, omit parentBlockId to append at the property root, or set it to a parent block id to nest inside that block. Only TextBlock and GroupBlock may be parents. You cannot append into CodeBlock, EntityBlock, MathBlock, and similar leaf types.
PATCH /blocks/block replaces one block’s content. The block id is unchanged and the request block.type must match the existing block. For TextBlock, GroupBlock, and GridBlock, omit nested blocks or columns to keep existing children; include them to replace the full child list.
| Operation | Endpoint |
|---|---|
| Append blocks | POST /blocks/append |
| Append Markdown | POST /blocks/markdown/append |
| Update one block | PATCH /blocks/block |
| Delete blocks | POST /blocks/delete |
Deleting a block removes its entire subtree — do not list child ids separately.
For many write and read flows you can use Markdown instead of building block JSON — especially helpful for AI-generated content.
POST /blocks/daily-note/append and POST /blocks/markdown/daily-note append content to the daily note for a given day in the token’s space.
date selects the daily note day as an ISO 8601 timestamp at UTC midnight (…T00:00:00.000Z). Omit date to use today (UTC).noTimeStamp: true skips the automatic timestamp heading block when appending.Create a ticket on our feedback board. - Let us know if you have an idea for a feature, improvement or think there is something missing.
Request additions to the documentation. - If your questions are not getting answered, let us know and we will extend the documentation.