curl --request POST \
--url https://api.deepl.com/v2/document \
--header 'Authorization: <api-key>' \
--header 'Content-Type: multipart/form-data' \
--form target_lang=DE \
--form file='@example-file'{
"document_id": "04DE5AD98A02647D83285A36021911C6",
"document_key": "0CB0054F1C132C1625B392EADDA41CB754A742822F6877173029A6C487E7F60A"
}{
"message": "<string>",
"code": "invalid_content_type"
}{
"message": "<string>",
"code": "invalid_content_type"
}{
"message": "<string>",
"code": "invalid_content_type"
}{
"message": "<string>",
"code": "invalid_content_type"
}{
"message": "<string>",
"code": "invalid_content_type"
}{
"message": "<string>",
"code": "invalid_content_type"
}{
"message": "<string>",
"code": "invalid_content_type"
}{
"message": "<string>",
"code": "invalid_content_type"
}{
"message": "<string>",
"code": "invalid_content_type"
}Upload and translate a document
Upload a document for translation and receive the document ID and key needed to check status and download the result.
curl --request POST \
--url https://api.deepl.com/v2/document \
--header 'Authorization: <api-key>' \
--header 'Content-Type: multipart/form-data' \
--form target_lang=DE \
--form file='@example-file'{
"document_id": "04DE5AD98A02647D83285A36021911C6",
"document_key": "0CB0054F1C132C1625B392EADDA41CB754A742822F6877173029A6C487E7F60A"
}{
"message": "<string>",
"code": "invalid_content_type"
}{
"message": "<string>",
"code": "invalid_content_type"
}{
"message": "<string>",
"code": "invalid_content_type"
}{
"message": "<string>",
"code": "invalid_content_type"
}{
"message": "<string>",
"code": "invalid_content_type"
}{
"message": "<string>",
"code": "invalid_content_type"
}{
"message": "<string>",
"code": "invalid_content_type"
}{
"message": "<string>",
"code": "invalid_content_type"
}{
"message": "<string>",
"code": "invalid_content_type"
}Authorizations
Authentication with Authorization header and DeepL-Auth-Key authentication scheme. Example: DeepL-Auth-Key <api-key>
Body
The language into which the text should be translated.
For the full list of supported target languages, see supported languages or query the GET /v3/languages endpoint.
"DE"
The document file to be translated. The file name should be included in this part's content disposition. As an alternative, the filename parameter can be used. The following file types and extensions are supported:
docx- Microsoft Word Documentpptx- Microsoft PowerPoint Documentxlsx- Microsoft Excel Documentxlsm- Microsoft Excel Macro-Enabled Workbook (currently in beta)pdf- Portable Document Formathtm / html- HTML Documenttxt- Plain Text Documentxlf / xliff- XLIFF Document (versions 1.2, 2.0, and 2.1)srt- SRT Documentvtt- WebVTT Subtitle Document (currently in beta)idml- Adobe InDesign Markup Languagexml- XML Documentjson- JSON Documentyaml / yml- YAML Document (currently in beta)properties- Java Properties Document (currently in beta)strings- iOS/macOS Strings Document (currently in beta)md / markdown- Markdown Document (currently in beta)dita- DITA topic (Darwin Information Typing Architecture)mif- Adobe FrameMaker Interchange Formatzip- SCORM Package (e-learning content, currently in beta)odt- OpenDocument Text Document (currently in beta)rtf- Rich Text Format Document (currently in beta)resx- .NET Resource Document (currently in beta)jpeg/jpg/png- Image (currently in beta)
Language of the text to be translated. If this parameter is omitted, the API will attempt to detect the language of the text and translate it.
For the full list of supported source languages, see supported languages or query the GET /v3/languages endpoint.
"EN"
The name of the uploaded file. Can be used as an alternative to including the file name in the file part's content disposition.
File extension of desired format of translated file, for example: docx. If unspecified, by default the translated file will be in the same format as the input file.
Comma-separated list of key:value conversion options, prefixed with a version, that control how the input document is converted before translation. For example: version:1,suppress-image-types:all.
Supported keys:
suppress-image-types- Leaves the specified types of images embedded in the document untranslated. The value is a hyphen-separated list of image content types (for examplelogo-photosuppresses logos and photos), orallto suppress every embedded image. Recognized image content types:logo,icon,decorative,barcode,formula,signature,handwriting,stamp,screenshot,diagram,chart,photo,illustration,comic,music,infographic,table,text,other,unknown. Onlypptxdocuments support this key.json-placeholders- Controls how brace-delimited placeholders injsonstring values are handled.protect(the default) keeps identifier-shaped placeholders such as{stars}or{{userName}}verbatim so they are not translated;translatetranslates them along with the surrounding text. ICU MessageFormat skeletons such as{count, plural, one {# item} other {# items}}are always protected, with only the branch text translated, in both modes. Multi-word groups such as{see note}are treated as translatable text in both modes.
For other file types this parameter is ignored. Unrecognized keys are ignored.
"version:1,suppress-image-types:all"
Sets whether the translated text should lean towards formal or informal language.
This feature is only available for certain target languages. Setting this parameter
with a target language that does not support formality will fail, unless one of the
prefer_... options are used.
Possible options are:
default(default)more- for a more formal languageless- for a more informal languageprefer_more- for a more formal language if available, otherwise fallback to default formalityprefer_less- for a more informal language if available, otherwise fallback to default formality
default, more, less, prefer_more, prefer_less "prefer_more"
A unique ID assigned to a glossary. To check glossary support for a language pair, call GET /v3/languages?resource=translate_document and verify the glossary feature key is present on both the source and target language.
Cannot be used together with glossary_ids.
"def3a26b-3e84-45b3-84ae-0c0aaf3525f7"
Comma-separated list of up to 5 glossary IDs to use for the translation. Each glossary's matching terms are applied to the translated document. May also be sent as a repeated parameter.
Important: This requires the source_lang parameter to be set. Every listed glossary must contain a dictionary for the requested language pair.
Cannot be used together with glossary_id.
5Specify the style rule list to use for the translation.
Important: The target language has to match the language of the style rule list. A list
created for a root language (for example en) applies to that language and all of its variants
(EN-GB, EN-US). A list created for a variant (for example en-GB) applies only when
target_lang is that variant.
"7ff9bfd6-cd85-4190-8503-d6215a321519"
A unique ID assigned to a translation memory.
"a74d88fb-ed2a-4943-a664-a4512398b994"
The minimum matching percentage required for a translation memory segment to be applied (recommended to be 75% or higher). A value below 50 is treated as 50.
0 <= x <= 10075
When true, adds a "Translated by DeepL" watermark to the translated document.
Only supported for docx and pdf output. For all other output formats the parameter is ignored and the document is returned without a watermark.
(beta) When true, DeepL also evaluates the finished translation and returns a quality_evaluation_job_id. Poll GET /v1/quality-evaluations/{job_id} with it for a per-segment report of translation issues. The translation itself is unaffected.
Important: Available to select customers; contact your customer success manager to enable it. Supported for docx, pptx, pdf, srt, idml, xml, dita, mif, and XLIFF 2.1 uploads, and for the supported language pairs only.
Rejected before the upload is accepted: 403 if quality evaluation is not enabled for the account, 400 for an ineligible file type, an unsupported language pair, or a value other than true or false.
This parameter is maintained for backward compatibility and has no effect.
Response
The document function returns a JSON object containing the ID and encryption key assigned to the uploaded document. Once received by the server, uploaded documents are immediately encrypted using a uniquely generated encryption key. This key is not persistently stored on the server. Therefore, it must be stored by the client and sent back to the server with every subsequent request that refers to this particular document.
A unique ID assigned to the uploaded document and the translation process. Must be used when referring to this particular document in subsequent API requests.
"04DE5AD98A02647D83285A36021911C6"
A unique key that is used to encrypt the uploaded document as well as the resulting translation on the server side. Must be provided with every subsequent API request regarding this particular document.
"0CB0054F1C132C1625B392EADDA41CB754A742822F6877173029A6C487E7F60A"
(beta) A unique ID assigned to the quality evaluation. Returned only when the request set enable_quality_evaluation=true. Use it to retrieve the report from GET /v1/quality-evaluations/{job_id}.
"04DE5AD98A02647D83285A36021911C6"