Skip to main content

Convert a file

POST/api/file

Converts an uploaded file. Send the raw bytes as the request body with Content-Type set to the file's type. PullMD reads the raw body and doesn't decode multipart forms.

PDF, Word, PowerPoint, Excel, EPUB and ZIP files need the MarkItDown sidecar. PullMD reads e-mail, saved pages, text, subtitles, OpenDocument, RTF, calendars, contacts, data files, feeds, notebooks and source code itself; see Documents. Images and audio go to a vision or speech-to-text provider when one is configured, and to the MarkItDown sidecar otherwise. Without MARKITDOWN_URL, that request fails with 502. Nothing is cached: no history entry and no share link.

Authorizations

Authorizationstringheader

Needed only when the instance has sign-in enabled (PULLMD_AUTH_MODE is single-admin or multi-user). Send Bearer pmd_<key> with an API key created at /settings. In single-admin mode, the legacy PULLMD_AUTH_TOKEN is also accepted as a bearer token. OAuth access tokens work only on /mcp. Browser sessions use the pullmd_session cookie instead.

Query parameters

filenamestring

Original file name. Prefer the X-Filename header, which stays out of proxy access logs.

formatstring

md returns Markdown, text strips the Markdown syntax, json returns the Markdown and its metadata in a JSON object.

Default: "md"Available options: mdtextjson
frontmatterboolean

Prepend a YAML block with the title, source URL, extractor, quality and other metadata. See Output format.

Default: false
pdfstring

ocr sends PDFs to the OCR provider configured with PULLMD_PDF_OCR_API_KEY, which keeps tables intact. Without a provider, PullMD uses the standard conversion. Setting it bypasses the cache.

Available options: ocr
langstring

Language of the labels PullMD writes into e-mail, calendar, contact, notebook, data file and OpenDocument output. en gives English, and any other value gives German.

Default: "de"Available options: deen
client_modestring

Which client to record for the request, in the history entry when the result is cached, and in the stats log. pwa records pwa. Any other value, or none, records the client detected from the User-Agent header (claude, browser or api). The X-Client-Mode header takes precedence over this parameter.

Available options: pwa

Headers

X-Filenamestring

Original file name, URI-encoded. Used for the suggested download name and to help detect the file type.

Example: report.pdf
X-Client-Modestring

Same as client_mode. Takes precedence over the query parameter.

Available options: pwa

Body

application/pdf

The file's raw bytes, up to 25 MB. PullMD accepts any Content-Type, and X-Filename or filename helps it detect the file type.

string<binary>string<binary>

Response

200 · text/markdown, text/plain, application/json

The file as Markdown.

With format=json, the response is this JSON object.

markdownstring

The converted Markdown, including the frontmatter block when frontmatter=true.

metadataobject

Page metadata found during extraction. A field the source doesn't have is null. contentLength and extractorReason appear for pages extracted by Readability, Trafilatura or Playwright and for POST /api/html. Uploads and YouTube, image, audio, PDF OCR and MarkItDown results have contentLength without extractorReason, and Reddit, Hacker News and Cloudflare Markdown results have neither. A cached Reddit or Hacker News result has a shorter object with the fields it stores.

sourcestring

Which extractor produced the result. Same values as the X-Source header.

shareIdstring

Share id, or null when the result was not cached.

extractobject

Present only when query is set.

Response headers

X-Sourcestring

Which extractor produced the result: cloudflare, readability, readability-fallback, trafilatura, playwright, recipe-content, coverage-guard, markitdown, youtube, reddit, hackernews, image-caption, audio-transcript, pdf-ocr, article-series, or for uploads PullMD reads itself email, text, markdown, subtitles, opendocument, rtf, calendar, contact, data, feed, notebook or code.

X-Qualitynumber

Extraction confidence from 0.0 to 1.0.

X-Suggested-Filenamestring

A download file name for the result, such as YT-some-talk-dQw4w9WgXcQ.md.