Documents

Pretranslate Documents

Changed on

Pretranslate one or more Documents using translation memory (TM) and, optionally, machine translation (MT). Only documents that are not currently importing/exporting and are not already pretranslating will be pretranslated; the response always reflects the current state of every requested Document id, whether or not it was eligible.

This is an asynchronous operation. The endpoint returns immediately with a 202 response once pretranslation has been queued; poll the Document resource (or the is_pretranslating / status.pretranslation fields it returns) to see when pretranslation has finished.

This endpoint is subject to a per-organization rate limit. See the API Rate Limits guide for details on how to read 429 responses and batch requests efficiently by passing multiple document ids in a single call.

Example CURL:

curl -X POST 'https://api.lilt.com/v2/documents/pretranslate?key=API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{"id": [274, 275], "mode": "TM+MT", "auto_accept": true}'
post/v2/documents/pretranslate

Request

  • Base URL
    https://api.lilt.com
  • URL
    https://api.lilt.com/v2/documents/pretranslate
  • Auth
    HTTP basic

Query parameters

auto_acceptboolean

Auto-accept segments with 100% translation memory matches. Can also be passed in the request body. Defaults to your organization's Accept and lock exact matches setting.

case_sensitiveboolean

Use case-sensitive translation memory matching. Can also be passed in the request body. Defaults to your organization's Use case sensitive translation memory matching setting.

attribute_to_creatorboolean

Attribute translation authorship of exact matches to the author of the document. Can also be passed in the request body. Defaults to your organization's Translation authorship setting.

mode'TM' | 'TM+MT'

Pretranslation mode. Can also be passed in the request body. Defaults to TM.

Request body

mode'TM' | 'TM+MT'

Pretranslation mode. Defaults to TM.

auto_acceptboolean

Auto-accept segments with 100% translation memory matches. Defaults to your organization's Accept and lock exact matches setting.

case_sensitiveboolean

Use case-sensitive translation memory matching. Defaults to your organization's Use case sensitive translation memory matching setting.

attribute_to_creatorboolean

Attribute translation authorship of exact matches to the author of the document. Defaults to your organization's Translation authorship setting.

Response

Pretranslation has been queued. Returns the current state of every requested Document.

idinteger[]

The Document ids that were requested.

is_pretranslatingboolean

Always true for a successfully queued request.

Example response

{
  "id": [
    274,
    275
  ],
  "is_pretranslating": true,
  "documents": [
    {
      "id": 46530,
      "project_id": 287,
      "srclang": "en",
      "trglang": "de",
      "name": "Introduction.xliff",
      "import_error_message": "Could not parse XML.",
      "export_error_message": "Could not parse XML.",
      "status": {
        "pretranslation": "idle"
      },
      "translator_email": "translator@example.com",
      "reviewer_email": "reviewer@example.com",
      "customer_reviewer_email": "reviewer@example.com",
      "created_at": 1489147692,
      "updated_at": 1489147692,
      "is_review_complete": true
    }
  ]
}

Changes

    • breaking

      added required request body

    • info

      api operation id pretranslateDocuments was added

    • info

      added the new optional query request parameter attribute_to_creator

    • info

      added the new optional query request parameter auto_accept

    • info

      added the new optional query request parameter case_sensitive

    • info

      added the new optional query request parameter mode

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the success response with the status