Craft Documents icon

Craft Documents

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

Block → Get

AI-generated

Summary

Retrieve a block or document content from Craft Documents by specifying its document or block ID, with options to control nesting depth, response format, and inclusion of metadata.

Inputs

  • Document or Block Name or ID (required) — Select a document or enter a block ID using the dropdown populated with documents or via an expression.
  • Max Depth — Set the maximum depth of nested content to fetch: -1 for all descendants, 0 for the block itself, or a number up to 10 for nested blocks.
  • Response Format — Choose to receive the response as structured JSON data with IDs and properties or as rendered Markdown text.
  • Fetch Metadata — Optionally include metadata such as comments, timestamps, and authors for the blocks.

Output shape

a single block or document content representation

The output shape depends on the chosen 'Response Format': as structured JSON with nested block data or as Markdown text. The fetched content respects the specified 'Max Depth' and optional metadata inclusion. Errors during fetch result in detailed error messages.

Links

Discussion