Craft Documents icon

Craft Documents

Interact with Craft Multi-Document API - manage documents, blocks, collections, and search

Block → Insert

AI-generated

Summary

Insert markdown content as new blocks into a specified Craft document at a given position within the document's content.

Inputs

  • Target Document Name or ID (required) — Select the target document by name or ID where the markdown content will be inserted. You can choose from the dropdown list or specify an ID with an expression.
  • Markdown Content (required) — Provide the markdown content to insert. The Craft API automatically parses this markdown into structured blocks such as headers, code blocks, and lists.
  • Insert Position (required) — Choose where to insert the content within the document: at the start, end, before a specific block, or after a specific block.
  • Reference Block ID — Specify the block UUID to position the insertion relative to when using 'before' or 'after' as the insert position.

Output shape

a single response object from the Craft API representing the inserted blocks in the target document

The operation sends a POST request to the /blocks endpoint with a request body containing the markdown content parsed into blocks and position details. If 'before' or 'after' position is chosen, the 'Reference Block ID' must be provided. The Craft API automatically handles markdown parsing into appropriate block types. Any API errors during insertion are propagated as node errors.

Links

Discussion