curl --request PATCH \
--url https://api.lighton.ai/api/v3/files/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form 'title=Updated Document Title'{
"id": 123,
"filename": "project_proposal.pdf",
"workspace": {
"id": 1,
"name": "Engineering Team"
},
"summaries": [
{
"language": "en",
"summary": "This document outlines Q4 initiatives..."
}
],
"title": "Updated Document Title",
"extension": "pdf",
"status": "embedded",
"status_vision": "embedded",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T11:45:00Z",
"total_pages": 25,
"size": 2458624,
"tags": [
{
"id": 1,
"name": "Compliance",
"auto_assigned": false
}
],
"created_by": {
"id": 42,
"first_name": "Jane",
"last_name": "Doe",
"username": "jdoe"
},
"signature": "T1A1B2C3D4E5F6G7H8I9J0K1L2M3N4O5P6Q7R8S9T0U1V2W3X4Y5Z6A7B8C9D0E1F2",
"parser": "v2.2.1",
"external_metadata": null,
"content_types": [
{
"code": "design-doc",
"path": "tech:specification:design-doc",
"label": "Design Document",
"breadcrumb": [
{
"code": "tech",
"path": "tech",
"label": "Tech"
},
{
"code": "specification",
"path": "tech:specification",
"label": "Specification"
},
{
"code": "design-doc",
"path": "tech:specification:design-doc",
"label": "Design Document"
}
],
"attribute_values": {
"owner_team": {
"value": "Platform Engineering",
"type": "text",
"attribute": {
"name": "owner_team",
"label": "Owner Team",
"type": "text",
"required": true
}
},
"maturity": {
"value": "Approved",
"type": "select",
"attribute": {
"name": "maturity",
"label": "Maturity",
"type": "select",
"required": false,
"choices": [
"Draft",
"Review",
"Approved"
]
}
},
"component": {
"value": "Document Retrieval Service",
"type": "text",
"attribute": {
"name": "component",
"label": "Component",
"type": "text",
"required": false
}
}
}
}
],
"pending_reprocess": null
}Update file metadata or replace its file
Update mutable fields of a file (document).
Updatable fields:
title: Update the document titletags: Replace ALL tags for the document (both manual and auto-assigned)external_metadata: Create or update external source metadatafile: Replace the original file and re-ingest the document
Tag replacement behavior:
- Providing a tags array replaces ALL existing tags (manual and auto-assigned)
- To remove all tags, send
[0](sentinel value for multipart format) - Omitting
tagsfield leaves tags unchanged - New tags are marked as manually assigned (
auto_assigned=False)
External metadata behavior:
- When creating for the first time,
external_idis required - When updating existing metadata,
external_idis optional (existing value is preserved) - Fields in
additional_metadataare merged (not replaced) with existing values external_idcannot be changed on a document imported from a datasource: the sync matches its documents on it, so a rename would detach the document from its source.doc_typeandadditional_metadatastay editable
File replacement behavior:
- The document keeps its
id,title, manually assigned tags, content types, attribute values and external metadata. Only the file and everything derived from it (text, chunks, embeddings, auto-assigned tags, summaries) are rebuilt. - Any supported file type is accepted, including one that differs from the current file — the processing statuses are re-derived from the new file.
- Replacing the file additionally requires an owner or editor role in the document’s workspace, and is not available in workspaces configured for synced documents.
- The storage quota is checked on the size difference, not the full new size.
filecan be combined withtitle,tagsandexternal_metadatain the same request: the metadata changes apply immediately, the file is queued.- The response reflects the document as it still is:
filename,extension,size,total_pages,status,signature,summariesandcontentdescribe the previous file until re-ingestion begins. The document keeps serving its previous content — search, extracts and download stay consistent — and leaves the search index only once processing actually starts. pending_reprocessis set toupdateon the response and on subsequent reads, and is the only signal that the queued file has not been processed yet:statusstill reports the previous run’s outcome (typicallyEmbedded) until the pipeline picks the document up. Poll untilpending_reprocessis null andstatusis terminal — treating a terminalstatusalone as completion reports success against the previous file.- Sending a new file while one is already queued replaces the queued file, and a file replacement supersedes any other reprocessing already queued for the document: the most recent request is always the one that goes live.
- Once re-ingestion starts, a document whose new file needs rendering has no rendered PDF until conversion completes.
download?purpose=rendered_pdfserves the original during that window, as it does for any file still being converted, so a viewer can receive a non-PDF body. Gate the viewer onstatusrather than on the download succeeding. - The request is applied in full or not at all: tags are validated before the file is queued, so an invalid tag id rejects the whole request without staging anything.
Public datasets: editing a public-dataset file requires the instance-admin MANAGE_PUBLIC_DATASET permission. A workspace-scoped API key with read access (company opted in via allow_access_to_public_datasets) can see a public-dataset file but is refused permission to edit it — public datasets are read-only.
curl --request PATCH \
--url https://api.lighton.ai/api/v3/files/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form 'title=Updated Document Title'{
"id": 123,
"filename": "project_proposal.pdf",
"workspace": {
"id": 1,
"name": "Engineering Team"
},
"summaries": [
{
"language": "en",
"summary": "This document outlines Q4 initiatives..."
}
],
"title": "Updated Document Title",
"extension": "pdf",
"status": "embedded",
"status_vision": "embedded",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T11:45:00Z",
"total_pages": 25,
"size": 2458624,
"tags": [
{
"id": 1,
"name": "Compliance",
"auto_assigned": false
}
],
"created_by": {
"id": 42,
"first_name": "Jane",
"last_name": "Doe",
"username": "jdoe"
},
"signature": "T1A1B2C3D4E5F6G7H8I9J0K1L2M3N4O5P6Q7R8S9T0U1V2W3X4Y5Z6A7B8C9D0E1F2",
"parser": "v2.2.1",
"external_metadata": null,
"content_types": [
{
"code": "design-doc",
"path": "tech:specification:design-doc",
"label": "Design Document",
"breadcrumb": [
{
"code": "tech",
"path": "tech",
"label": "Tech"
},
{
"code": "specification",
"path": "tech:specification",
"label": "Specification"
},
{
"code": "design-doc",
"path": "tech:specification:design-doc",
"label": "Design Document"
}
],
"attribute_values": {
"owner_team": {
"value": "Platform Engineering",
"type": "text",
"attribute": {
"name": "owner_team",
"label": "Owner Team",
"type": "text",
"required": true
}
},
"maturity": {
"value": "Approved",
"type": "select",
"attribute": {
"name": "maturity",
"label": "Maturity",
"type": "select",
"required": false,
"choices": [
"Draft",
"Review",
"Approved"
]
}
},
"component": {
"value": "Document Retrieval Service",
"type": "text",
"attribute": {
"name": "component",
"label": "Component",
"type": "text",
"required": false
}
}
}
}
],
"pending_reprocess": null
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
A unique integer value identifying this Document.
Body
Request serializer for PATCH /api/v3/files/{id} endpoint.
Allows partial updates to mutable document fields:
- title: Update the document title
- tags: Replace ALL tags for the document (both manual and auto-assigned)
- external_metadata: Create or update external source metadata
- file: Replace the original file and re-ingest (document keeps its id)
Immutable fields (if provided, will return 400):
- filename, workspace_id, parser, etc.
New original file. The document is re-ingested from the new content. Any supported file type is accepted, including one that differs from the current file. Until re-ingestion starts the document still serves its previous content.
Updated title for the document.
255List of tag IDs to replace ALL existing tags (both manual and auto-assigned). To remove all tags when using multipart format, send [0] as the sentinel value.
External source metadata to create or update. external_id is required when no external metadata record exists yet. Fields in additional_metadata are merged (not replaced) with existing values.
Show child attributes
Show child attributes
Response
File updated successfully
Filename of the document
Workspace the document belongs to
Show child attributes
Show child attributes
Document summaries (all languages)
Show child attributes
Show child attributes
File extension of the document
Creation date of the resource
Total number of pages
List of tags associated with the document
Show child attributes
Show child attributes
User who created the file. Null when the file was created by the system.
Show child attributes
Show child attributes
Upload session UUID associated with this document
TLSH hash for duplicate detection.
Facet content types with nested attribute values. Excludable via ?exclude=content_types.
Show child attributes
Show child attributes
Thumbnail preview of the document (256x256 WebP).
Show child attributes
Show child attributes
The reprocessing level queued for this document, or null when none is. Non-null means work has been accepted but has not started yet — status and status_vision still describe the previous run. It clears the moment processing starts, from which point the statuses track the new run. update (a file replacement) additionally leaves the file-derived fields (filename, extension, size, total_pages, signature, summaries, content) describing the previous file until then.
reparse, rechunk, reembed, reembed_vision, update 255pending- Pendingpending_conversion- Pending Conversionconverting- Convertingparsing- Parsingparsing_failed- Parsing Failedembedding- Embeddingembedding_failed- Embedding Failedembedded- Embeddedparsed- Parsedfail- Failupdating- Updating
pending, pending_conversion, converting, parsing, parsing_failed, embedding, embedding_failed, embedded, parsed, fail, updating pending- Pendingprocessing- Processingembedded- Embeddedfail- Fail-- Not available
pending, processing, embedded, fail, - Size of the file in bytes.
Deprecated — use pages[] instead. Full text content of the document, derived from per-page text, as a single flat string. Only included when include_content=true query parameter is provided. Will be removed in a future release.
Per-page document text in the canonical { index, markdown } shape shared with /parse and /ocr. Only included when include_content=true. Intended replacement for the flat content string. For documents ingested before per-page text was stored, the full content is returned as a single page (index 1); empty only when there is no content at all.
Show child attributes
Show child attributes
Detailed error information. Only present when document processing has failed.
Parser/ingestion pipeline used for document processing (e.g., 'v2.1', 'v3.0').
External document metadata
Show child attributes
Show child attributes