Skip to Content

Markdown

POST
/v1/markdown

Extracts Markdown from a document or web page, ready to pass to an LLM or index for retrieval. The format is detected from the content, and options.chunking adds structure-aware chunks sized for your embedding model, with the headings they sit under and their offsets in the Markdown.

The default options.readMode is auto: images, presentations, and PDF or Word documents whose text cannot be extracted, such as scans, are read page by page by the vision model configured on the server; everything else is extracted from the text stored in the file. Set ocr to read every page with the model, or text to never use it. options.readMode in the response is the mode used. Without a model on the server, auto extracts text only, so scans return little or nothing and images fail with 415 unsupported_format, as do corrupt and encrypted files. Legacy formats such as .doc and .ppt are converted with LibreOffice first and take longer.

Authorization

HTTPBearer
headerAuthorizationBearer <token>

Static API key from PAPYRUS_API_KEY

Request Body

  1. body
source*Source

file://, http(s):// URL or :///

destination?|

Connector URI to write the result to

Defaultnull
output?OutputMode

json returns the envelope with the artifact inline, file returns the artifact as the response body; with a destination the response is always the light JSON envelope

Default"json"
Value in"file""json"
options?

Operation options, omitted fields take their defaults

Response Body

The JSON envelope (light with a destination), or the op file for output=file

  1. response
source*

The input document

result*

The primary artifact

options*

The request options with defaults applied

chunks?array<>|

Present when options.chunking is set, omitted with a destination

{  "source": {    "uri": "https://axelered.com",    "name": "source.html",    "size": 94018,    "mimeType": "text/html",    "extension": "html",    "label": "html",    "group": "markup",    "title": "Axelered · Intelligent process automation",    "fetch": {      "url": "https://axelered.com",      "status": 200    }  },  "result": {    "name": "source.md",    "size": 6810,    "mimeType": "text/markdown",    "extension": "md",    "label": "markdown",    "group": "markup",    "encoding": "utf-8",    "content": "[Axelered](/)[01Platform](/platform)…\n\n# Automatethe process.\n\nWe automate your processes end to end and own the outcome after go-live.…"  },  "options": {    "readMode": "text"  }}