Lilt API API Reference

The Lilt API enables programmatic access to the full-range of Lilt backend services including:

  • Training of and translating with interactive, adaptive machine translation
  • Large-scale translation memory
  • The Lexicon (a large-scale termbase)
  • Programmatic control of the Lilt CAT environment
  • Translation memory synchronization

Requests and responses are in JSON format. The API only responds to HTTPS / SSL requests. Requests are authenticated via API key, which requires the Business plan.

API Endpoint
https://lilt.com/2
Contact: support@lilt.com
Schemes: https
Version: v2.0

Authentication

api_key

name
key
in
query

Root

Retrieve the API root

GET /

This resource does not have any attributes. It lists the name of the API.

This endpoint can be used to verify API keys and to check the availability of the API.

200 OK

A status object.

default

Unexpected error

Response Example (200 OK)
{
  "api_name": "Lilt REST API v2",
  "api_root": "/2"
}
Response Example (default )
{
  "message": "Internal server error."
}

Documents

Create a Document

POST /documents

Create a new Document. A Document is a collection of one or more Segments.

Documents are nested inside of Projects, and appear in the Project details view in the web app.

Document-level relationships between Segments are considered by the machine translation system during adaptation. If there is no inherent document structure in your data, you still might consider grouping related Segments into Documents to improve translation quality.

The Document resource to create.

name: string

The document name.

project_id: integer

A unique Project identifier.

Request Example
{
  "name": "Introduction.xliff",
  "project_id": 23618
}
200 OK

A Document object.

default

Unexpected error

Response Example (200 OK)
{
  "id": 46530,
  "srclang": "en",
  "trglang": "de",
  "name": "Introduction.xliff",
  "import_in_progress": "boolean",
  "import_succeeded": true,
  "import_error_message": "Could not parse XML.",
  "created_at": 1489147692,
  "updated_at": 1489147692,
  "segments": [
    {
      "id": 84480010,
      "created_at": 1489147692,
      "updated_at": 1489147692,
      "document_id": 1234,
      "memory_id": 5678,
      "source": "The red bus.",
      "srclang": "en",
      "target": "Le bus rouge.",
      "trglang": "fr",
      "is_confirmed": true,
      "is_reviewed": true
    }
  ]
}
Response Example (default )
{
  "message": "Internal server error."
}

Retrieve a Document

GET /documents

List a Document.

id

A unique Document identifier.

type
integer
in
query
200 OK

A Document object.

default

Unexpected error

Response Example (200 OK)
{
  "id": 46530,
  "srclang": "en",
  "trglang": "de",
  "name": "Introduction.xliff",
  "import_in_progress": "boolean",
  "import_succeeded": true,
  "import_error_message": "Could not parse XML.",
  "created_at": 1489147692,
  "updated_at": 1489147692,
  "segments": [
    {
      "id": 84480010,
      "created_at": 1489147692,
      "updated_at": 1489147692,
      "document_id": 1234,
      "memory_id": 5678,
      "source": "The red bus.",
      "srclang": "en",
      "target": "Le bus rouge.",
      "trglang": "fr",
      "is_confirmed": true,
      "is_reviewed": true
    }
  ]
}
Response Example (default )
{
  "message": "Internal server error."
}

Update a Document

PUT /documents

Update a Document.

The Document resource to update.

id: integer

A unique Document identifier.

name: string

The Document name.

Request Example
{
  "id": 46530,
  "name": "Introduction to our App"
}
200 OK

OK

default

Unexpected error

Response Example (200 OK)
{
  "id": 46530,
  "name": "Introduction to our App"
}
Response Example (default )
{
  "message": "Internal server error."
}

Delete a Document

DELETE /documents

Delete a Document.

id

A unique Document identifier.

type
integer
in
query
200 OK

OK

default

Unexpected error

Response Example (200 OK)
{
  "id": 46530,
  "deleted": true
}
Response Example (default )
{
  "message": "Internal server error."
}

Assign a Document

PUT /documents/assign

Assign and unassign a Document for translation and/or review.

Attributes of the Document resource to assign.

id: integer

A unique Document identifier.

email: string

An email address.

is_translator: boolean

If true, assign for translating. If false, then unassign.

is_reviewer: boolean

If true, assign for reviewing. If false, then unassign.

Request Example
{
  "id": 46530,
  "email": "user@email.com",
  "is_translator": true,
  "is_reviewer": "boolean"
}
200 OK

OK

default

Unexpected error

Response Example (200 OK)
{
  "id": 46530
}
Response Example (default )
{
  "message": "Internal server error."
}

Download a File

GET /documents/files

Export a Document that has been translated in the Lilt web application. Any Document can be downloaded in XLIFF 1.2 format. Documents in the following native formats can be exported in that format by setting is_xliff=false:

  • HTML (.html)
  • Excel 2007+ (.xlsx)
  • CSV (.csv)

Example CURL command:

  curl -X GET https://lilt.com/2/documents/files?key=API_KEY&id=274 -o from_lilt.xliff
id

An unique Document identifier.

type
integer
in
query
is_xliff

Download the document in XLIFF 1.2 format.

type
boolean true
in
query
200 OK

A file.

default

Unexpected error

Response Example (200 OK)
"file"
Response Example (default )
{
  "message": "Internal server error."
}

Upload a File

POST /documents/files

Create a Document from a file in one of these formats:

  • XLIFF 1.2 (.xliff, .xlf)
  • HTML (.html)
  • Excel 2007+ (.xlsx)
  • CSV (.csv)

Request parameters should be passed as JSON object with the header field LILT-API. Example CURL command:

  curl -X POST https://lilt.com/2/documents/files?key=API_KEY \
  --header "LILT-API: {\"name\": \"introduction.xliff\",\"project_id\": 9}" \
  --header "Content-Type: application/octet-stream" \
  --data-binary @Introduction.xliff

The file contents to be uploaded. The entire POST body will be treated as the file.

name

A file name.

type
string
in
header
project_id

A unique Project identifier.

type
integer
in
header
Request Example
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<xliff xmlns=\"urn:oasis:names:tc:xliff:document:1.2\"> \n...\n</xliff>"
200 OK

A Document object.

default

Unexpected error

Response Example (200 OK)
{
  "id": 46530,
  "srclang": "en",
  "trglang": "de",
  "name": "Introduction.xliff",
  "import_in_progress": "boolean",
  "import_succeeded": true,
  "import_error_message": "Could not parse XML.",
  "created_at": 1489147692,
  "updated_at": 1489147692,
  "segments": [
    {
      "id": 84480010,
      "created_at": 1489147692,
      "updated_at": 1489147692,
      "document_id": 1234,
      "memory_id": 5678,
      "source": "The red bus.",
      "srclang": "en",
      "target": "Le bus rouge.",
      "trglang": "fr",
      "is_confirmed": true,
      "is_reviewed": true
    }
  ]
}
Response Example (default )
{
  "message": "Internal server error."
}

Languages

Retrieve supported languages

GET /languages

Get a list of supported languages.

Locales (e.g., en-US) are not explicitly supported. To create locale-specific systems,

simply create a new Memory and upload locale-specific translation memory data to it. The system will adapt to the locale.

200 OK

An object listing supported languages.

default

Unexpected error

Response Example (200 OK)
{
  "source_to_target": {
    "en": {
      "da": true,
      "de": true,
      "fr": true,
      "...": "..."
    },
    "...": "..."
  },
  "code_to_name": {
    "aa": "Afar",
    "ab": "Abkhazian",
    "af": "Afrikaans",
    "...": "..."
  }
}
Response Example (default )
{
  "message": "Internal server error."
}

Lexicon

Update a Lexicon

POST /lexicon

Update the Lexicon with a new term. The maximum source length is 250 characters.

The lexicon entry.

memory_id: integer

A unique Memory identifier.

source: string

The source side of the lexicon entry.

target: string

The target side of the lexicon entry.

Request Example
{
  "memory_id": 10641,
  "source": "washing machine",
  "target": "Waschmaschine"
}
200 OK

A status object.

default

Unexpected error

Response Example (200 OK)
{
  "memory_id": 46530,
  "success": true
}
Response Example (default )
{
  "message": "Internal server error."
}

Query a Lexicon

GET /lexicon

Query the Lexicon. The Lexicon is an editable termbase / concordance that is integrated with the Memory.

memory_id

A unique Memory identifier.

type
integer
in
query
srclang

An ISO639-1 language code.

type
string
in
query
trglang

An ISO639-1 language code.

type
string
in
query
query

The query term.

type
string
in
query
n

The maximum number of results to return.

type
integer 1
in
query
200 OK

An array of LexiconEntry objects.

default

Unexpected error

Response Example (200 OK)
[
  {
    "translations": [],
    "examples": [
      [
        {
          "source": "Waschmaschine",
          "sourceDelimiters": [
            "",
            ""
          ],
          "target": [
            "washing",
            "machine"
          ],
          "targetDelimiters": [
            "",
            " ",
            ""
          ],
          "sourceSpan": {
            "start": 0,
            "length": 1
          },
          "targetSpan": {
            "start": 1,
            "length": 1
          },
          "similarity": 0,
          "memoryId": 10641
        }
      ]
    ]
  }
]
Response Example (default )
{
  "message": "Internal server error."
}

Memories

Create a Memory

POST /memories

Create a new Memory. A Memory is a container that collects source/target sentences for a specific language pair (e.g., English>French). The data in the Memory is used to train the MT system, populate the TM, and update the lexicon. Memories are private to your account - the data is not shared across users - unless you explicitly share a Memory with your team (via web app only).

Refer to our KB for a more detailed description.

The Memory resource to create.

name: string

A name for the Memory.

srclang: string

An ISO639-1 language identifier.

trglang: string

An ISO639-1 language identifier.

Request Example
{
  "name": "automotive",
  "srclang": "en",
  "trglang": "fr"
}
200 OK

A Memory object.

default

Unexpected error

Response Example (200 OK)
{
  "id": 1234,
  "srclang": "en",
  "trglang": "fr",
  "name": "Acme Corp Support Content",
  "version": 78,
  "created_at": 1489147692,
  "updated_at": 1489147692,
  "num_segments": 1028,
  "resources": [
    "string"
  ]
}
Response Example (default )
{
  "message": "Internal server error."
}

Retrieve a Memory

GET /memories

Retrieve a Memory. If you cannot access the Memory (401 error) please check permissions (e.g. in case you created the Memory via the web app with a different account you may have to explicitly share that Memory).

id

An optional Memory identifier.

type
integer
in
query
200 OK

A Memory object.

default

Unexpected error

Response Example (200 OK)
[
  {
    "id": 1234,
    "srclang": "en",
    "trglang": "fr",
    "name": "Acme Corp Support Content",
    "version": 78,
    "created_at": 1489147692,
    "updated_at": 1489147692,
    "num_segments": 1028,
    "resources": [
      "string"
    ]
  }
]
Response Example (default )
{
  "message": "Internal server error."
}

Update a Memory

PUT /memories

Update a Memory.

The Memory resource to update.

id: integer

A unique Memory identifier.

name: string

The Memory name.

Request Example
{
  "id": 7246,
  "name": "Automotive Memory"
}
200 OK

A status object.

default

Unexpected error

Response Example (200 OK)
{
  "id": 7246,
  "name": "Automotive Memory"
}
Response Example (default )
{
  "message": "Internal server error."
}

Delete a Memory

DELETE /memories

Delete a Memory.

id

A unique Memory identifier.

type
integer
in
query
200 OK

A status object.

default

Unexpected error

Response Example (200 OK)
{
  "id": 46530,
  "deleted": true
}
Response Example (default )
{
  "message": "Internal server error."
}

Query a Memory

GET /memories/query

Perform a translation memory query.

id

A unique Memory identifier.

type
integer
in
query
query

A source query.

type
string
in
query
n

Maximum number of results to return.

type
integer 10
in
query

An array of TranslationMemoryEntry objects.

default

Unexpected error

Response Example (200 OK)
[
  {
    "source": "The red bus.",
    "target": "Le bus rouge.",
    "score": 100,
    "metadata": "object"
  }
]
Response Example (default )
{
  "message": "Internal server error."
}

Get-sync for a Memory

GET /memories/sync

Get all or part of a memory in TMX 1.4b format. If the from_time and/or to_time are omitted, then all segments are returned. The parameter when specifies on which date field from_time and to_time are matched. Possible values are Created (when the segment was originally created in the memory), Updated (when the segment was lastly updated), and Deleted (when the segment was deleted).

Example CURL command:

  curl -X GET https://lilt.com/2/memories/sync?key=API_KEY&id=42 -o from_lilt.tmx
id

A unique Memory identifier.

type
integer
in
query
from_time

Unix time stamp (epoch, in seconds) of the start of the Memory section.

type
integer
in
query
to_time

Unix time stamp (epoch, in seconds) of the end of the Memory section.

type
integer
in
query
when

The date field on which retrieved segments match from/to time stamps: Created, Updated, Deleted. If this parameter is omitted, then the whole Memory is returned.

type
string
in
query
200 OK

A TMX 1.4b file.

default

Unexpected error

Response Example (200 OK)
"file"
Response Example (default )
{
  "message": "Internal server error."
}

Insert-sync for a Memory

POST /memories/sync

Inserts a TM in TMX 1.4b format into the Memory. Request parameters should be passed as JSON object with the header field LILT-API.

Example CURL command:

  curl -X POST https://lilt.com/2/memories/sync?key=API_KEY \
    --header "LILT-API: {\"name\": \"my_memory.tmx\",\"id\": 42}" \
    --header "Content-Type: application/octet-stream" \
    --data-binary @my_memory.tmx

The file contents to be uploaded. The entire POST body will be treated as the file.

id

A unique Memory identifier.

type
integer
in
header
name

Name of the TMX file.

type
string
in
header
Request Example
"string"
200 OK

OK

default

Unexpected error

Response Example (200 OK)
{
  "id": "integer",
  "num_updates": "integer"
}
Response Example (default )
{
  "message": "Internal server error."
}

Update-sync for a Memory

PUT /memories/sync

Updates the Memory with given TMX file. Request parameters should be passed as JSON object with the header field LILT-API. The number of segments returned by the from_time, to_time, when parameters and the number of segments in the TMX file need to be identical.

Example CURL command:

  curl -X PUT https://lilt.com/2/memories/sync?key=API_KEY \
    --header "LILT-API: {\"name\": \"my_memory.tmx\", \"id\": 42, \"from_time\": 1491048000, \"to_time\": 1491049800, "when": "Updated"}" \
    --header "Content-Type: application/octet-stream" \
    --data-binary @my_memory.tmx

The file contents to be uploaded. The entire PUT body will be treated as the file.

id

A unique Memory identifier.

type
integer
in
header
from_time

Unix time stamp (epoch, in seconds) of the start of the Memory section.

type
integer
in
header
to_time

Unix time stamp (epoch, in seconds) of the end of the Memory section.

type
integer
in
header
when

The date field on which retrieved segments match from/to time stamps: Created, Updated, Deleted.

type
string
in
header
Request Example
"string"
200 OK

OK

default

Unexpected error

Response Example (200 OK)
{
  "id": "integer",
  "num_updates": "integer"
}
Response Example (default )
{
  "message": "Internal server error."
}

Delete-sync for a Memory

DELETE /memories/sync

Deletes segments in the Memory matching the from_time, to_time and when parameters.

Example CURL command:

  curl -X DELETE https://lilt.com/2/memories/sync?key=API_KEY&id=42&from_time=1491048000&to_time=1491049800&when=Created
id

A unique Memory identifier.

type
integer
in
query
from_time

Unix time stamp (epoch, in seconds) of the start of the Memory section.

type
integer
in
query
to_time

Unix time stamp (epoch, in seconds) of the end of the Memory section.

type
integer
in
query
when

The date field on which retrieved segments match from/to time stamps: Created, Updated, Deleted.

type
string
in
query
200 OK

OK

default

Unexpected error

Response Example (200 OK)
{
  "id": "integer",
  "num_updates": "integer"
}
Response Example (default )
{
  "message": "Internal server error."
}

Projects

Create a Project

POST /projects

Create a Project. A Project is a collection of Documents.

A Project is associated with exactly one Memory.

Projects appear in the dashboard of the web app.

The Project resource to create.

name: string

A name for the Project.

memory_id: integer

The Memory to associate with this new Project.

Request Example
{
  "name": "My new project",
  "memory_id": 1234
}
200 OK

A Project object.

default

Unexpected error

Response Example (200 OK)
{
  "id": 448,
  "memory_id": 1234,
  "srclang": "en",
  "trglang": "fr",
  "name": "My New Project",
  "created_at": 1489147692,
  "updated_at": 1489147692,
  "documents": [
    {
      "id": 46530,
      "srclang": "en",
      "trglang": "de",
      "name": "Introduction.xliff",
      "import_in_progress": "boolean",
      "import_succeeded": true,
      "import_error_message": "Could not parse XML.",
      "created_at": 1489147692,
      "updated_at": 1489147692,
      "segments": [
        {
          "id": 84480010,
          "created_at": 1489147692,
          "updated_at": 1489147692,
          "document_id": 1234,
          "memory_id": 5678,
          "source": "The red bus.",
          "srclang": "en",
          "target": "Le bus rouge.",
          "trglang": "fr",
          "is_confirmed": true,
          "is_reviewed": true
        }
      ]
    }
  ]
}
Response Example (default )
{
  "message": "Internal server error."
}

Retrieve a Project

GET /projects

Retrieve a project.

id

A unique Project identifier.

type
integer
in
query
srclang

An ISO639-1 language code.

type
string
in
query
trglang

An ISO639-1 language code.

type
string
in
query
200 OK

An array of Project objects.

default

Unexpected error

Response Example (200 OK)
[
  {
    "id": 448,
    "memory_id": 1234,
    "srclang": "en",
    "trglang": "fr",
    "name": "My New Project",
    "created_at": 1489147692,
    "updated_at": 1489147692,
    "documents": [
      {
        "id": 46530,
        "srclang": "en",
        "trglang": "de",
        "name": "Introduction.xliff",
        "import_in_progress": "boolean",
        "import_succeeded": true,
        "import_error_message": "Could not parse XML.",
        "created_at": 1489147692,
        "updated_at": 1489147692,
        "segments": [
          {
            "id": 84480010,
            "created_at": 1489147692,
            "updated_at": 1489147692,
            "document_id": 1234,
            "memory_id": 5678,
            "source": "The red bus.",
            "srclang": "en",
            "target": "Le bus rouge.",
            "trglang": "fr",
            "is_confirmed": true,
            "is_reviewed": true
          }
        ]
      }
    ]
  }
]
Response Example (default )
{
  "message": "Internal server error."
}

Update a Project

PUT /projects

Update a Project.

The Project resource to update.

id: integer

A unique Project identifier.

name: string

The Project name.

Request Example
{
  "id": 1234,
  "name": "Walker Percy Essays"
}
200 OK

OK

default

Unexpected error

Response Example (200 OK)
{
  "id": 1234,
  "name": "Walker Percy Essays"
}
Response Example (default )
{
  "message": "Internal server error."
}

Delete a Project

DELETE /projects

Delete a Project.

id

A unique Project identifier.

type
integer
in
query
200 OK

OK

default

Unexpected error

Response Example (200 OK)
{
  "id": 46530,
  "deleted": true
}
Response Example (default )
{
  "message": "Internal server error."
}

Retrieve Project status

GET /projects/status

Retrieve the status of a project.

id

A unique Project identifier.

type
integer
in
query
200 OK

An object describing the status of the Project.

default

Unexpected error

Response Example (200 OK)
{
  "id": 21902,
  "num_source_words": 6039,
  "num_words_confirmed": 151,
  "num_words_reviewed": 12,
  "time_elapsed": 2980000,
  "time_elapsed_review": 8000,
  "resources": [
    {
      "email": "support@lilt.com",
      "num_words_confirmed": 151,
      "time_elapsed": 1172000,
      "num_exact_match_words": 52,
      "num_words_reviewed": 12,
      "time_elapsed_review": 8000
    }
  ]
}
Response Example (default )
{
  "message": "Internal server error."
}

QA

QA

Perform QA check

GET /qa

Perform QA checks on a target string. Optionally, you can specify a source string for additional bilingual checks, e.g. number consistency.

target

A target string to be checked.

type
string
in
query
trglang

An ISO639-1 language code.

type
string
in
query
source

An optional source string.

type
string
in
query
srclang

An ISO639-1 language code.

type
string
in
query
200 OK

A QARuleMatches object.

default

Unexpected error

Response Example (200 OK)
{
  "matches": [
    {
      "context": {
        "length": 7,
        "offset": 19,
        "text": "This segment has a speling mistake"
      },
      "length": 7,
      "message": "Possible spelling mistake found",
      "offset": 19,
      "replacements": [
        {
          "value": "spelling"
        },
        {
          "value": "spewing"
        },
        {
          "value": "spieling"
        }
      ],
      "rule": {
        "category": {
          "id": "TYPOS",
          "name": "Possible Typo"
        },
        "description": "Possible spelling mistake",
        "id": "MORFOLOGIK_RULE_EN_US",
        "issueType": "misspelling",
        "subId": "string",
        "urls": []
      },
      "shortMessage": "Spelling mistake"
    }
  ]
}
Response Example (default )
{
  "message": "Internal server error."
}

Segments

Create a Segment

POST /segments

Create a Segment and add it to a Memory. A Segment is a source/target pair that is used to train the machine translation system and populate the translation memory.

The maximum source length is 5,000 characters.

The Segment resource to create.

To add a Segment to a Memory, include the memory_id and target parameters.

To add a Segment to a Document, include the document_id and the source parameters. The target parameter is optional.

memory_id: integer

A unique Memory identifier.

document_id: integer

A unique Document identifier.

source: string

The source string.

target: string

The target string.

Request Example
{
  "memory_id": 10641,
  "document_id": 1876,
  "source": "Code zur Fehleranalyse einschalten",
  "target": "Enable debugging code"
}
200 OK

OK

default

Unexpected error

Response Example (200 OK)
{
  "id": 84480010,
  "created_at": 1489147692,
  "updated_at": 1489147692,
  "document_id": 1234,
  "memory_id": 5678,
  "source": "The red bus.",
  "srclang": "en",
  "target": "Le bus rouge.",
  "trglang": "fr",
  "is_confirmed": true,
  "is_reviewed": true
}
Response Example (default )
{
  "message": "Internal server error."
}

Retrieve a Segment

GET /segments

Retrieve a Segment.

id

A unique Segment identifier.

type
integer
in
query
200 OK

OK

default

Unexpected error

Response Example (200 OK)
{
  "id": 84480010,
  "created_at": 1489147692,
  "updated_at": 1489147692,
  "document_id": 1234,
  "memory_id": 5678,
  "source": "The red bus.",
  "srclang": "en",
  "target": "Le bus rouge.",
  "trglang": "fr",
  "is_confirmed": true,
  "is_reviewed": true
}
Response Example (default )
{
  "message": "Internal server error."
}

Update a Segment

PUT /segments

Update a Segment. The Memory will be updated with the new target string.

The Segment resource to update.

id: integer

A unique Segment identifier.

target: string

The target string.

Request Example
{
  "id": 84480010,
  "target": "Enable debug code"
}
200 OK

OK

default

Unexpected error

Response Example (200 OK)
{
  "id": 84480010,
  "created_at": 1489147692,
  "updated_at": 1489147692,
  "document_id": 1234,
  "memory_id": 5678,
  "source": "The red bus.",
  "srclang": "en",
  "target": "Le bus rouge.",
  "trglang": "fr",
  "is_confirmed": true,
  "is_reviewed": true
}
Response Example (default )
{
  "message": "Internal server error."
}

Delete a Segment

DELETE /segments

Delete a Segment.

id

A unique Segment identifier.

type
integer
in
query
200 OK

OK

default

Unexpected error

Response Example (200 OK)
{
  "id": 46530,
  "deleted": true
}
Response Example (default )
{
  "message": "Internal server error."
}

Tag a Segment

GET /segments/tag

Project tags for a segment. The source_tagged string contains one or more SGML tags. The target string is untagged. This endpoint will automatically place the source tags in the target.

Usage charges apply to this endpoint for production API keys.

source_tagged

The tagged source string.

type
string
in
query
target

The target string.

type
string
in
query
memory_id

A unique Memory identifier.

type
integer
in
query
200 OK

A TaggedSegment object.

default

Unexpected error

Response Example (200 OK)
{
  "source_tagged": "The <b>red bus.</b>",
  "target_tagged": "Le <b>bus rouge.</b>"
}
Response Example (default )
{
  "message": "Internal server error."
}

Translate

Translate a segment

GET /translate

Translate a source string.

Setting the rich parameter to true will change the response format to include additional information about each translation including a model score, word alignments, and formatting information. The rich format can be seen in the example response on this page.

By default, this endpoint also returns translation memory (TM) fuzzy matches, along with associated scores. Fuzzy matches always appear ahead of machine translation output in the response.

The maximum source length is 5,000 characters.

Usage charges apply to this endpoint for production API keys.

memory_id

A unique Memory identifier.

type
integer
in
query
source

The source text to be translated.

type
string
in
query
source_hash

A source hash code.

type
integer
in
query
prefix

A target prefix.

type
string
in
query
n

Return top n translations.

type
integer 1
in
query
rich

Returns rich translation information (e.g., with word alignments).

type
boolean
in
query
tm_matches

Include translation memory fuzzy matches.

type
boolean true
in
query

OK

default

Unexpected error

Response Example (200 OK)
{
  "untokenizedSource": "Authentication not required.",
  "tokenizedSource": "Authentication not required .",
  "sourceDelimiters": [
    "",
    " ",
    " ",
    "",
    ""
  ],
  "translation": [
    [
      {
        "score": 3.4936864e-8,
        "align": "0-0 1-1 2-2 3-3",
        "targetDelimiters": [
          "",
          " ",
          " ",
          "",
          ""
        ],
        "targetWords": [
          "Authentifizierung",
          "nicht",
          "erforderlich",
          "."
        ],
        "target": "Authentifizierung nicht erforderlich .",
        "targetWithTags": "Authentifizierung nicht erforderlich.",
        "isTMMatch": false,
        "provenance": "0 0 0 0"
      }
    ]
  ]
}
Response Example (default )
{
  "message": "Internal server error."
}

Register a segment

GET /translate/register

Register a source string for interactive translation. The source_hash value that is returned by this request is required by the prefix parameter for the translation endpoint. The maximum source length is 5,000 characters. Usage charges apply to this endpoint for production API keys.

source

A source string to be registered.

type
string
in
query
srclang

An ISO639-1 language code.

type
string
in
query
trglang

An ISO639-1 language code.

type
string
in
query
200 OK

OK

default

Unexpected error

Response Example (200 OK)
{
  "source_hash": "integer",
  "num_words": "integer"
}
Response Example (default )
{
  "message": "Internal server error."
}

Schema Definitions

Error: object

Response in the event of an unexpected error.

message: object

A human-readable message describing the error.

Example
{
  "message": "Internal server error."
}

Project: object

A Project is a collection of zero or more Documents. It is specific to a language pair, and is associated with exactly one Memory for that language pair. The Memory association cannot be changed after the Project is created.

id: integer

A unique number identifying the Project.

memory_id: integer

A unique number identifying the associated Memory.

srclang: string

An ISO639-1 language identifier.

trglang: string

An ISO639-1 language identifier.

name: string

A name for the project.

created_at: integer

Time at which the object was created. Measured in seconds since the Unix epoch.

updated_at: integer

Time at which the object was created. Measured in seconds since the Unix epoch.

documents: object[]

A list of Documents.

Example
{
  "id": 448,
  "memory_id": 1234,
  "srclang": "en",
  "trglang": "fr",
  "name": "My New Project",
  "created_at": 1489147692,
  "updated_at": 1489147692,
  "documents": [
    {
      "id": 46530,
      "srclang": "en",
      "trglang": "de",
      "name": "Introduction.xliff",
      "import_in_progress": "boolean",
      "import_succeeded": true,
      "import_error_message": "Could not parse XML.",
      "created_at": 1489147692,
      "updated_at": 1489147692,
      "segments": [
        {
          "id": 84480010,
          "created_at": 1489147692,
          "updated_at": 1489147692,
          "document_id": 1234,
          "memory_id": 5678,
          "source": "The red bus.",
          "srclang": "en",
          "target": "Le bus rouge.",
          "trglang": "fr",
          "is_confirmed": true,
          "is_reviewed": true
        }
      ]
    }
  ]
}

ProjectStatus: object

The status of a Project.

id: integer

A unique Project identifier.

num_source_words: integer

The number of source words in the project.

num_words_confirmed: integer

The number of confirmed source words.

num_words_reviewed: integer

The number of reviewed source words.

time_elapsed: integer

The total time spent on the project by all users.

time_elapsed_review: integer

The total time spent on reviewing by all users.

resources: object[]

Per-resource statistics for the project.

Example
{
  "id": 21902,
  "num_source_words": 6039,
  "num_words_confirmed": 151,
  "num_words_reviewed": 12,
  "time_elapsed": 2980000,
  "time_elapsed_review": 8000,
  "resources": [
    {
      "email": "support@lilt.com",
      "num_words_confirmed": 151,
      "time_elapsed": 1172000,
      "num_exact_match_words": 52,
      "num_words_reviewed": 12,
      "time_elapsed_review": 8000
    }
  ]
}

Document: object

A Document is a collection of zero or more Segments.

id: integer

A unique number identifying the Document.

srclang: string

An ISO639-1 language identifier.

trglang: string

An ISO639-1 language identifier.

name: string

The document name.

import_in_progress: boolean

True if the document is currently being imported

import_succeeded: boolean

True if the import process succeeded.

import_error_message: string

Error message if import_succeeded=false

created_at: integer

Time at which the object was created. Measured in seconds since the Unix epoch.

updated_at: integer

Time at which the object was created. Measured in seconds since the Unix epoch.

segments: object[]

A list of Segments.

Example
{
  "id": 46530,
  "srclang": "en",
  "trglang": "de",
  "name": "Introduction.xliff",
  "import_in_progress": "boolean",
  "import_succeeded": true,
  "import_error_message": "Could not parse XML.",
  "created_at": 1489147692,
  "updated_at": 1489147692,
  "segments": [
    {
      "id": 84480010,
      "created_at": 1489147692,
      "updated_at": 1489147692,
      "document_id": 1234,
      "memory_id": 5678,
      "source": "The red bus.",
      "srclang": "en",
      "target": "Le bus rouge.",
      "trglang": "fr",
      "is_confirmed": true,
      "is_reviewed": true
    }
  ]
}

LexiconEntry: object

An Lexicon entry for a source term or phrase.

translations: object[]

A list of translations for the query term.

examples: object[]

A list of concordance examples for the query term.

Example
{
  "translations": [],
  "examples": [
    [
      {
        "source": "Waschmaschine",
        "sourceDelimiters": [
          "",
          ""
        ],
        "target": [
          "washing",
          "machine"
        ],
        "targetDelimiters": [
          "",
          " ",
          ""
        ],
        "sourceSpan": {
          "start": 0,
          "length": 1
        },
        "targetSpan": {
          "start": 1,
          "length": 1
        },
        "similarity": 0,
        "memoryId": 10641
      }
    ]
  ]
}

Memory: object

A Memory is a collection of parallel (source/target) segments from which a MT/TM model is trained. When a translator confirms a segment in the Interface, a parallel segment is added to the Memory. Parallel segments from existing translation memories and bitexts can also be added to the Memory via the API.

id: integer

A unique number identifying the Memory.

srclang: string

An ISO639-1 language identifier.

trglang: string

An ISO639-1 language identifier.

name: string

A name for the Memory.

version: integer

The current version of the Memory, which is the number of updates since the memory was created.

created_at: integer

Time at which the object was created. Measured in seconds since the Unix epoch.

updated_at: integer

Time at which the object was created. Measured in seconds since the Unix epoch.

num_segments: integer

The number of confirmed Segments incorporated into this Memory.

resources: string[]

The resource files (translation memories and termbases) associated with this Memory.

Example
{
  "id": 1234,
  "srclang": "en",
  "trglang": "fr",
  "name": "Acme Corp Support Content",
  "version": 78,
  "created_at": 1489147692,
  "updated_at": 1489147692,
  "num_segments": 1028,
  "resources": [
    "string"
  ]
}

Translation: object

A machine translation (MT) or a translation memory (TM) match of a source segment.

target: string

The target string.

targetWithTags: string

The target string with source tags projected into the target.

align: string

"MT only: A whitespace delimited list of source-target alignment indices."

provenance: string

Positive values indicate that the word is from the Memory, with contiguous identical entries (e.g., 2 2) indicating phrase matches. Negative contiguous values indicate entries from the Lexicon. 0 indicates a word from the background data.

score: number

The score of the translation.

isTMMatch: boolean

TM only: If true, indicates an exact translation memory match.

targetDelimiters: string[]

A format string that indicates, for each word, if the word should be preceded by a space.

targetWords: string[]

A list of target words corresponding with the same dimension as targetDelimiters. The target string can be constructed by prefixing each word with its corresponding value in targetDelimiters, and then concatenating the words.

Example
[
  {
    "score": 3.4936864e-8,
    "align": "0-0 1-1 2-2 3-3",
    "targetDelimiters": [
      "",
      " ",
      " ",
      "",
      ""
    ],
    "targetWords": [
      "Authentifizierung",
      "nicht",
      "erforderlich",
      "."
    ],
    "target": "Authentifizierung nicht erforderlich .",
    "targetWithTags": "Authentifizierung nicht erforderlich.",
    "isTMMatch": false,
    "provenance": "0 0 0 0"
  }
]

TranslationList: object

An ranked list of translations and associated metadata.

untokenizedSource: string

The untokenized source segment. Punctuation has not been separated from words.

tokenizedSource: string

The tokenized source segment. Punctuation has been separated from words.

sourceDelimiters: string[]

A format string that indicates, for each word, if the word should be preceded by a space.

translation: object[]

A list of Translation objects.

Example
{
  "untokenizedSource": "Authentication not required.",
  "tokenizedSource": "Authentication not required .",
  "sourceDelimiters": [
    "",
    " ",
    " ",
    "",
    ""
  ],
  "translation": [
    [
      {
        "score": 3.4936864e-8,
        "align": "0-0 1-1 2-2 3-3",
        "targetDelimiters": [
          "",
          " ",
          " ",
          "",
          ""
        ],
        "targetWords": [
          "Authentifizierung",
          "nicht",
          "erforderlich",
          "."
        ],
        "target": "Authentifizierung nicht erforderlich .",
        "targetWithTags": "Authentifizierung nicht erforderlich.",
        "isTMMatch": false,
        "provenance": "0 0 0 0"
      }
    ]
  ]
}

Segment: object

A Segment is a source string and, optionally, its translation. A Segment can be associated with both a Memory and a Document. The Segment object contains additional metadata about the source and target strings.

id: integer

A unique number identifying the Segment.

created_at: integer

Time at which the object was created. Measured in seconds since the Unix epoch.

updated_at: integer

Time at which the object was created. Measured in seconds since the Unix epoch.

document_id: integer

A unique Document identifier.

memory_id: integer

The Memory with which this Segment is associated.

source: string

The source string.

srclang: string

An ISO639-1 language code.

target: string

The target string.

trglang: string

An ISO639-1 language code.

is_confirmed: boolean

The confirmation status.

is_reviewed: boolean

The review status.

Example
{
  "id": 84480010,
  "created_at": 1489147692,
  "updated_at": 1489147692,
  "document_id": 1234,
  "memory_id": 5678,
  "source": "The red bus.",
  "srclang": "en",
  "target": "Le bus rouge.",
  "trglang": "fr",
  "is_confirmed": true,
  "is_reviewed": true
}

TaggedSegment: object

A source string with tags automatically projected from source to target.

source_tagged: string

The tagged source string.

target_tagged: string

The tagged target string.

Example
{
  "source_tagged": "The <b>red bus.</b>",
  "target_tagged": "Le <b>bus rouge.</b>"
}

TranslationMemoryEntry: object

A translation memory entry.

source: string

The source string.

target: string

The target string. Tags will be automatically placed according to the query string.

score: integer

The fuzzy match score.

metadata: object

Attributes describing the translation memory entry.

Example
{
  "source": "The red bus.",
  "target": "Le bus rouge.",
  "score": 100,
  "metadata": "object"
}

QARuleMatches: object

QA rules describing the errors in the text.

matches: object[]
Example
{
  "matches": [
    {
      "context": {
        "length": 7,
        "offset": 19,
        "text": "This segment has a speling mistake"
      },
      "length": 7,
      "message": "Possible spelling mistake found",
      "offset": 19,
      "replacements": [
        {
          "value": "spelling"
        },
        {
          "value": "spewing"
        },
        {
          "value": "spieling"
        }
      ],
      "rule": {
        "category": {
          "id": "TYPOS",
          "name": "Possible Typo"
        },
        "description": "Possible spelling mistake",
        "id": "MORFOLOGIK_RULE_EN_US",
        "issueType": "misspelling",
        "subId": "string",
        "urls": []
      },
      "shortMessage": "Spelling mistake"
    }
  ]
}