Lilt Files API

The Files API from Lilt — 3 operation(s) for files.

OpenAPI Specification

lilt-files-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: LILT Create Files 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: Files
paths:
  /v2/files:
    get:
      tags:
      - Files
      summary: Retrieve a File
      description: "Retrieves one or more files available to your user. Files are not associated with a project or a memory. They are unprocessed and can be used later in the project/document creation workflow step.\n\nTo retrieve a specific file, specify the <strong>id</strong> request parameter. To retrieve all files, omit the <strong>id</strong> request parameter.\n\nExample CURL command:\n```bash\n curl -X GET https://api.lilt.com/v2/files?key=API_KEY&id=274\n```"
      operationId: getFiles
      parameters:
      - name: id
        in: query
        description: A unique File identifier.
        schema:
          type: integer
      - name: labels
        in: query
        description: 'One or more labels. This will return the files which contain all of

          the given labels.

          '
        style: form
        explode: false
        schema:
          type: array
          items:
            type: string
      responses:
        '200':
          description: A list of files.
          content:
            application/json:
              schema:
                title: FilesList
                type: array
                items:
                  $ref: '#/components/schemas/SourceFile'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          description: User does not have permission for provided file.
          content: {}
        '410':
          description: File deleted.
          content: {}
        default:
          description: Unexpected error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
    post:
      tags:
      - Files
      summary: Upload a File
      description: "Upload a File in any of the formats [documented in our knowledge\nbase](/kb/supported-file-formats).\nRequest parameters should be passed in as query string parameters.\n\nExample CURL command:\n```bash\n  curl -X POST https://api.lilt.com/v2/files?key=API_KEY&name=en_US.json \\\n  --header \"Content-Type: application/octet-stream\" \\\n  --data-binary @en_US.json\n```\nCalls to GET /files are used to monitor the language detection results. The API response will be augmented to include detected language and confidence score.\n\nThe language detection will complete asynchronously. Prior to completion, the `detected_lang` value will be `zxx`, the reserved ISO 639-2 code for \"No linguistic content/not applicable\".\n\nIf the language can not be determined, or the detection process fails, the `detected_lang` field will return `und`, the reserved ISO 639-2 code for undetermined language, and the `detected_lang_confidence` score will be `0`.\n\n"
      operationId: uploadFile
      parameters:
      - name: name
        in: query
        description: A file name.
        required: true
        schema:
          type: string
      - name: file_hash
        in: query
        description: A hash value to associate with the file. The MD5 hash of the body contents will be used by default if a value isn't provided.
        schema:
          type: string
      - name: langId
        in: query
        description: Flag indicating whether to perform language detection on the uploaded file. Default is false.
        schema:
          type: boolean
      - name: project_id
        in: query
        description: The project to associate the uploaded file with.
        schema:
          type: integer
      - name: category
        in: query
        description: The category of the file. The options are `REFERENCE`, or `API`. The default is API. Files with the `REFERENCE` category will be displayed as reference material.
        schema:
          type: string
      - name: labels
        in: query
        description: Comma-separated list of labels to add to the uploaded document.
        schema:
          type: string
      - in: query
        name: job_type
        description: Specifies the job type when adding this file to a job.
        required: false
        schema:
          type: string
          enum:
          - TRANSLATION
          - PROMPT_RESPONSE
      requestBody:
        description: The file contents to be uploaded. The entire POST body will be treated as the file.
        content:
          application/octet-stream:
            schema:
              title: FileUploadBody
              type: string
              format: binary
              example: '<?xml version="1.0" encoding="UTF-8" standalone="no"?>

                <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2">

                ...

                </xliff>'
        required: true
      responses:
        '201':
          description: A SourceFile object.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SourceFile'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      x-codegen-request-body-name: body
    delete:
      tags:
      - Files
      summary: Delete a File
      description: "Delete a File.\n\nExample CURL command:\n```bash\n  curl -X DELETE https://api.lilt.com/v2/files?key=API_KEY&id=123\n```\n\n"
      operationId: deleteFile
      parameters:
      - name: id
        in: query
        description: A unique File identifier.
        required: true
        schema:
          type: integer
      responses:
        '204':
          description: A status object.
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /v2/files/download:
    get:
      tags:
      - Files
      summary: Download file
      description: 'Download a File.


        Example CURL:

        ```bash

        curl -X GET ''https://api.lilt.com/v2/files/download?key=API_KEY&id=1''

        ```

        '
      operationId: download
      parameters:
      - name: id
        in: query
        description: A File id.
        required: true
        schema:
          type: string
      responses:
        '200':
          description: A file.
          content:
            application/octet-stream:
              schema:
                title: DocumentDownloadResponse
                type: string
                format: byte
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /v2/files/labels:
    post:
      tags:
      - Files
      summary: Add Label to File
      description: "Add a label to a File.\n\nExample CURL:\n```bash\ncurl -X POST 'https://api.lilt.com/v2/files/labels?key=API_KEY&id=1'\n--header 'Content-Type: application/json' \\\n--data-raw '{\n    \"name\": \"label_name\"\n}'\n```\n"
      operationId: addLabel
      parameters:
      - name: id
        in: query
        description: A File id.
        required: true
        schema:
          type: string
      requestBody:
        description: A label name.
        content:
          application/json:
            schema:
              title: AddFileLabelRequest
              type: object
              properties:
                name:
                  type: string
                  description: The Label name.
                  example: label_name
        required: true
      responses:
        '204':
          description: A success response.
          content: {}
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      x-codegen-request-body-name: name
    delete:
      tags:
      - Files
      summary: Remove Label from File
      description: 'Remove a label from a File.


        Example CURL:

        ```bash

        curl -X DELETE ''https://api.lilt.com/v2/files/labels?key=API_KEY&id=1&name=label_name''

        ```

        '
      operationId: removeLabel
      parameters:
      - name: id
        in: query
        description: A File id.
        required: true
        schema:
          type: string
      - name: name
        in: query
        description: A label name.
        required: true
        schema:
          type: string
      responses:
        '204':
          description: A success response.
          content: {}
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
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.
    SourceFile:
      type: object
      properties:
        id:
          type: integer
          description: A unique number identifying the SourceFile.
          example: 46530
        name:
          type: string
          description: The file name.
          example: en_US.json
        file_hash:
          type: string
          description: A unique hash value associated with the file. An MD5 hash of the file content will be used by default.
          example: 3858f62230ac3c915f300c664312c63f
        detected_lang:
          type: string
          description: Language associated with the file.
          example: de
        detected_lang_confidence:
          type: number
          description: Confidence score for the language associated with the file.
          example: 0.7
        category:
          type: string
          description: The category of the file. The options are `REFERENCE`, or `API`. The default is API. Files with the `REFERENCE` category will be displayed as reference material.
          example: REFERENCE
        labels:
          type: array
          description: The list of labels associated with the file.
          example: []
          items:
            type: string
        created_at:
          type: string
          description: Time at which the object was created.
          format: date-time
          example: '2019-10-16T22:12:34Z'
        updated_at:
          type: string
          description: Time at which the object was created.
          format: date-time
          example: '2019-10-16T22:12:34Z'
      description: A SourceFile is an unprocessed source file that can later be added to a project.
  responses:
    UnauthorizedError:
      description: Unauthorized
      content:
        application/octet-stream:
          schema:
            type: string
        text/plain:
          schema:
            type: string
  securitySchemes:
    BasicAuth:
      type: http
      scheme: basic
    ApiKeyAuth:
      type: apiKey
      name: key
      in: query