POST
/
v2
/
documents
/
files
Upload a File
curl --request POST \
  --url https://api.lilt.com/v2/documents/files \
  --header 'Content-Type: application/octet-stream' \
  --header 'name: <name>' \
  --header 'project_id: <project_id>'
{
  "id": 46530,
  "project_id": 287,
  "srclang": "en",
  "trglang": "de",
  "name": "Introduction.xliff",
  "import_in_progress": false,
  "import_succeeded": false,
  "import_error_message": "Could not parse XML.",
  "export_in_progress": false,
  "export_succeeded": false,
  "export_error_message": "Could not parse XML.",
  "is_pretranslating": false,
  "status": {
    "pretranslation": "idle"
  },
  "translator_email": "translator@example.com",
  "reviewer_email": "reviewer@example.com",
  "created_at": 1489147692,
  "updated_at": 1489147692,
  "is_review_complete": true,
  "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
    }
  ]
}

Authorizations

key
string
query
required

Headers

name
string
required

A file name.

project_id
integer
required

A unique Project identifier.

pretranslate
string

An optional parameter indicating if and how the document will be pretranslated upon being uploaded. The accepted values are TM, or TM+MT

auto_accept
boolean

An optional parameter to auto-accept segments with 100% translation memory matches when the pretranslate option is also set, or to auto-accept any target data that is present when the uploaded file is XLIFF. If omitted it will default to your organization settings for Accept and lock exact matches, if set to false, no segments will be auto-accepted.

case_sensitive
boolean

An optional parameter to use case sensitive translation memory matching when the pretranslate option is also enabled. Matches must have identical character-by-character case to qualify as matches. Default value matches your organization settings for Use case sensitive translation memory matching setting

match_attribution
boolean

An optional parameter to attribute translation authorship of exact matches to the author of the file when the pretranslate option is also enabled. Default value matches your organization settings for Translation authorship setting

config_id
integer

An optional pararameter to specify an import configuration to be applied when extracting translatable content from this file.

Body

application/octet-stream · file

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

The body is of type file.

Response

A Document object.

A Document is a collection of zero or more Segments.

id
integer

A unique number identifying the Document.

Example:

46530

project_id
integer

A unique number identifying the Project.

Example:

287

srclang
string

An ISO 639-1 language identifier.

Example:

"en"

trglang
string

An ISO 639-1 language identifier.

Example:

"de"

name
string

The document name.

Example:

"Introduction.xliff"

import_in_progress
boolean

True if the document is currently being imported

Example:

false

import_succeeded
boolean

True if the import process succeeded.

Example:

false

import_error_message
string

Error message if import_succeeded=false

Example:

"Could not parse XML."

export_in_progress
boolean

True if the document is currently being exported for download

Example:

false

export_succeeded
boolean

True if the export process succeeded.

Example:

false

export_error_message
string

Error message if export_succeeded=false

Example:

"Could not parse XML."

is_pretranslating
boolean

True if the document is currently being pretranslated.

Example:

false

status
object

A list of translations for the query term.

Example:
{ "pretranslation": "idle" }
translator_email
string

The email of the assigned translator.

Example:

"translator@example.com"

reviewer_email
string

The email of the assigned reviewer.

Example:

"reviewer@example.com"

created_at
integer

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

Example:

1489147692

updated_at
integer

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

Example:

1489147692

is_review_complete
boolean

Document review status.

Example:

true

segments
object[]

A list of Segments.