Skip to main content
POST
/
api
/
v2
/
files
Upload a document
curl --request POST \
  --url https://paradigm.lighton.ai/api/v2/files \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "file": "@document.pdf"
}'
{
  "id": 1,
  "object": "list",
  "bytes": 20032,
  "created_at": 1631533200,
  "filename": "document.pdf",
  "purpose": "documents",
  "status": "embedded"
}

Authorizations

Authorization
string
header
required

Bearer token authentication

Body

Request serializer for file upload.

file
string<uri>
required
title
string | null
Maximum length: 255
filename
string | null
Maximum length: 512
collection
integer | null
owner
integer

Owner of the file (optional)

company
integer

Company to associate the file with (optional)

content
string | null
file_type
any
collection_type
any

Type of collection to store the file in (private, company, or workspace)

  • private - private
  • company - company
  • workspace - workspace
workspace_id
integer

Workspace ID when collection_type is 'workspace'

chunk_size
integer

Size of chunks for document processing (optional)

chunk_overlap
number

Overlap between chunks (optional)

OCR_AGENT
string

OCR agent to use for processing (optional)

OCR_COMPLETE_DOC_TABLE_EXTRACTION
boolean | null

Enable complete document table extraction (optional)

OCR_HI_RES_MODEL_NAME
string

High resolution OCR model name (optional)

OCR_STRATEGY
string

OCR processing strategy (optional)

OCR_TIMEOUT
integer

OCR processing timeout in seconds (optional)

OCR_URL
string

OCR service URL (optional)

IS_VISUAL_INGESTION_ON
boolean | null

Enable visual ingestion processing (optional)

DEFAULT_PIPELINE
string

Default processing pipeline to use (optional)

Response

Document uploaded successfully

Response serializer for file upload results.

id
integer
required

Unique identifier for the uploaded file

object
string
required

Object type, always 'file'

bytes
integer
required

Size of the file in bytes

created_at
integer
required

Unix timestamp of when the file was created

filename
string
required

Original filename of the uploaded file

purpose
string
required

Purpose of the file, always 'documents'

status
string
required

Processing status of the file

I