Translate with MT
Sends one or more source strings to the machine translation (MT) engine identified by the MT settings UID and returns the translated strings in the same order as the input. This call is synchronous — the response contains the translations directly, not a job reference.
Use this endpoint to obtain on-demand MT output outside of a translation job, for example to pre-translate content in a custom workflow or to compare output quality across configured MT settings.
The MT settings identified by mtSettingsUid must belong to the same organization as the authenticated user. If the MT engine type has been retired for the organization’s pricing plan, the call returns 400.
Errors:
| HTTP status | errorCode | Cause | Remediation |
|---|---|---|---|
| 400 | BAD_REQUEST | Request body is malformed, a required field is missing, a language code is not a valid locale, sourceTexts is empty, or the MT engine type is retired for this plan. | Verify that from and to are valid language codes, sourceTexts contains at least one string, and the MT settings refer to an active engine type. |
| 403 | AuthAccessDenied | The authenticated user does not belong to the same organization as the MT settings. | Use MT settings that belong to your organization. |
| 404 | ResourceNotFound | No MT settings exist for the provided mtSettingsUid. | Check the UID value; retrieve valid UIDs from the MT settings list endpoint. |
Authorizations
Get a token from auth/login endpoint and then pass it in the Authorization HTTP header in every subsequent API call. For more information visit our help center.
Path Parameters
UID of the MT settings identifying the MT engine to use.
Body
Translation request body.
Request body for an MT translation request, specifying source and target languages and the texts to translate.
Source language code (for example, en or en-US). Must be a valid language code.
Source strings to translate, returned in the same order as the translations. Must contain at least one item.
1 - 2147483647 elementsTarget language code (for example, de or de-DE). Must be a valid language code.
Filename associated with the source content. Some MT engines use this for context or domain selection.
Response
OK
Response from an MT translation request, containing the translated strings.
Translated strings in the same order as the input sourceTexts.