Skip to main content
POST
/
v2
/
upload
/
s3
/
multipart
Initiate Multipart Upload
curl --request POST \
  --url https://api.lilt.com/v2/upload/s3/multipart \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "filename": "large-file.zip",
  "type": "application/zip",
  "metadata": {
    "size": 104857600,
    "category": "documents",
    "uuid": "123e4567-e89b-12d3-a456-426614174000",
    "labels": [
      "important",
      "review-needed"
    ]
  }
}
'
import requests

url = "https://api.lilt.com/v2/upload/s3/multipart"

payload = {
"filename": "large-file.zip",
"type": "application/zip",
"metadata": {
"size": 104857600,
"category": "documents",
"uuid": "123e4567-e89b-12d3-a456-426614174000",
"labels": ["important", "review-needed"]
}
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
filename: 'large-file.zip',
type: 'application/zip',
metadata: {
size: 104857600,
category: 'documents',
uuid: '123e4567-e89b-12d3-a456-426614174000',
labels: ['important', 'review-needed']
}
})
};

fetch('https://api.lilt.com/v2/upload/s3/multipart', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.lilt.com/v2/upload/s3/multipart",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'filename' => 'large-file.zip',
'type' => 'application/zip',
'metadata' => [
'size' => 104857600,
'category' => 'documents',
'uuid' => '123e4567-e89b-12d3-a456-426614174000',
'labels' => [
'important',
'review-needed'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.lilt.com/v2/upload/s3/multipart"

payload := strings.NewReader("{\n \"filename\": \"large-file.zip\",\n \"type\": \"application/zip\",\n \"metadata\": {\n \"size\": 104857600,\n \"category\": \"documents\",\n \"uuid\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"labels\": [\n \"important\",\n \"review-needed\"\n ]\n }\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.lilt.com/v2/upload/s3/multipart")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"filename\": \"large-file.zip\",\n \"type\": \"application/zip\",\n \"metadata\": {\n \"size\": 104857600,\n \"category\": \"documents\",\n \"uuid\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"labels\": [\n \"important\",\n \"review-needed\"\n ]\n }\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.lilt.com/v2/upload/s3/multipart")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"filename\": \"large-file.zip\",\n \"type\": \"application/zip\",\n \"metadata\": {\n \"size\": 104857600,\n \"category\": \"documents\",\n \"uuid\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"labels\": [\n \"important\",\n \"review-needed\"\n ]\n }\n}"

response = http.request(request)
puts response.read_body
{
  "uploadId": "abc123def456",
  "key": "uploads/user123/large-file.zip"
}
{
"message": "Internal server error."
}

Authorizations

Authorization
string
header
required

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Body

application/json

Information about the file(s) to be uploaded. Can be a single object or an array of objects (max 100).

Single file request: { "filename": "...", "type": "...", "metadata": {...} } Bulk request: [{ "filename": "...", "type": "...", "metadata": {...} }, ...]

A single upload request object, or an array of upload request objects (max 100).

filename
string
required

A file name including file extension.

Example:

"large-file.zip"

type
string
required

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

Example:

"application/zip"

metadata
object

Optional file metadata.

Response

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

uploadId
string

Multipart upload ID for subsequent part uploads

Example:

"abc123def456"

key
string

Upload key identifier

Example:

"uploads/user123/large-file.zip"