POST
/
v2
/
segments
Create a Segment
curl --request POST \
  --url https://api.lilt.com/v2/segments \
  --header 'Content-Type: application/json' \
  --data '{
  "memory_id": 10641,
  "document_id": 1876,
  "source": "Code zur Fehleranalyse einschalten",
  "target": "Enable debugging code",
  "shouldApplySegmentation": true,
  "srcLang": "fr"
}'
{
  "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

Body

application/json

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.

source
string
required

The source string.

Example:

"Code zur Fehleranalyse einschalten"

memory_id
integer

A unique Memory identifier.

Example:

10641

document_id
integer

A unique Document identifier.

Example:

1876

target
string

The target string.

Example:

"Enable debugging code"

shouldApplySegmentation
boolean

A flag for whether this segment should be broken down into smaller segments. If this is true then the response is an array of segments.

srcLang
string

A two letter language code for the source language. Required if shouldApplySegmentation is enabled.

Example:

"fr"

Response

A 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.

Example:

84480010

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

document_id
integer

A unique Document identifier.

Example:

1234

memory_id
integer

The Memory with which this Segment is associated.

Example:

5678

source
string

The source string.

Example:

"The red bus."

srclang
string

An ISO 639-1 language code.

Example:

"en"

target
string

The target string.

Example:

"Le bus rouge."

trglang
string

An ISO 639-1 language code.

Example:

"fr"

is_confirmed
boolean

The confirmation status.

Example:

true

is_reviewed
boolean

The review status.

Example:

true