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
}Add a file to an upload session
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.
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
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
Request serializer for file upload.
Type of collection to store the file in ('private' or 'shared')
255512Owner of the file (optional)
Company to associate the file with (optional)
30Workspace ID — required when collection_type is 'shared'
Size of chunks for document processing (optional)
Overlap between chunks (optional)
Additional external metadata for the document (optional)
Show child attributes
Show child attributes
OCR agent to use for processing (optional)
Enable complete document table extraction (optional)
High resolution OCR model name (optional)
OCR processing strategy (optional)
OCR processing timeout in seconds (optional)
OCR service URL (optional)
Enable visual ingestion processing (optional)
Default processing pipeline to use (optional)