---
title: "Translate Text"
method: POST
path: "/translate"
---

# Translate Text

`POST /translate`

Translate Text

## Query parameters

- `to` string[], required
- `from` string
- `textType` 'Plain' | 'Html'
- `category` string
- `profanityAction` 'NoAction' | 'Marked' | 'Deleted'
- `profanityMarker` 'Asterisk' | 'Tag'
- `includeAlignment` boolean
- `includeSentenceLength` boolean
- `suggestedFrom` string
- `fromScript` string
- `toScript` string
- `allowFallback` boolean
- `api-version` string, required

## Headers

- `X-ClientTraceId` string

## Request body

- InputTextItem[]
  - `text` string, required — Text to translate.

## Response `200`

Response for the translation API.

- TranslatedTextItem[]
  - `detectedLanguage` DetectedLanguage — An object describing the detected language.
    - `language` string, required — A string representing the code of the detected language.
    - `score` number, float, required — A float value indicating the confidence in the result. The score is between zero and one and a low score indicates a low confidence.
  - `translations` TranslationText[], required — An array of translation results. The size of the array matches the number of target languages specified through the to query parameter.
    - `to` string, required — A string representing the language code of the target language.
    - `text` string, required — A string giving the translated text.
    - `transliteration` TransliteratedText — Transliterated text element.
      - `text` string, required — A string which is the result of converting the input string to the output script.
      - `script` string, required — A string specifying the script used in the output.
    - `alignment` TranslatedTextAlignment — Alignment information object.
      - `proj` string, required — Maps input text to translated text. The alignment information is only provided when the request parameter includeAlignment is true. Alignment is returned as a string value of the following format: [[SourceTextStartIndex]:[SourceTextEndIndex]–[TgtTextStartIndex]:[TgtTextEndIndex]]. The colon separates start and end index, the dash separates the languages, and space separates the words. One word may align with zero, one, or multiple words in the other language, and the aligned words may be non-contiguous. When no alignment information is available, the alignment element will be empty.
    - `sentLen` SentenceBoundaries — An object returning sentence boundaries in the input and output texts.
      - `srcSentLen` integer[], required — An integer array representing the lengths of the sentences in the input text. The length of the array is the number of sentences, and the values are the length of each sentence.
      - `transSentLen` integer[], required — An integer array representing the lengths of the sentences in the translated text. The length of the array is the number of sentences, and the values are the length of each sentence.
  - `sourceText` SourceText — Input text in the default script of the source language.
    - `text` string, required — Input text in the default script of the source language.

## Other responses

- `default` — An unexpected error response.

---

[API](https://skmtc.net/azure/apis/translation-texttranslation.md) · [All operations](https://skmtc.net/azure/apis/translation-texttranslation/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/azure/translation-texttranslation/versions/6316202fc2bb/schema)
