> 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/upload-api.md).

# Upload API

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

POST `/v1/translate/document`

**Authorization**

*OAuth2PasswordBearer*

```
Authorization: OAuth2PasswordBearer
```

**Body form-data Parameter**

| 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'.                                              |
| style\_mode                     | Interger | Specifies the styling preference for the translation output. Influences formatting and presentation.         |
| translate\_type                 | String   | Specifies the translation engine or version to be used.                                                      |
| 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   | Optional custom font to be used for the translation, specifying word-level translations.                     |
| bilingual\_text\_style\_\_color | String   | Optional custom color to be used for the translation, specifying word-level translations.                    |
| dictionary                      | String   | Optional custom dictionary in JSON format to be used for the translation, specifying word-level translations |

**Response**

**200:** Success

Response schema: *application/json*

<table><thead><tr><th width="461">KEY</th><th>VALUE</th></tr></thead><tbody><tr><td>status_code</td><td>200</td></tr><tr><td>content</td><td>{ "data": { "task_id": "81812b70082840039e6a4baedd70e985" }, "errors": [], "error_description": "", "start_time": "yyyy-mm-dd hh-mm-ss utc+7", "end_time": "yyyy-mm-dd hh-mm-ss utc+7" }</td></tr><tr><td></td><td></td></tr></tbody></table>

**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: Authencation** Error

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

Response schema: *application/json*

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