Upload and Translate a Document Run in API Explorer

Add MCP server to your AI tool

Allow AI tools and LLMs to interact with the API documentation portal through MCP.

MCP server URL

https://bump.sh/polo/hub/about-mcp/doc/deepl/mcp

Standard setup for AI tools providing an mcp.json file

mcp.json
{
  "Deepl MCP server": {
    "url": "https://bump.sh/polo/hub/about-mcp/doc/deepl/mcp"
  }
}

Close
POST /v2/document

This call uploads a document and queues it for translation. The call returns once the upload is complete, returning a document ID and key which can be used to query the translation status and to download the translated document once translation is complete.

Because the request includes a file upload, it must be an HTTP POST request with content type multipart/form-data.

Please be aware that the uploaded document is automatically removed from the server once the translated document has been downloaded. You have to upload the document again in order to restart the translation.

The maximum upload limit for documents is available here and may vary based on API plan and document type.

You may specify the glossary to use for the document translation using the glossary_id parameter. Important: This requires the source_lang parameter to be set and the language pair of the glossary has to match the language pair of the request.

multipart/form-data

Body Required

  • source_lang string

    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.

    Note: Some languages only work with model_type set to quality_optimized. See supported languages for more details.

    Values are ACE, AF, AN, AR, AS, AY, AZ, BA, BE, BG, BHO, BN, BR, BS, CA, CEB, CKB, CS, CY, DA, DE, EL, EN, EO, ES, ET, EU, FA, FI, FR, GA, GL, GN, GOM, GU, HA, HE, HI, HR, HT, HU, HY, ID, IG, IS, IT, JA, JV, KA, KK, KMR, KO, KY, LA, LB, LMO, LN, LT, LV, MAI, MG, MI, MK, ML, MN, MR, MS, MT, MY, NB, NE, NL, OC, OM, PA, PAG, PAM, PL, PRS, PS, PT, QU, RO, RU, SA, SCN, SK, SL, SQ, SR, ST, SU, SV, SW, TA, TE, TG, TH, TK, TL, TN, TR, TS, TT, UK, UR, UZ, VI, WO, XH, YI, YUE, ZH, or ZU.

  • target_lang string Required

    The language into which the text should be translated.

    Note: Some languages only work with model_type set to quality_optimized. See supported languages for more details.

    Values are ACE, AF, AN, AR, AS, AY, AZ, BA, BE, BG, BHO, BN, BR, BS, CA, CEB, CKB, CS, CY, DA, DE, EL, EN, EN-GB, EN-US, EO, ES, ES-419, ET, EU, FA, FI, FR, GA, GL, GN, GOM, GU, HA, HE, HI, HR, HT, HU, HY, ID, IG, IS, IT, JA, JV, KA, KK, KMR, KO, KY, LA, LB, LMO, LN, LT, LV, MAI, MG, MI, MK, ML, MN, MR, MS, MT, MY, NB, NE, NL, OC, OM, PA, PAG, PAM, PL, PRS, PS, PT, PT-BR, PT-PT, QU, RO, RU, SA, SCN, SK, SL, SQ, SR, ST, SU, SV, SW, TA, TE, TG, TH, TK, TL, TN, TR, TS, TT, UK, UR, UZ, VI, WO, XH, YI, YUE, ZH, ZH-HANS, ZH-HANT, or ZU.

  • file string(binary) Required

    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 Document
    • pptx - Microsoft PowerPoint Document
    • xlsx - Microsoft Excel Document
    • pdf - Portable Document Format
    • htm / html - HTML Document
    • txt - Plain Text Document
    • xlf / xliff - XLIFF Document, version 2.1
    • srt - SRT Document
    • jpeg / jpg / png - Image
  • filename string

    The name of the uploaded file. Can be used as an alternative to including the file name in the file part's content disposition.

  • output_format string

    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.

    Note: Not all combinations of input file and translation file extensions are permitted. See Document Format Conversions for the permitted combinations.

  • formality string

    Sets whether the translated text should lean towards formal or informal language. This feature currently only works for target languages DE (German), FR (French), IT (Italian), ES (Spanish), ES-419 (Latin American Spanish), NL (Dutch), PL (Polish), PT-BR and PT-PT (Portuguese), JA (Japanese), and RU (Russian). Learn more about the plain/polite feature for Japanese here. 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 language
    • less - for a more informal language
    • prefer_more - for a more formal language if available, otherwise fallback to default formality
    • prefer_less - for a more informal language if available, otherwise fallback to default formality

    Values are default, more, less, prefer_more, or prefer_less. Default value is default.

  • glossary_id string

    A unique ID assigned to a glossary.

Responses

  • 200 application/json

    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.

    Hide headers attribute Show headers attribute
    • X-Trace-ID

      A unique identifier for the request that can be included in bug reports to DeepL support.

    Hide response attributes Show response attributes object
    • document_id string

      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.

    • document_key string

      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.

  • 400

    Bad request. Please check error message and your parameters.

    Hide headers attribute Show headers attribute
    • X-Trace-ID

      A unique identifier for the request that can be included in bug reports to DeepL support.

  • 403

    Authorization failed. Please supply a valid DeepL-Auth-Key via the Authorization header.

    Hide headers attribute Show headers attribute
    • X-Trace-ID

      A unique identifier for the request that can be included in bug reports to DeepL support.

  • 404

    The requested resource could not be found.

    Hide headers attribute Show headers attribute
    • X-Trace-ID

      A unique identifier for the request that can be included in bug reports to DeepL support.

  • 413

    The request size exceeds the limit.

    Hide headers attribute Show headers attribute
    • X-Trace-ID

      A unique identifier for the request that can be included in bug reports to DeepL support.

  • 429

    Too many requests. Please wait and resend your request.

    Hide headers attribute Show headers attribute
    • X-Trace-ID

      A unique identifier for the request that can be included in bug reports to DeepL support.

  • 456

    Quota exceeded. The character limit has been reached.

    Hide headers attribute Show headers attribute
    • X-Trace-ID

      A unique identifier for the request that can be included in bug reports to DeepL support.

  • 500

    Internal error.

    Hide headers attribute Show headers attribute
    • X-Trace-ID

      A unique identifier for the request that can be included in bug reports to DeepL support.

  • 504

    Resource currently unavailable. Try again later.

    Hide headers attribute Show headers attribute
    • X-Trace-ID

      A unique identifier for the request that can be included in bug reports to DeepL support.

  • 529

    Too many requests. Please wait and resend your request.

    Hide headers attribute Show headers attribute
    • X-Trace-ID

      A unique identifier for the request that can be included in bug reports to DeepL support.

POST /v2/document
curl \
 --request POST 'https://api.deepl.com/v2/document' \
 --header "Authorization: $API_KEY" \
 --header "Content-Type: multipart/form-data" \
 --form "target_lang=DE" \
 --form "file=@document.docx"
Request examples
{"target_lang" => "DE", "file" => "@document.docx"}
{"source_lang" => "EN", "target_lang" => "DE", "file" => "@document.docx", "glossary_id" => "[yourGlossaryId]"}
Response examples (200)
{
  "document_id": "04DE5AD98A02647D83285A36021911C6",
  "document_key": "0CB0054F1C132C1625B392EADDA41CB754A742822F6877173029A6C487E7F60A"
}