Document Convert API
Office / PDF / HTML
Formats Catalog
10 MB Cap

Office, PDF, HTML. One convert call.

Convert DOCX, XLSX, and PPTX to PDF, extract text or images from PDF, and export HTML to DOCX. Discover live pairs on GET /formats.

html→docx · always availablepdf→txt · local parseSSRF · private hosts blocked10 MB · decoded cap

See supported pairs, instantly.

This calls GET /formats on the live Document Convert API. Convert itself is file-heavy, so the playground lists the matrix instead of accepting uploads.

Request builder
No parameters. The catalog is the live example.
GET /formats
Why formats, not convert?
POST /convert takes base64 files or URLs. This demo stays on the formats catalog so no documents leave the browser.
Output preview
Live response from the API, plus the exact request to reproduce it.
LibreOffice: n/a

Loading conversion matrix...

Why Document Convert API

The pairs your workflows already have.

Live conversion matrix

GET /formats returns every pair with engine and availability so clients can hide gated options.

Office to PDF when available

DOCX, XLSX, and PPTX convert through a headless office engine, or return a clear 503 if it is missing.

PDF to text and images

Local PDF parsing extracts TXT or page images without LibreOffice. Images cap at 20 pages.

HTML to DOCX

Sanitized HTML becomes a DOCX buffer. Useful for notes and generated reports without an office install.

Base64 or public URL

Send exactly one of fileBase64 or fileUrl. Private and loopback hosts are rejected.

Hard size and time caps

Decoded files stop at 10 MB. Conversions time out at 60 seconds so a stuck office job cannot hang.

/api/v1/document-convert

Endpoints, at a glance.

GET /formats for the live matrix. POST /convert for office, PDF, and HTML pairs with a 10 MB decoded cap.
GET/api/v1/document-convert/formats

Formats catalog

Supported conversion pairs, engines, availability, and size limits.

PRIMARY
POST/api/v1/document-convert/convert

Convert a document

sourceFormat, targetFormat, and exactly one of fileBase64 or fileUrl.

ParameterTypeRequiredDescription
sourceFormatstringyesdocx, xlsx, pptx, pdf, or html.
targetFormatstringyespdf, docx, txt, or images.
fileBase64stringyes*Base64 file bytes. Exactly one of fileBase64 or fileUrl.
fileUrlstringyes*Public HTTP(S) URL. Private hosts are rejected.
filenamestringnoOriginal filename used to name the output.

Error reference

Failures you can plan for.

Errors include a machine-readable reason plus a correlationId.
400Validation Error

Invalid body, unsupported file magic, or a blocked fileUrl host.

401Authentication Error

Missing or invalid gateway API key. Send x-api-key or api_key with every request.

413Payload Too Large

Decoded file over 10 MB or body over 15 MB.

415Unsupported Media Type

Source and target pair is not in the conversion matrix.

503Service Unavailable

LibreOffice is not installed, so office conversion pairs are gated.

Example error response

{
  "success": false,
  "error": { "code": "VALIDATION_ERROR", "message": "Invalid request body" },
  "reason": "unsupported-pair",
  "correlationId": "1784849006651-doc01"
}

FAQ

API questions developers ask first.

Which conversion pairs are supported?

DOCX, XLSX, or PPTX to PDF; PDF to DOCX, TXT, or images; and HTML to DOCX. GET /formats returns each pair with engine and availability.

What happens if LibreOffice is not installed?

Office-to-PDF and PDF-to-DOCX return 503 with a clear unavailable reason. PDF-to-text, PDF-to-images, and HTML-to-DOCX continue to work.

Can I pass a URL instead of base64?

Yes. Send exactly one of fileBase64 or fileUrl. URL fetches follow a bounded redirect chain and reject private or loopback hosts.

What is the file size limit?

Decoded files are capped at 10 MB. Oversized payloads return 413. PDF-to-images is capped at 20 pages.

How do I authenticate requests?

Send your Datpaq API key as an x-api-key header or an api_key query parameter. Keys are created in the Datpaq dashboard and a free tier is included.

Convert documents in one request.

Office, PDF, HTML, and image pairs with a formats catalog you can query before you convert.