# Text Translation

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

POST `/v2/translate/text`

**Authorization**

*OAuth2PasswordBearer*

```
Authorization: OAuth2PasswordBearer
```

### Body form-data

| KEY                                  | TYPE     | VALUE                                                                                                         |
| ------------------------------------ | -------- | ------------------------------------------------------------------------------------------------------------- |
| text                                 | String   | Text to be translated                                                                                         |
| 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 | Defines the styling mode for the translation output                                                           |
| translate\_type                      | String   | <p>Translate type to be used<br>"Paraphrase", "Professional".</p>                                             |
| tone                                 | String   | New tone of the translation, if applicable                                                                    |
| domain                               | String   | The new 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\_\_font\_size | String   | Optional custom font size 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. |
| custom\_prompt                       | String   | Custom prompt to be used for the translation                                                                  |

**Response**

**200:** Success

Response schema: *application/json*

<table><thead><tr><th width="316">KEY</th><th width="498">VALUE</th><th></th></tr></thead><tbody><tr><td>status_code</td><td>200</td><td></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><td></td></tr><tr><td></td><td></td><td></td></tr></tbody></table>

**400:** Bad Request\
Response schema: *application/json*

<table><thead><tr><th width="245">KEY</th><th width="377">VALUE</th><th></th></tr></thead><tbody><tr><td>status_code</td><td>400</td><td></td></tr><tr><td>content</td><td>{ "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" }</td><td></td></tr><tr><td></td><td></td><td></td></tr></tbody></table>

**401: A**uthentication Error

Response schema: *application/json*

<table><thead><tr><th width="286">KEY</th><th width="524">VALUE</th><th></th></tr></thead><tbody><tr><td>status_code</td><td>401</td><td></td></tr><tr><td>content</td><td>{ "detail": "Not authenticated" }</td><td></td></tr><tr><td></td><td></td><td></td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developer.doctranslate.io/document-translation-api/translation-api/api-v2/text-translation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
