---
title: "Retrieve Full Document Content in Chunks"
method: POST
path: "/v1/artifacts/chunked-content"
tags: ["Artifacts", "Artifacts"]
---

# Retrieve Full Document Content in Chunks

`POST /v1/artifacts/chunked-content`

Retrieve full document content split into chat-optimized chunks.

This endpoint provides access to complete document content split into
manageable chunks suitable for chat interfaces. Unlike semantic chunk
retrieval, this returns complete documents divided sequentially.

Key Features:
* Chat-Optimized Chunking: Documents split into conversational pieces
* Node Type Filtering: Include or exclude images, tables, and other node types
* Token-Aware Splitting: Respects token limits for chat context management
* Sequential Chunks: Maintains document order and narrative flow
* Filtered Retrieval: Select specific documents using metadata filters
* Token Limiting: Optional max_tokens parameter to control response size

Content Filtering:
* Use include to retrieve only specific node types
* Use exclude to omit unwanted content types
* Supports TextNode, ImageNode, TableNode, and other node types
* Filtering is applied before chunking

Chunking Process:
1. Retrieve filtered documents based on context criteria
2. Apply node type filters (include/exclude)
3. Split documents into chat-appropriate segments respecting max_tokens
4. Return structured chunks with metadata and citations

Notes:
* Chunks maintain document structure and logical flow
* Token limiting prevents context window overflow
* Node type filtering reduces payload size and improves relevance
* Use `/artifacts/search` endpoint for semantic search instead

## Request body

- ContentBody — Request body for retrieving full document content with filtering options.
  - `context_filter` ContextFilter, required — Filter by collection, artifacts and metadata in the ingested context. The main filter is the collection the context is part of. All artifacts ids are ensured to be part of the context. If any of the ids is not usable in the context (i.e. doesn't exist), the related task will fail. The metadata filter will look for all context matching the metadata, if any, and add it to the context. The filter is a dictionary of key-value pairs. The key is the metadata key, and the value is the metadata value. If both artifacts and metadata filters are provided, the result will be the intersection of the two filters.
    - `collection` string — The name of the collection to filter on.
    - `artifacts` string[], nullable — Artifacts ids to filter on.
    - `metadata_filter` object[], nullable — Metadata filter to apply on the context.
  - `format` 'object' | 'markdown' — Enumeration of content retrieval formats.
  - `filter` ContentFilter — Filter the content by node types to include in the response.
    - `include` string[], nullable — List of node types to include in the content response. If not specified, all node types will be included. Example node types include TextNode, ImageNode, TableNode, etc.
    - `exclude` string[], nullable — List of node types to exclude from the content response. If not specified, no node types will be excluded. Example node types include TextNode, ImageNode, TableNode, etc.
    - `node_ids` string[], nullable — List of specific node IDs to retrieve from the document tree. When specified, only these nodes (and optionally their children) will be returned. Useful for retrieving specific sections or parts of a document. Example: ['382b0aab-3c63-44a1-ae2e-1ee234009d6e', '6d2a3086-10bc-4d76-885b-2208c211b648']
    - `include_children` boolean — When node_ids is specified, determines whether to include the full subtree below each selected node. If True (default), returns complete subtrees. If False, returns only the specified nodes without their descendants.
    - `include_ancestors` boolean — When node_ids is specified, determines whether to include ancestor nodes in the path from each selected node to the document root. If True, provides structural context. If False (default), returns only selected subtrees.
  - `max_tokens` integer, nullable — Maximum number of tokens to return in the content. If not set, returns full content of the documents.

## Response `200`

Successful chunked content retrieval

- ChunkedContentResponse — Response containing chunked document content for chat usage.
  - `data` ChunkedContentDocumentResponse[], required — List of documents with their content split into chunks for chat usage
    - `artifact_id` string, required — Identifier of the document
    - `content` union[], required — Chunked content of the document, split into manageable pieces
      - union
        - TextBlock — Plain-text content block.
          - `type` 'text', required — type field.
          - `start_timestamp` string, date-time, nullable — start timestamp field.
          - `stop_timestamp` string, date-time, nullable — stop timestamp field.
          - `_meta` object — meta field.
          - `cache_control` CacheControlEphemeral — CacheControlEphemeral schema.
            - `type` 'ephemeral', required — type field.
            - `ttl` '5m' | '1h' — ttl field.
          - `text` string — Text payload for this block.
          - `citations` ZylonCitation[], nullable — citations field.
            - `id` string, nullable — Unique identifier for the citation
            - `index` integer, nullable — Index of the citation in the document
            - `artifact_id` string, nullable — Identifier of the artifact associated with the citation
            - `source_id` string, nullable — Identifier of the source document from which the citation is derived
        - ImageBlock — Anthropic-compatible image content block.
          - `type` 'image', required — type field.
          - `start_timestamp` string, date-time, nullable — start timestamp field.
          - `stop_timestamp` string, date-time, nullable — stop timestamp field.
          - `_meta` object — meta field.
          - `cache_control` CacheControlEphemeral — CacheControlEphemeral schema.
            - `type` 'ephemeral', required — type field.
            - `ttl` '5m' | '1h' — ttl field.
          - `source` union, required — Anthropic image source payload
            - Base64ImageSource — Anthropic base64 image source payload.
              - …
            - URLSource — Shared URL source payload (accepts url/uri input).
              - …
        - AudioBlock — Anthropic-compatible audio content block.
          - `type` 'audio', required — type field.
          - `start_timestamp` string, date-time, nullable — start timestamp field.
          - `stop_timestamp` string, date-time, nullable — stop timestamp field.
          - `_meta` object — meta field.
          - `cache_control` CacheControlEphemeral — CacheControlEphemeral schema.
            - `type` 'ephemeral', required — type field.
            - `ttl` '5m' | '1h' — ttl field.
          - `source` union, required — Audio source payload
            - Base64AudioSource — Anthropic-style base64 audio source payload.
              - …
            - URLSource — Shared URL source payload (accepts url/uri input).
              - …
        - BinaryBlock — Arbitrary binary payload (PDF, ZIP, …) encoded as base64.
          - `type` 'binary', required — type field.
          - `start_timestamp` string, date-time, nullable — start timestamp field.
          - `stop_timestamp` string, date-time, nullable — stop timestamp field.
          - `_meta` object — meta field.
          - `filename` string, nullable — filename field.
          - `source` union, required — Binary source payload
            - Base64BinarySource — Base64 source payload for arbitrary binary data.
              - …
            - URIBinarySource — URI source payload for arbitrary binary data.
              - …
        - LocalResourceBlock — Reference to a local file produced by code execution.
          - `type` 'local_resource', required — type field.
          - `start_timestamp` string, date-time, nullable — start timestamp field.
          - `stop_timestamp` string, date-time, nullable — stop timestamp field.
          - `_meta` object — meta field.
          - `file_path` string, required — Absolute path to the file inside the execution environment
          - `file_id` string, nullable — Base64url-encoded storage file ID used to download the file via the files API
          - `name` string, required — Human-readable file name (stem, without extension)
          - `mime_type` string, required — MIME type of the file
        - ResourceLinkBlock — Reference to an external resource by URI (not embedded).
          - `type` 'resource_link', required — type field.
          - `start_timestamp` string, date-time, nullable — start timestamp field.
          - `stop_timestamp` string, date-time, nullable — stop timestamp field.
          - `_meta` object — meta field.
          - `uri` string, required — URI of the external resource
          - `name` string, required — Human-readable resource name
          - `description` string, nullable — description field.
          - `mime_type` string, nullable — mime type field.
        - ResourceBlock — Embedded resource with metadata.
          - `type` 'resource', required — type field.
          - `start_timestamp` string, date-time, nullable — start timestamp field.
          - `stop_timestamp` string, date-time, nullable — stop timestamp field.
          - `_meta` object — meta field.
          - `resource` Resource, required — Resource schema.
            - `uri` string, required — uri field.
            - `name` string, required — name field.
            - `description` string, nullable — description field.
            - `mime_type` string, nullable — mime type field.
        - SourceBlock — Document chunks surfaced as RAG context attribution.
          - `type` 'source', required — type field.
          - `start_timestamp` string, date-time, nullable — start timestamp field.
          - `stop_timestamp` string, date-time, nullable — stop timestamp field.
          - `_meta` object — meta field.
          - `sources` union[], required — Document chunks used as context for this response
            - union
              - …
        - ThinkingBlock — Extended thinking block containing the model's reasoning process.
          - `type` 'thinking', required — type field.
          - `start_timestamp` string, date-time, nullable — start timestamp field.
          - `stop_timestamp` string, date-time, nullable — stop timestamp field.
          - `_meta` object — meta field.
          - `cache_control` CacheControlEphemeral — CacheControlEphemeral schema.
            - `type` 'ephemeral', required — type field.
            - `ttl` '5m' | '1h' — ttl field.
          - `thinking` string — Thinking payload
          - `signature` string, required — Anthropic reasoning signature required for extended thinking compatibility
          - `citations` ZylonCitation[], nullable — citations field.
            - `id` string, nullable — Unique identifier for the citation
            - `index` integer, nullable — Index of the citation in the document
            - `artifact_id` string, nullable — Identifier of the artifact associated with the citation
            - `source_id` string, nullable — Identifier of the source document from which the citation is derived
        - RedactedThinkingBlock — Redacted thinking block returned when thinking content is encrypted.
          - `type` 'redacted_thinking', required — type field.
          - `start_timestamp` string, date-time, nullable — start timestamp field.
          - `stop_timestamp` string, date-time, nullable — stop timestamp field.
          - `_meta` object — meta field.
          - `cache_control` CacheControlEphemeral — CacheControlEphemeral schema.
            - `type` 'ephemeral', required — type field.
            - `ttl` '5m' | '1h' — ttl field.
          - `data` string, required — Encrypted thinking payload
        - ToolUseBlock — Represents a model-initiated tool call.
          - `type` 'tool_use', required — type field.
          - `start_timestamp` string, date-time, nullable — start timestamp field.
          - `stop_timestamp` string, date-time, nullable — stop timestamp field.
          - `_meta` object — meta field.
          - `cache_control` CacheControlEphemeral — CacheControlEphemeral schema.
            - `type` 'ephemeral', required — type field.
            - `ttl` '5m' | '1h' — ttl field.
          - `id` string, required — Unique identifier for this tool use
          - `name` string, required — Name of the tool being called
          - `input` object, required — Input payload for the tool call
          - `caller` union — caller field.
            - DirectCaller — DirectCaller schema.
              - …
            - ServerToolCaller — ServerToolCaller schema.
              - …
            - ServerToolCaller20260120 — ServerToolCaller20260120 schema.
              - …
        - ServerToolUseBlock — Represents a server-side (built-in) tool call initiated by the model.
          - `type` 'server_tool_use', required — type field.
          - `start_timestamp` string, date-time, nullable — start timestamp field.
          - `stop_timestamp` string, date-time, nullable — stop timestamp field.
          - `_meta` object — meta field.
          - `cache_control` CacheControlEphemeral — CacheControlEphemeral schema.
            - `type` 'ephemeral', required — type field.
            - `ttl` '5m' | '1h' — ttl field.
          - `id` string, required — Unique identifier for this server tool use
          - `name` 'web_search' | 'web_fetch' | 'code_execution' | 'bash_code_execution' | 'text_editor_code_execution' | 'tool_search_tool_regex' | 'tool_search_tool_bm25', required — Name of the server tool being called
          - `input` object, required — Input payload for the server tool call
          - `caller` union — caller field.
            - DirectCaller — DirectCaller schema.
              - …
            - ServerToolCaller — ServerToolCaller schema.
              - …
            - ServerToolCaller20260120 — ServerToolCaller20260120 schema.
              - …
        - ContainerUploadBlock — References a file that was uploaded to an Anthropic container.
          - `type` 'container_upload', required — type field.
          - `start_timestamp` string, date-time, nullable — start timestamp field.
          - `stop_timestamp` string, date-time, nullable — stop timestamp field.
          - `_meta` object — meta field.
          - `cache_control` CacheControlEphemeral — CacheControlEphemeral schema.
            - `type` 'ephemeral', required — type field.
            - `ttl` '5m' | '1h' — ttl field.
          - `file_id` string, required — Container file identifier
        - DocumentBlock — Anthropic document block (used for document-grounded generation).
          - `type` 'document', required — type field.
          - `start_timestamp` string, date-time, nullable — start timestamp field.
          - `stop_timestamp` string, date-time, nullable — stop timestamp field.
          - `_meta` object — meta field.
          - `cache_control` CacheControlEphemeral — CacheControlEphemeral schema.
            - `type` 'ephemeral', required — type field.
            - `ttl` '5m' | '1h' — ttl field.
          - `source` union, required — Document source payload
            - Base64Source — Base64Source schema.
              - …
            - PlainTextSource — PlainTextSource schema.
              - …
            - ContentSource — ContentSource schema.
              - …
            - URLDocumentSource — URLDocumentSource schema.
              - …
          - `title` string, nullable — title field.
          - `context` string, nullable — context field.
          - `citations` ZylonCitation[], nullable — citations field.
            - `id` string, nullable — Unique identifier for the citation
            - `index` integer, nullable — Index of the citation in the document
            - `artifact_id` string, nullable — Identifier of the artifact associated with the citation
            - `source_id` string, nullable — Identifier of the source document from which the citation is derived
        - SearchResultBlock — Anthropic search result block.
          - `type` 'search_result', required — type field.
          - `start_timestamp` string, date-time, nullable — start timestamp field.
          - `stop_timestamp` string, date-time, nullable — stop timestamp field.
          - `_meta` object — meta field.
          - `cache_control` CacheControlEphemeral — CacheControlEphemeral schema.
            - `type` 'ephemeral', required — type field.
            - `ttl` '5m' | '1h' — ttl field.
          - `source` string, required — Search result source payload
          - `title` string, required — Search result title
          - `content` TextBlock[], required — Search result content
            - `type` 'text', required — type field.
            - `start_timestamp` string, date-time, nullable — start timestamp field.
            - `stop_timestamp` string, date-time, nullable — stop timestamp field.
            - `_meta` object — meta field.
            - `cache_control` CacheControlEphemeral — CacheControlEphemeral schema.
              - …
            - `text` string — Text payload for this block.
            - `citations` ZylonCitation[], nullable — citations field.
              - …
          - `citations` ZylonCitation[], nullable — citations field.
            - `id` string, nullable — Unique identifier for the citation
            - `index` integer, nullable — Index of the citation in the document
            - `artifact_id` string, nullable — Identifier of the artifact associated with the citation
            - `source_id` string, nullable — Identifier of the source document from which the citation is derived
        - MidConvSystemBlock — System instructions injected at a specific point mid-conversation.
          - `type` 'mid_conv_system', required — type field.
          - `start_timestamp` string, date-time, nullable — start timestamp field.
          - `stop_timestamp` string, date-time, nullable — stop timestamp field.
          - `_meta` object — meta field.
          - `cache_control` CacheControlEphemeral — CacheControlEphemeral schema.
            - `type` 'ephemeral', required — type field.
            - `ttl` '5m' | '1h' — ttl field.
          - `content` TextBlock[], required — System instruction text blocks.
            - `type` 'text', required — type field.
            - `start_timestamp` string, date-time, nullable — start timestamp field.
            - `stop_timestamp` string, date-time, nullable — stop timestamp field.
            - `_meta` object — meta field.
            - `cache_control` CacheControlEphemeral — CacheControlEphemeral schema.
              - …
            - `text` string — Text payload for this block.
            - `citations` ZylonCitation[], nullable — citations field.
              - …
        - TLDRBlock — Condensed summary block.
          - `type` 'tldr', required — type field.
          - `start_timestamp` string, date-time, nullable — start timestamp field.
          - `stop_timestamp` string, date-time, nullable — stop timestamp field.
          - `_meta` object — meta field.
          - `content` union[] — content field.
            - union
              - …
          - `tldr_side` 'left' | 'right' — tldr side field.

## Other responses

- `401` — Unauthorized
- `422` — Validation Error - Invalid request parameters

## Changes

- **2026-07-06** `594fa71dfb90` — 6 breaking, 12 info
  - the response property `data/items/content/items/anyOf[subschema #13: DocumentBlock -> subschema #14: DocumentBlock]/source/oneOf[subschema #2: PlainTextSource]/type` became optional for the status `200`
  - the response property `data/items/content/items/anyOf[subschema #13: DocumentBlock -> subschema #14: DocumentBlock]/source/oneOf[subschema #3: ContentSource]/type` became optional for the status `200`
  - the response property `data/items/content/items/anyOf[subschema #16: TLDRBlock -> subschema #17: TLDRBlock]/content/items/anyOf[subschema #13: DocumentBlock -> subschema #14: DocumentBlock]/source/oneOf[subschema #2: PlainTextSource]/type` became optional for the status `200`
  - the response property `data/items/content/items/anyOf[subschema #16: TLDRBlock -> subschema #17: TLDRBlock]/content/items/anyOf[subschema #13: DocumentBlock -> subschema #14: DocumentBlock]/source/oneOf[subschema #3: ContentSource]/type` became optional for the status `200`
  - …14 more
- **2026-06-03** `7914e6f947be` — 2 info
  - added `#/components/schemas/MidConvSystemBlock` to the `data/items/content/items/` response property `anyOf` list for the response status `200`
  - added `#/components/schemas/MidConvSystemBlock` to the `data/items/content/items/anyOf[subschema #15: TLDRBlock -> subschema #16: TLDRBlock]/content/items/` response property `anyOf` list for the response status `200`
- …earlier changes not shown

[Full history](https://skmtc.dev/zylon-ai/apis/private-gpt-api/changes/v1/artifacts/chunked-content/post.md)

---

[API](https://skmtc.dev/zylon-ai/apis/private-gpt-api.md) · [All operations](https://skmtc.dev/zylon-ai/apis/private-gpt-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/zylon-ai/private-gpt-api/revisions/4e828cf153c4/schema)
