Add a file to an upload session
curl --request POST \
--url https://api.lighton.ai/api/v2/upload-session/{uuid} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form 'file=<string>' \
--form 'collection_type=<string>'import requests
url = "https://api.lighton.ai/api/v2/upload-session/{uuid}"
payload = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"collection_type\"\r\n\r\n<string>\r\n-----011000010111000001101001--"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "multipart/form-data"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
form.append('collection_type', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.lighton.ai/api/v2/upload-session/{uuid}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"message": "<string>",
"id": 123
}Upload Sessions
Add a file to an upload session
deprecated
Deprecated — this endpoint will be removed in a future release. Use POST /api/v3/files instead, which automatically manages upload sessions.
Upload a new file to an existing upload session.
collection_type is required and must be one of:
private— upload to the caller’s personal workspaceshared— upload to a specific shared workspace;workspace_idis required
Passing collection_type=company returns HTTP 400.
POST
/
api
/
v2
/
upload-session
/
{uuid}
Add a file to an upload session
curl --request POST \
--url https://api.lighton.ai/api/v2/upload-session/{uuid} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form 'file=<string>' \
--form 'collection_type=<string>'import requests
url = "https://api.lighton.ai/api/v2/upload-session/{uuid}"
payload = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"collection_type\"\r\n\r\n<string>\r\n-----011000010111000001101001--"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "multipart/form-data"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
form.append('collection_type', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.lighton.ai/api/v2/upload-session/{uuid}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"message": "<string>",
"id": 123
}Authorizations
Body
multipart/form-data
Request serializer for file upload.