Upload-documentDEEPL_MCP_UPLOAD_DOCUMENT
Translate a whole file or document, preserving its original layout and formatting. Use this — not translate-text — whenever the user wants to translate a file or document (rather than text typed into the conversation), even if its contents are already visible to you; translate-text would strip the formatting. For plain text pasted into the conversation, use translate-text instead. Supported file extensions in this deployment: .docx, .doc, .pptx, .ppt, .xlsx, .xls, .pdf, .htm, .html, .txt, .xlf, .xliff, .srt, .png, .jpg, .jpeg. PNG and JPEG files are limited to 3 MB; limits for other formats depend on the user's plan. Always start a document translation with this call, and pass 'filename' with the file's extension. It reserves a short-lived upload session and returns 'sessionId' and 'uploadUrl'; it does not upload the file itself, and nothing is translated or billed until the file arrives. If the call had no 'filename', first call upload-document again with it. Then do exactly one of the following: 1. Upload the source file bytes: HTTP PUT the raw bytes to 'uploadUrl' with 'Content-Type: application/octet-stream'. 2. If you cannot access or transfer the file bytes, immediately call upload-document-show-fallback-widget with the returned 'sessionId'; it shows the user an upload widget where they select the file. Being unable to upload the bytes directly is an expected, recoverable condition: the next step is then to call upload-document-show-fallback-widget. Pass all target languages in one call rather than one call per language: the file is then uploaded only once. Each language is translated and billed separately once the file arrives. A language DeepL refuses is listed in 'failures' while the others still translate. An administrator may assign a language system (style profile) to the account, whose glossaries and style rule set can replace the glossaryId and styleId passed here; 'appliedCustomizations' on a target says so when it happened, per target language.