Knowledge
The knowledge base holds the documents you add to LVNG. Upload a file and LVNG reads its text, splits it into passages and stores them, so you and Tron can search them later. Every document belongs to your organization, one workspace, or only you.
/api/knowledge|Auth: session token or API key (except health)|Rate limit: 30 requests/minFile types: PDF, Word (.docx), text, Markdown, JSON, YAML, XML, HTML and source code files, up to 50 MB each. Any other type is refused with 415 and the list of supported extensions.
API key scopes: uploading needs write or knowledge:write; searching and reading a document need read or knowledge:read. A key made for one workspace adds documents only to that workspace or to your own documents.
Health Check
/api/knowledge/healthSays the knowledge service is up and lists the file extensions it reads. Does not require authentication.
Request
curl -X GET "https://api.lvng.ai/api/knowledge/health" \
-H "Authorization: Bearer YOUR_API_KEY"Response 200
{
"status": "ok",
"service": "knowledge-api",
"version": "1.0.0",
"supportedFormats": [".pdf", ".docx", ".txt", ".md", ".json", ".yaml", ".html"],
"timestamp": "2026-10-13T10:00:00.000Z"
}Upload a Document
/api/knowledge/uploadAuthenticatedUploads one file as multipart/form-data (field name file). LVNG reads its text, splits it into passages and stores the document with its original. Answers 201 with the new document's id. A JSON body is refused with 400 'No file uploaded'.
Body Parameters
filefilerequiredThe document to add.
scopestring"organization"Who can read it: organization, workspace or personal.
workspaceIdstring (UUID)The workspace to add it to. Required when scope is workspace; you must be an owner, admin or member there.
categorystring"general"A category to file it under.
tagsstring (JSON array)"[]"Tags as a JSON array, for example ["hr","handbook"].
chunkSizenumber1000Characters per passage.
chunkOverlapnumber200Characters shared by neighbouring passages.
Request
curl -X POST https://api.lvng.ai/api/knowledge/upload \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "file=@remote-work-policy.pdf" \
-F "category=policies" \
-F 'tags=["hr","handbook"]' \
-F "scope=organization"Response 201
{
"success": true,
"document": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"fileName": "remote-work-policy.pdf",
"filePath": null,
"originalStorage": "object-storage",
"fileSize": 48213,
"fileType": "pdf",
"textLength": 9120,
"chunkCount": 11
},
"message": "Document processed successfully"
}/api/knowledge/upload/batchAuthenticatedUploads up to 10 files in one multipart/form-data request (field name files). Takes the same scope, workspaceId, category and tags fields as a single upload. A file that cannot be read is listed in errors; the others are still added. A file of an unsupported type refuses the whole request with 415, and nothing is added.
Body Parameters
filesfile[]requiredUp to 10 documents.
scopestring"organization"organization, workspace or personal.
workspaceIdstring (UUID)Required when scope is workspace.
Request
curl -X POST https://api.lvng.ai/api/knowledge/upload/batch \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "files=@remote-work-policy.pdf" \
-F "files=@expense-policy.docx" \
-F "category=policies" \
-F "scope=organization"Response 201
{
"success": true,
"results": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"fileName": "remote-work-policy.pdf",
"fileSize": 48213,
"fileType": "pdf",
"textLength": 9120,
"chunkCount": 11,
"scope": "organization"
},
{
"id": "c3d4e5f6-a7b8-9012-cdef-123456789012",
"fileName": "expense-policy.docx",
"fileSize": 22950,
"fileType": "docx",
"textLength": 4410,
"chunkCount": 6,
"scope": "organization"
}
],
"errors": [],
"successCount": 2,
"errorCount": 0,
"message": "Processed 2/2 documents successfully"
}Documents
/api/knowledge/documentsAuthenticatedLists the documents you can read: your organization's, the open workspace's and your own, newest first.
Query Parameters
limitnumber50Documents per page.
offsetnumber0Documents to skip.
scopestringOnly one scope: organization, workspace or personal.
categorystringOnly this category.
tagstringOnly documents with this tag.
Request
curl -X GET "https://api.lvng.ai/api/knowledge/documents" \
-H "Authorization: Bearer YOUR_API_KEY"Response 200
{
"success": true,
"documents": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"fileName": "remote-work-policy.pdf",
"fileType": "pdf",
"category": "policies",
"tags": ["hr", "handbook"],
"textLength": 9120,
"chunkCount": 11,
"uploadedAt": "2026-10-13T09:58:00.000Z",
"size": 48213,
"updated": "2026-10-13T09:58:00.000Z",
"scope": "organization",
"metadata": {}
}
],
"count": 1,
"limit": 50,
"offset": 0,
"tenantContext": { "customerId": "c0ffee00-1234-4abc-9def-000000000001", "scope": "all" }
}/api/knowledge/document/:idAuthenticatedReturns one document and its passages. Answers 404 when the document does not exist or you cannot read it.
Path Parameters
idstring (UUID)requiredThe document id.
Request
curl -X GET "https://api.lvng.ai/api/knowledge/document/{id}" \
-H "Authorization: Bearer YOUR_API_KEY"Response 200
{
"document": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"fileName": "remote-work-policy.pdf",
"fileType": "pdf",
"category": "policies",
"tags": ["hr", "handbook"],
"textLength": 9120,
"chunkCount": 11,
"uploadedAt": "2026-10-13T09:58:00.000Z",
"scope": "organization",
"metadata": {}
},
"chunks": [
{
"id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"text": "All team members may work remotely up to 3 days per week...",
"chunkIndex": 0,
"chunkSize": 1000
}
]
}/api/knowledge/document/:id/downloadAuthenticatedDownloads the original file as an attachment. For a document whose original is not kept, it sends the stored text (Content-Type text/plain) under the document's file name.
Path Parameters
idstring (UUID)requiredThe document id.
Request
curl -X GET "https://api.lvng.ai/api/knowledge/document/{id}/download" \
-H "Authorization: Bearer YOUR_API_KEY"Response 200
Content-Disposition: attachment; filename="remote-work-policy.pdf"
Content-Type: application/octet-stream
<file bytes>/api/knowledge/documents/:id/statusAuthenticatedSays whether a document's passages are stored yet: pending, processing or indexed, with a percentage.
Path Parameters
idstring (UUID)requiredThe document id.
Request
curl -X GET "https://api.lvng.ai/api/knowledge/documents/{id}/status" \
-H "Authorization: Bearer YOUR_API_KEY"Response 200
{
"success": true,
"status": "indexed",
"processingProgress": 100,
"document": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"fileName": "remote-work-policy.pdf",
"fileType": "pdf",
"chunkCount": 11,
"uploadedAt": "2026-10-13T09:58:00.000Z"
}
}/api/knowledge/document/:idAuthenticatedDeletes a document, its passages and its stored original. Answers 404 when the document does not exist or is not yours to delete.
Path Parameters
idstring (UUID)requiredThe document id.
Request
curl -X DELETE "https://api.lvng.ai/api/knowledge/document/{id}" \
-H "Authorization: Bearer YOUR_API_KEY"Response 200
{
"success": true,
"message": "Document deleted: remote-work-policy.pdf"
}Search
/api/knowledge/searchAuthenticatedFinds the passages that contain your query (case does not matter) in the documents you can read, with the document each one comes from.
Body Parameters
querystringrequiredThe text to look for.
limitnumber10Maximum passages to return.
scopestringOnly one scope: organization, workspace or personal.
categorystringOnly documents in this category.
tagsstring[]Only documents with any of these tags.
Request
curl -X POST https://api.lvng.ai/api/knowledge/search \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "remote work",
"limit": 10
}'Response 200
{
"success": true,
"query": "remote work",
"results": [
{
"document": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"fileName": "remote-work-policy.pdf",
"fileType": "pdf",
"category": "policies",
"scope": "organization"
},
"chunk": {
"id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"text": "All team members may work remotely up to 3 days per week...",
"chunkIndex": 0
}
}
],
"count": 1,
"tenantContext": { "customerId": "c0ffee00-1234-4abc-9def-000000000001", "scope": "all" }
}Statistics
/api/knowledge/statsAuthenticatedTotals for the documents you can read: documents, passages, characters, and the file types, categories and scopes in use.
Query Parameters
scopestringOnly one scope: organization, workspace or personal.
Request
curl -X GET "https://api.lvng.ai/api/knowledge/stats" \
-H "Authorization: Bearer YOUR_API_KEY"Response 200
{
"documentCount": 12,
"chunkCount": 214,
"totalCharacters": 187340,
"fileTypes": ["pdf", "md", "docx"],
"categories": ["policies", "general"],
"scopes": ["organization", "personal"],
"supportedFormats": [".pdf", ".docx", ".txt", ".md", ".json", ".yaml", ".html"],
"tenantContext": { "customerId": "c0ffee00-1234-4abc-9def-000000000001", "scope": "all" }
}