Skip to content
Webfold Docs
Esc
↑↓navigate↵open⌘Jpreview

Convert a document to Markdown

Convert a base64-encoded DOCX, XLSX, PPTX, ODF, EPUB, RTF, CSV, HTML or text file to Markdown with the Webfold document engine. The file travels in the request; the server never fetches a URL for this endpoint. Up to 25 MiB decoded. Metered as documents.convert. Set format or send a filename with a supported extension.

POST/v1/documents/convert
Authorization
AuthorizationBearer token (JWT) · headerrequired

Bearer API key issued for your account. Send Authorization: Bearer <key>.

Request body
requiredapplication/json
content_base64stringrequired

The file, base64 (standard alphabet). Up to 25 MiB decoded.

filenamestring

Used to infer the format from its extension.

formatstring

Overrides the extension in filename.

Allowed:docxdocmpptxxlsxxlsmxlsbxlsodtodpodsepubrtfcsvhtmlhtmtxtmdmarkdown
Responses
200

The document as Markdown

formatstringrequired
bytesintegerrequired
charactersintegerrequired
markdownstringrequired
400

Bad request

string
401

Missing or invalid bearer token

string
403

Billing or plan entitlement blocked the request

string
Try it
Server
Authorization
Bodyapplication/json
Request
curl -X POST 'https://api.webfold.ai/v1/documents/convert' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "content_base64": "string",
  "filename": "report.docx",
  "format": "docx"
}'
Response
{
  "format": "string",
  "bytes": 0,
  "characters": 0,
  "markdown": "string"
}