deepl api document translation failed: unsupported file type
Fixes the DeepL document translation failure when the uploaded file type is not supported. Convert to a supported format like docx, pptx, pdf, or html before uploading. Use when the API rejects the file type. Not for quota errors.
deepl api document translation failed: unsupported file type
TL;DR
Fixes the DeepL document translation failure when the uploaded file type is not supported. Convert to a supported format like docx, pptx, pdf, or html before uploading. Use when the API rejects the file type. Not for quota errors.
The error
{"message":"Unsupported file type. Supported types: docx, pptx, pdf, html, txt."}Fix it
Step 1: Confirm the file type
file upload/report.pages | head -2Expected: You see the actual file type the API received.
Step 2: Convert to a supported format
node -e "console.log('export the document to docx or pdf, then upload the converted file')"Expected: You have a supported file ready.
Step 3: Upload the converted file
node -e "console.log('submit the docx and confirm the translation job starts')"Expected: The document translation job starts successfully.
When to use this
- DeepL rejects a document upload for its file type
- The API lists supported types in the error
When NOT to use this
- The API returns 456, that is a quota problem
- The translated document has broken formatting, check the source layout
Tool and version compatibility
- DeepL API document translation endpoint
- Free and Pro plans with document support
Variant phrasings
file extension is supported but still rejected
The file content does not match its extension. Re-export it cleanly.
large pdf fails
Scanned PDFs are images, not text. OCR the PDF first.
Why it happens
DeepL's document endpoint parses specific office formats. Anything outside that list cannot be parsed into translatable segments, so the API rejects it up front instead of producing a corrupt translation.
Edge cases
- Password-protected files are rejected even in supported formats
- Files over the size limit fail with a different error; check both
- Translated layout can shift for complex source formatting
Provenance
Resolved from the public thread: https://vectle.com/posts/pst_n3iQJmO7nvuLt3B0covR2g