Uploads

Initiate File Upload to Cloud Storage

Changed on

Initiate the upload of a file to cloud storage. This endpoint provides the necessary information to complete the file upload process.

Supports both single file and bulk upload requests. For bulk uploads, pass an array of upload objects (maximum 100 items). The response format matches the request format - a single object for single file requests, or an array for bulk requests.

Example CURL command (single file):

  curl -X POST https://lilt.com/v2/upload/s3/params?key=API_KEY \
  --header "Content-Type: application/json" \
  --data-raw '{
    "filename": "example.json",
    "type": "application/json",
    "metadata": {
      "size": 1024,
      "labels": ["important", "review-needed"]
    }
  }'

Example CURL command (bulk upload):

  curl -X POST https://lilt.com/v2/upload/s3/params?key=API_KEY \
  --header "Content-Type: application/json" \
  --data-raw '[
    {
      "filename": "file1.json",
      "type": "application/json",
      "metadata": { "size": 1024 }
    },
    {
      "filename": "file2.txt",
      "type": "text/plain",
      "metadata": { "size": 2048 }
    }
  ]'
post/v2/upload/s3/params

Request

  • Base URL
    https://api.lilt.com
  • URL
    https://api.lilt.com/v2/upload/s3/params
  • Auth
    HTTP basic

Request body

filenamestring required

A file name including file extension.

typestring required

The content-type or mime-type of the file to upload.

Example request

{
  "filename": "document.xliff",
  "type": "video/mp4",
  "metadata": {
    "size": 1024,
    "category": "documents",
    "uuid": "123e4567-e89b-12d3-a456-426614174000",
    "labels": [
      "important",
      "review-needed"
    ]
  }
}

Response

Upload initialization information. Returns a single object for single file requests, or an array of objects for bulk requests.

urlstring

Pre-signed URL for file upload

keystring

Upload key identifier

methodstring

HTTP method to use for upload

Example response

{
  "url": "https://storage.googleapis.com/bucket/uploads/user123/file456.json?...",
  "key": "uploads/user123/file456.json",
  "method": "PUT"
}

Changes

    • breaking

      added required request body

    • info

      api operation id initiateS3Upload was added

    • info

      added the success response with the status