POST/v2/projects/{projectId}/suggest/machine-translations

Get machine translation suggestions

Requests machine translation suggestions for a project using enabled translation services. Supply targetLanguageId and either keyId or baseText as applicable; use services to choose providers, or omit it to use all enabled services. The response includes service results and indicates whether the base translation was blank.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

1 parameter · 6 body fields
projectIdintegerrequired
The integer ID of the project for which to request translation suggestions.

Request for machine translation suggestions for a target language, with optional key or source text and service selection.

baseTextstringoptional
Text value of base translation. Useful, when base translation is not stored yet.
isPluralbooleanoptional
Whether base text is plural. This value is ignored if baseText is null.
keyIdintegeroptional
Key Id to get results for. Use when key is stored already.
pluralbooleanoptional
Plurality flag for the base text. This field is write-only.
servicesarray<string>optional
List of services to use. If null, then all enabled services are used.
targetLanguageIdintegerrequired
The integer ID of the target language.

5 status codes
200Returns whether the base translation was blank and service results in `result`. The response may also include the deprecated `machineTranslations` field.
baseBlankbooleanrequired
If true, the base translation was empty and no translation was provided.
machineTranslationsobjectdeprecatedoptional
String translations provided by enabled services. (deprecated, use `result` instead)
resultobjectoptional
Results provided by enabled services.
400Returned when a required field is missing or a request value fails validation.
codestringrequired
Allowed:unauthenticatedapi_access_forbiddenapi_key_not_foundinvalid_api_keyinvalid_project_api_keyproject_api_key_expiredbad_credentialsmfa_enabledinvalid_otp_codemfa_not_enabledcan_not_revoke_own_permissionsdata_corrupted
paramsarray<object>optional
401Returned when the request has no valid authentication.
codestringrequired
Allowed:unauthenticatedapi_access_forbiddenapi_key_not_foundinvalid_api_keyinvalid_project_api_keyproject_api_key_expiredbad_credentialsmfa_enabledinvalid_otp_codemfa_not_enabledcan_not_revoke_own_permissionsdata_corrupted
paramsarray<object>optional
403Returned when the authenticated user does not have permission to request machine translation suggestions for the project.
codestringrequired
Allowed:unauthenticatedapi_access_forbiddenapi_key_not_foundinvalid_api_keyinvalid_project_api_keyproject_api_key_expiredbad_credentialsmfa_enabledinvalid_otp_codemfa_not_enabledcan_not_revoke_own_permissionsdata_corrupted
paramsarray<object>optional
404Returned when the project or requested resource is not found.
codestringrequired
Allowed:unauthenticatedapi_access_forbiddenapi_key_not_foundinvalid_api_keyinvalid_project_api_keyproject_api_key_expiredbad_credentialsmfa_enabledinvalid_otp_codemfa_not_enabledcan_not_revoke_own_permissionsdata_corrupted
paramsarray<object>optional

Error handling

A 400 is returned when the request is invalid; a 401 when authentication is missing or invalid; a 403 when the authenticated user lacks permission; and a 404 when the project or requested resource is not found. targetLanguageId is required, and each services value must be one of GOOGLE, AWS, DEEPL, AZURE, BAIDU, or PROMPT. The projectId path parameter must identify an existing project.