Lilt Segments API

The Segments API from Lilt — 3 operation(s) for segments.

OpenAPI Specification

lilt-segments-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: LILT Create Segments API
  description: "LILT API Support: https://lilt.atlassian.net/servicedesk/customer/portals\n\nThe LILT API enables programmatic access to the full-range of LILT backend services including:\n  * Training of and translating with interactive, adaptive machine translation\n  * Large-scale translation memory\n  * The Lexicon (a large-scale termbase)\n  * Programmatic control of the LILT CAT environment\n  * Translation memory synchronization\n\n\nRequests and responses are in JSON format. The REST API only responds to HTTPS / SSL requests.\n\nThe base url for this REST API is `https://api.lilt.com/`.\n\n## Authentication\n\nRequests are authenticated via API key, which requires the Business plan.\n\nRequests are authenticated using [HTTP Basic Auth](https://en.wikipedia.org/wiki/Basic_access_authentication). Add your API key as both the `username` and `password`.\n\nFor development, you may also pass the API key via the `key` query parameter. This is less secure than HTTP Basic Auth, and is not recommended for production use.\n\n## Quotas\n\nOur services have a general quota of 4000 requests per minute. Should you hit the maximum requests per minute, you will need to wait 60 seconds before you can send another request.\n"
  version: v3.0.3
  license:
    name: LILT Platform Terms and Conditions
    url: https://lilt.com/lilt-platform-terms-and-conditions
servers:
- url: https://api.lilt.com
security:
- BasicAuth: []
- ApiKeyAuth: []
tags:
- name: Segments
paths:
  /v2/segments:
    post:
      description: 'Create a Segment and add it to a Memory or a Document. 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.


        '
      operationId: createSegment
      requestBody:
        description: '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.

          '
        required: true
        content:
          application/json:
            schema:
              title: SegmentCreateParameters
              type: object
              properties:
                memory_id:
                  description: A unique Memory identifier.
                  type: integer
                  example: 10641
                document_id:
                  description: A unique Document identifier.
                  type: integer
                  example: 1876
                source:
                  description: The source string.
                  type: string
                  example: Code zur Fehleranalyse einschalten
                target:
                  description: The target string.
                  type: string
                  example: Enable debugging code
                shouldApplySegmentation:
                  description: 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.
                  type: boolean
                srcLang:
                  description: A two letter language code for the source language. Required if `shouldApplySegmentation` is enabled.
                  type: string
                  example: fr
              required:
              - source
      responses:
        '200':
          description: A Segment object.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Segment'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      summary: Create a Segment
      tags:
      - Segments
    get:
      description: 'Retrieve a Segment.


        '
      operationId: getSegment
      parameters:
      - description: A unique Segment identifier.
        in: query
        name: id
        required: true
        schema:
          type: integer
      - description: Include comments in the response.
        in: query
        name: include_comments
        schema:
          type: boolean
          default: false
        required: false
      responses:
        '200':
          description: A Segment object.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Segment'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      summary: Retrieve a Segment
      tags:
      - Segments
    put:
      description: 'Update a Segment in memory. The Memory will be updated with the new target string.


        '
      operationId: updateSegment
      requestBody:
        description: The Segment resource to update.
        content:
          application/json:
            schema:
              title: SegmentUpdateParameters
              type: object
              properties:
                id:
                  description: A unique Segment identifier.
                  type: integer
                  example: 84480010
                target:
                  description: The target string.
                  type: string
                  example: Enable debug code
              required:
              - id
              - target
        required: true
      responses:
        '200':
          description: A Segment object.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Segment'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      summary: Update a Segment
      tags:
      - Segments
    delete:
      description: 'Delete a Segment from memory. This will not delete a segment from a document.

        '
      operationId: deleteSegment
      parameters:
      - description: A unique Segment identifier.
        in: query
        name: id
        required: true
        schema:
          type: integer
      responses:
        '200':
          description: A status object.
          content:
            application/json:
              schema:
                title: SegmentDeleteResponse
                type: object
                properties:
                  id:
                    description: A unique Segment identifier.
                    type: integer
                    example: 46530
                  deleted:
                    description: If the operation succeeded, then `true`. Otherwise, `false`.
                    type: boolean
                    example: true
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      summary: Delete a Segment
      tags:
      - Segments
  /v2/segments/review/unlock:
    post:
      description: "Unaccept and unlock segments.\nSets individual segments' \"Review Done\" to false. Confirmed segments will remain confirmed.\n\nExample curl:\n```\n  curl --X --request POST 'https://lilt.com/2/segments/review/unlock?key=API_KEY' \\\n  --header 'Content-Type: application/json' \\\n  --data-raw '{\n      \"segmentIds\": [23921, 23922]\n  }'\n```\n"
      operationId: unlockSegments
      requestBody:
        description: segment ids to update
        required: true
        content:
          application/json:
            schema:
              title: SegmentDoneResponse
              type: object
              properties:
                segmentIds:
                  description: array of segment ids
                  type: array
                  example:
                  - 30032
                  - 30125
                  items:
                    type: number
              required:
              - segmentIds
      summary: Unaccept and unlock segments
      tags:
      - Segments
      responses:
        '200':
          description: array of updated segments
          content:
            application/json:
              schema:
                title: SegmentDoneResponse
                type: array
                items:
                  type: number
  /v2/segments/tag:
    get:
      description: '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 REST API keys.


        '
      operationId: tagSegment
      parameters:
      - description: The tagged source string.
        in: query
        name: source_tagged
        required: true
        schema:
          type: string
      - description: The target string.
        in: query
        name: target
        required: true
        schema:
          type: string
      - description: A unique Memory identifier.
        in: query
        name: memory_id
        required: true
        schema:
          type: integer
      responses:
        '200':
          description: A TaggedSegment object.
          content:
            application/json:
              schema:
                title: TaggedSegment
                type: object
                properties:
                  source_tagged:
                    type: string
                    description: The tagged source string.
                  target_tagged:
                    type: string
                    description: The tagged target string.
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      summary: Tag a Segment
      tags:
      - Segments
components:
  schemas:
    Error:
      type: object
      properties:
        message:
          type: string
          description: A human-readable message describing the error.
      description: 'Response in the event of an unexpected error.

        '
      example:
        message: Internal server error.
    Segment:
      type: object
      properties:
        id:
          type: integer
          format: int64
          description: A unique number identifying the Segment.
          example: 84480010
        created_at:
          type: integer
          description: Time at which the object was created. Measured in seconds since the Unix epoch.
          example: 1489147692
        updated_at:
          type: integer
          description: Time at which the object was created. Measured in seconds since the Unix epoch.
          example: 1489147692
        document_id:
          type: integer
          description: A unique Document identifier.
          example: 1234
        memory_id:
          type: integer
          description: The Memory with which this Segment is associated.
          example: 5678
        source:
          type: string
          description: The source string.
          example: The red bus.
        srclang:
          type: string
          description: An ISO 639-1 language code.
          example: en
        target:
          type: string
          description: The target string.
          example: Le bus rouge.
        trglang:
          type: string
          description: An ISO 639-1 language code.
          example: fr
        is_confirmed:
          type: boolean
          description: The confirmation status.
          example: true
        is_reviewed:
          type: boolean
          description: The review status.
          example: true
      description: '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.

        '
  securitySchemes:
    BasicAuth:
      type: http
      scheme: basic
    ApiKeyAuth:
      type: apiKey
      name: key
      in: query