Skip to main content

Overview

The LILT Cloud Upload API provides secure file upload capabilities using S3-compatible presigned URLs. This system supports both single file uploads and multipart uploads for large files, enabling efficient and secure file transfers directly to cloud storage.

Key Features

  • Direct S3 Uploads: Files are uploaded directly to S3-compatible storage, reducing server load
  • Presigned URL Security: Time-limited, secure URLs with no exposed credentials
  • Multipart Upload Support: Efficient handling of large files through chunked uploads
  • Flexible Client Support: Use any HTTP client library in your preferred programming language
  • Managed Infrastructure: LILT handles all bucket configuration, CORS setup, and storage management

How It Works

The upload process uses AWS S3-compatible presigned URLs for secure file transfers:
  1. Request Upload Parameters: Call the Lilt API to get presigned URL and upload parameters
  2. Upload Directly to Storage: Use the presigned URL to upload files directly to S3-compatible storage
  3. Complete Upload:
    • For multipart uploads, notify the API when all parts are uploaded
    • Poll for antivirus scan completion to get the File ID which you can use for other endpoints (add to jobs or projects)

API Endpoints

1. Initiate Single File Upload

Endpoint: POST /v2/upload/s3/params or GET /v2/upload/s3/params Initiates a single file upload and returns presigned URL for direct upload to storage.

Request Body

Parameters

Response

2. Initiate Multipart Upload

Endpoint: POST /v2/upload/s3/multipart Initiates a multipart upload for large files (recommended for files > 100MB). Make sure your part size is set to 8MB (8388608 bytes).

Request Body

Response

The following parameters are optional and only relevant when uploading video content for translation:
  • extractText: When uploading a video file, set this parameter to True to ensure that text is extracted from the video (if needed).
  • isSourceReviewRequired: When uploading a video file, set this parameter to Trueto indicate that the source content should be reviewed before translation begins.

3. Get Upload Part URL

Endpoint: GET /v2/upload/s3/multipart/{uploadId}/{partNumber} Retrieves a presigned URL for uploading a specific part of a multipart upload.

Parameters

Example Request

Response

4. Complete Multipart Upload

Endpoint: POST /v2/upload/s3/multipart/{uploadId}/complete Completes a multipart upload by providing information about all uploaded parts.

Parameters

Request Body

Response

5. Cancel Multipart Upload

Endpoint: DELETE /v2/upload/s3/multipart/{uploadId} Cancels a multipart upload and cleans up any uploaded parts.

Parameters

Response

Upload Workflows

Simple Upload Flow

Multipart Upload Flow

Implementation Examples

Node.js Example

Python Example

Java Example

Best Practices

File Size Recommendations

  • Small files (< 100MB): Use single file upload (POST /upload/s3/params)
  • Large files (> 100MB): Use multipart upload (POST /upload/s3/multipart)
  • Chunk size: Use 8MB chunks for multipart uploads

Error Handling

Implement retry logic for network errors:

Security Considerations

  • Presigned URLs expire after a configurable time (typically 1 hour)
  • URLs are single-use for uploads
  • All uploads are validated against the original request parameters
  • HTTPS is required for all upload operations

Common Error Responses

400 Bad Request

413 Payload Too Large

403 Forbidden

Support

For questions or issues with the Cloud Upload API, please contact support@lilt.com or refer to the main API documentation.