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

# Retrieve Full Document Content

`POST /v1/artifacts/content`

Retrieve the full content of filtered documents.

This endpoint provides access to complete document content rather than
semantic chunks. Use this when you need the entire context of documents
rather than relevant excerpts.

Key Features:
* Full Content: Get complete documents rather than chunks
* Multiple Formats: Return as markdown text or structured objects
* Node Type Filtering: Include or exclude images, tables, and other node types
* Node ID Filtering: Retrieve specific sections by their node IDs
* Filtered Retrieval: Select specific documents using metadata filters
* Bulk Retrieval: Get multiple documents in one request

Format Options:
* markdown (default): Returns flattened markdown text representation
* object: Returns hierarchical tree structure with typed nodes

Content Filtering:
* Use include to retrieve only specific node types
* Use exclude to omit unwanted content types
* Use node_ids to retrieve specific sections or nodes by ID
* Supports TextNode, ImageNode, TableNode, and other node types

Subtree Filtering:
* Specify node_ids to retrieve only certain sections/nodes
* Set include_children=True (default) to get full subtrees
* Set include_children=False to get only specified nodes
* Set include_ancestors=True to include parent context

Notes:
* Node type filtering is applied to all retrieved documents
* Object format preserves document structure and hierarchy
* Markdown format provides a flattened, readable text representation
* When node_ids is specified, returns filtered tree structure

## 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 content retrieval

- ContentResponse — Response containing full document content for filtered documents.
  - `data` ContentDocumentResponse[], required — List of documents with their full content
    - `artifact_id` string, required — Identifier of the document
    - `content` union, required — Full text content of the document
      - string
      - ContentTree — Structured representation of document content as a tree.
        - `id` string, required — Unique identifier of the node
        - `type` string, required — Type of the node (e.g., section, paragraph)
        - `content` string, required — Text content of the node
        - `children` ContentTree[] — Child nodes representing nested content structure

## Other responses

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

## Changes

- **2026-06-02** `c711b911f68e` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/zylon-ai/apis/private-gpt-api/changes/v1/artifacts/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)
