> For the complete documentation index, see [llms.txt](https://developer.doctranslate.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.doctranslate.io/document-translation-api/translation-api/api-v3/document-translation.md).

# Document Translation

#### HTTP request <a href="#http-request" id="http-request"></a>

POST `/v3/translate/document`

**Authorization(***Bearer token or API key)*

*OAuth2PasswordBearer*

```
Authorization: OAuth2PasswordBearer
```

Header API Key

```
X-API-Key: <your_api_key>
```

**Request Body schema: multipart/form-data**

| KEY                             | TYPE     | VALUE                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ------------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| file                            | File     | Upload the document to be translated. Supported formats include `DOCX, PDF, PPTX, and XLSX.`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| file\_type                      | String   | The type of the file being translated. Supported formats include `DOCX, PDF, PPTX, and XLSX`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| original\_lang                  | String   | The original language of the content. Optional but recommended for better accuracy.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| dest\_lang                      | String   | The target language for translation.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| process\_mode                   | String   | Describes how the file should be processed 'replace', 'append', 'append\_reverse' .                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| style\_mode                     | Interger | <p>Default: 0</p><p>Specifies the styling preference for the translation output. Influences formatting and presentation.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| translate\_type                 | String   | <p>Specifies the translation engine or version to be used.<br><code>Paraphrase</code>, <code>Professional</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| is\_translate\_images           | Bool     | Flag indicating whether images within the document should also be translated.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| tone                            | String   | Tone of the translation, if applicable                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| domain                          | String   | The domain or field of the content, which can help in choosing specialized translation models.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| bilingual\_text\_style\_\_font  | String   | Used to set the font for the bilingual translation mode and when process\_mode=append                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| bilingual\_text\_style\_\_color | String   | Used to set the color for the bilingual translation mode and when process\_mode=append                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| dictionary                      | String   | Optional custom dictionary in JSON format to be used for the translation, specifying word-level translations.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| custom\_prompt                  | String   | Custom prompt to be used for the translation                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| output\_format                  | String   | <p></p><h4>1. <strong>Scanned PDFs</strong></h4><p>These are image-based PDFs, typically from printed or photographed documents.</p><ul><li><strong>auto</strong>: Automatically selects the best format for readability. The translated text will follow the original content as closely as possible, but layout may vary.</li><li><strong>docx</strong>: Text is extracted and translated with a focus on preserving the original wording. Layout and formatting may not be retained.</li><li><strong>pptx</strong>: Not recommended unless the scanned file has a visual structure that benefits from slide-based formatting.</li></ul><h4>2. <strong>Regular PDFs</strong></h4><p>These contain selectable digital text and may include structured layouts or design elements.</p><ul><li><strong>auto</strong>: Automatically chooses between DOCX and PPTX to best preserve the original layout and formatting.</li><li><strong>docx</strong>: Suitable for text-based documents. May simplify layout while keeping the content intact.</li><li><strong>pptx</strong>: Best for visually rich documents (e.g., presentations, flyers). Maintains layout, formatting, and visual fidelity.</li></ul> |

**Response**

**200:** Success

Response schema: *application/json*

| KEY          | VALUE                                                                                                                                                                                                                |
| ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| status\_code | 200                                                                                                                                                                                                                  |
| content      | { "data": { "task\_id": "0d05c89e6f2c472ab86b291516e8e466" }, "errors": \[], "error\_description": "", "start\_time": "2024-03-11 13:05:42.080757", "end\_time": "2024-03-11 13:05:42.348086", "status": "success" } |

**400:** Bad Request

| KEY          | VALUE                                                                                                                                                                                                   |   |
| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | - |
| status\_code | 400                                                                                                                                                                                                     |   |
| content      | { "data": {}, "errors": \[ "Error" ], "error\_description": "Error while sending message. Please check server!", "start\_time": "yyyy-mm-dd hh-mm-ss utc+7", "end\_time": "yyyy-mm-dd hh-mm-ss utc+7" } |   |
|              |                                                                                                                                                                                                         |   |

**401: A**uthentication Error

| KEY          | VALUE                             |   |
| ------------ | --------------------------------- | - |
| status\_code | 401                               |   |
| content      | { "detail": "Not authenticated" } |   |
|              |                                   |   |

Response schema: *application/json*

| detail |   |
| ------ | - |
