---
title: "Text translations v2"
method: POST
path: "/v2/textTranslations"
tags: ["Text translations"]
---

# Text translations v2

`POST /v2/textTranslations`

Translates the text content utilizing Phrase Language AI capabilities. Can identify the source language, if 
not provided, and translate the text to the target language. If language identification is requested, system
needs to have at least 50 characters.

## Request body

- TextTranslationsRequestV2
  - `sourceLang` LanguageV1
    - `code` string, required — Language code, using a two-letter language code from ISO 639-1, e.g., `cs`. Optionally, a region subtag based on a two-letter country code from ISO 3166-1 alpha-2, e.g., `cs_cz`, or a three-digit code from UN M.49, e.g., `es_419`, separated by an underscore. Both the two-letter language code and the two-letter country code need to be lower case. Note that the Phrase Language AI setup dictates whether the region subtag is optional or not. If the only models deployed to a profile explicitly specify or are customized with a target locale, then a region subtag is mandatory.
  - `sourceTexts` SourceTextRequestV2[], required
    - `key` string, required — The key of the source text. This is used to identify the source text in the response. Must be unique.
    - `source` string, required — The source text to be translated.
  - `targetLang` LanguageV1, required
    - `code` string, required — Language code, using a two-letter language code from ISO 639-1, e.g., `cs`. Optionally, a region subtag based on a two-letter country code from ISO 3166-1 alpha-2, e.g., `cs_cz`, or a three-digit code from UN M.49, e.g., `es_419`, separated by an underscore. Both the two-letter language code and the two-letter country code need to be lower case. Note that the Phrase Language AI setup dictates whether the region subtag is optional or not. If the only models deployed to a profile explicitly specify or are customized with a target locale, then a region subtag is mandatory.
  - `mtSettings` MtSettingSimplifiedV1
    - `profile` TranslationProfileRequestV1
      - `uid` string, required — UID for the translation profile
  - `consumerId` string, required — Use short descriptive ID that represents the calling integration. E.g. JIRA_INTEGRATION, GDRIVE_SYNC, SHOPIFY_EXT:v1.2 etc.

## Response `200`

Response with translations

- TextTranslationsResponseV2
  - `translatedTexts` TranslatedTextResponseV2[]
    - `key` string
    - `target` string
  - `sourceLang` LanguageV1, required
    - `code` string, required — Language code, using a two-letter language code from ISO 639-1, e.g., `cs`. Optionally, a region subtag based on a two-letter country code from ISO 3166-1 alpha-2, e.g., `cs_cz`, or a three-digit code from UN M.49, e.g., `es_419`, separated by an underscore. Both the two-letter language code and the two-letter country code need to be lower case. Note that the Phrase Language AI setup dictates whether the region subtag is optional or not. If the only models deployed to a profile explicitly specify or are customized with a target locale, then a region subtag is mandatory.
  - `targetLang` LanguageV1, required
    - `code` string, required — Language code, using a two-letter language code from ISO 639-1, e.g., `cs`. Optionally, a region subtag based on a two-letter country code from ISO 3166-1 alpha-2, e.g., `cs_cz`, or a three-digit code from UN M.49, e.g., `es_419`, separated by an underscore. Both the two-letter language code and the two-letter country code need to be lower case. Note that the Phrase Language AI setup dictates whether the region subtag is optional or not. If the only models deployed to a profile explicitly specify or are customized with a target locale, then a region subtag is mandatory.
  - `consumerId` string, required — Use short descriptive ID that represents the calling integration. E.g. JIRA_INTEGRATION, GDRIVE_SYNC, SHOPIFY_EXT:v1.2 etc.

## Other responses

- `400` — Bad request
- `401` — Not authorized

---

[API](https://skmtc.net/phrase/apis/control-hub-service.md) · [All operations](https://skmtc.net/phrase/apis/control-hub-service/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/phrase/control-hub-service/revisions/98ecac7ba2bf/schema)
