curl --request POST \
--url https://api.lilt.com/v2/upload/s3/params \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"filename": "document.xliff",
"type": "video/mp4",
"metadata": {
"size": 1024,
"category": "documents",
"uuid": "123e4567-e89b-12d3-a456-426614174000",
"labels": [
"important",
"review-needed"
]
}
}
'import requests
url = "https://api.lilt.com/v2/upload/s3/params"
payload = {
"filename": "document.xliff",
"type": "video/mp4",
"metadata": {
"size": 1024,
"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: 'document.xliff',
type: 'video/mp4',
metadata: {
size: 1024,
category: 'documents',
uuid: '123e4567-e89b-12d3-a456-426614174000',
labels: ['important', 'review-needed']
}
})
};
fetch('https://api.lilt.com/v2/upload/s3/params', 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/params",
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' => 'document.xliff',
'type' => 'video/mp4',
'metadata' => [
'size' => 1024,
'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/params"
payload := strings.NewReader("{\n \"filename\": \"document.xliff\",\n \"type\": \"video/mp4\",\n \"metadata\": {\n \"size\": 1024,\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/params")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"filename\": \"document.xliff\",\n \"type\": \"video/mp4\",\n \"metadata\": {\n \"size\": 1024,\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/params")
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\": \"document.xliff\",\n \"type\": \"video/mp4\",\n \"metadata\": {\n \"size\": 1024,\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{
"url": "https://storage.googleapis.com/bucket/uploads/user123/file456.json?...",
"key": "uploads/user123/file456.json",
"method": "PUT"
}{
"message": "Internal server error."
}Initiate File Upload to Cloud Storage
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 }
}
]'
curl --request POST \
--url https://api.lilt.com/v2/upload/s3/params \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"filename": "document.xliff",
"type": "video/mp4",
"metadata": {
"size": 1024,
"category": "documents",
"uuid": "123e4567-e89b-12d3-a456-426614174000",
"labels": [
"important",
"review-needed"
]
}
}
'import requests
url = "https://api.lilt.com/v2/upload/s3/params"
payload = {
"filename": "document.xliff",
"type": "video/mp4",
"metadata": {
"size": 1024,
"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: 'document.xliff',
type: 'video/mp4',
metadata: {
size: 1024,
category: 'documents',
uuid: '123e4567-e89b-12d3-a456-426614174000',
labels: ['important', 'review-needed']
}
})
};
fetch('https://api.lilt.com/v2/upload/s3/params', 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/params",
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' => 'document.xliff',
'type' => 'video/mp4',
'metadata' => [
'size' => 1024,
'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/params"
payload := strings.NewReader("{\n \"filename\": \"document.xliff\",\n \"type\": \"video/mp4\",\n \"metadata\": {\n \"size\": 1024,\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/params")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"filename\": \"document.xliff\",\n \"type\": \"video/mp4\",\n \"metadata\": {\n \"size\": 1024,\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/params")
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\": \"document.xliff\",\n \"type\": \"video/mp4\",\n \"metadata\": {\n \"size\": 1024,\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{
"url": "https://storage.googleapis.com/bucket/uploads/user123/file456.json?...",
"key": "uploads/user123/file456.json",
"method": "PUT"
}{
"message": "Internal server error."
}Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Body
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).
Response
Upload initialization information. Returns a single object for single file requests, or an array of objects for bulk requests.
Was this page helpful?

