Prerequisites
- A DeepL API account and your API key from your account settings. New to the API? Start with the Translate Text Quickstart, which covers signup in more detail.
curlinstalled on your machine- A document to translate. The examples use a Word file named
order-confirmation.docx; any supported format works.
Building with an AI coding agent?
Wire it up to the DeepL Docs MCP Server so it can search and read this documentation while it writes code. In Claude Code:Step 1: Upload the document
Document translation runs asynchronously, so the flow has three calls: upload the file, check the status, and download the result. Start by uploading the file asmultipart/form-data with a target_lang:
Sample request
Sample response
document_id identifies the translation, and the document_key authorizes the status and download calls in the next steps.
As with text translation, the source language is detected automatically, or you can pin it with an optional source_lang form field.
Step 2: Poll the translation status
Check the status by sending thedocument_key to the /v2/document/{document_id} endpoint:
Sample request
status field is queued or translating:
Sample response: still translating
done. Small documents typically finish in seconds; larger ones can take a minute or two. Treat seconds_remaining as a rough estimate only.
Sample response: done
error comes with a message field explaining what went wrong, for example when the source and target language are the same.
Step 3: Download the translated file
Once the status isdone, download the result from the /result endpoint and save it to a file:
Sample request
order-confirmation-de.docx and you’ll find the German translation with the original layout intact.
For privacy reasons, the document is removed from DeepL’s servers once you download it, so it can’t be downloaded twice. To translate the same file again, start over from step 1. Download promptly: leaving too many finished translations unretrieved can cause new upload requests to fail with HTTP 429.
Or: one call with a client library
The official client libraries wrap all three steps, upload, polling, and download, in a single method call:- Python
- JavaScript
Sample request
Next steps
You’ve now run the complete document translation flow. To keep going:- Read the document translation guide for format-specific behavior (XML, XLIFF, JSON, IDML) and error handling
- Convert formats on the way through, like PDF in and editable Word out, with the
output_formatparameter in the/documentreference - Enforce your terminology with glossaries
- Check the upload size limits per format before going to production