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.
Convert DOCX, XLSX, and PPTX to PDF, extract text or images from PDF, and export HTML to DOCX. Discover live pairs on GET /formats.
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.
Loading conversion matrix...
Why Document Convert API
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
Formats catalog
Supported conversion pairs, engines, availability, and size limits.
Convert a document
sourceFormat, targetFormat, and exactly one of fileBase64 or fileUrl.
| Parameter | Type | Required | Description |
|---|---|---|---|
| sourceFormat | string | yes | docx, xlsx, pptx, pdf, or html. |
| targetFormat | string | yes | pdf, docx, txt, or images. |
| fileBase64 | string | yes* | Base64 file bytes. Exactly one of fileBase64 or fileUrl. |
| fileUrl | string | yes* | Public HTTP(S) URL. Private hosts are rejected. |
| filename | string | no | Original filename used to name the output. |
Error reference
Invalid body, unsupported file magic, or a blocked fileUrl host.
Missing or invalid gateway API key. Send x-api-key or api_key with every request.
Decoded file over 10 MB or body over 15 MB.
Source and target pair is not in the conversion matrix.
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
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.
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.
Yes. Send exactly one of fileBase64 or fileUrl. URL fetches follow a bounded redirect chain and reject private or loopback hosts.
Decoded files are capped at 10 MB. Oversized payloads return 413. PDF-to-images is capped at 20 pages.
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.
Office, PDF, HTML, and image pairs with a formats catalog you can query before you convert.