---
title: "Convert File to Markdown or Tree"
method: POST
path: "/v1/artifacts/convert"
tags: ["Artifacts"]
---

# Convert File to Markdown or Tree

`POST /v1/artifacts/convert`

Parse a file using the document readers and return its content as markdown text or a structured content tree, without ingesting it into the knowledge base.

## Request body

- ConvertBody — ConvertBody schema.
  - `input` union, required — File content as base64, remote URI, or plain text
    - FileArtifact — Input for base64 encoded files.
      - `type` 'file' — Input type discriminator
      - `value` string, required — Base64 encoded file content
    - UriArtifact — Input for remote URIs.
      - `type` 'uri' — Input type discriminator
      - `value` string, required — URI to download from
    - TextArtifact — Input for plain text content.
      - `type` 'text' — Input type discriminator
      - `value` string, required — Plain text content
  - `metadata` object, nullable — Optional metadata, must include 'file_name' to resolve file extension
  - `reader` string, nullable — Reader to use for parsing. If omitted the default reader for the file type is used.
  - `format` 'object' | 'markdown' — Enumeration of content retrieval formats.

## Response `200`

Successful conversion

- ConvertResponse — ConvertResponse schema.
  - `content` union, required — Parsed file content in the requested format
    - 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
  - `reader` string, required — Reader that was used to parse the file

## Other responses

- `401` — Unauthorized
- `422` — Validation Error

## Changes

- **2026-07-06** `594fa71dfb90` — 1 info
  - endpoint added

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