Intake
Ingest documents
Documents are the raw material of the knowledge base. Post markdown to /api/v1/documents and eli.ai commits the vault save, chunks, and full-text index before returning 201. Embedding and graph enrichment continue as detached work. This guide covers the full lifecycle: create, list, read, update, delete, and what the storage response does and does not guarantee.
Prerequisites
- A key with
kb:write(to create/update/delete) andkb:read(to list/read). See Getting started. - For a cross-workspace user key, an
X-Workspace-Idheader on every request.
Create a document
Supply markdown content and, normally, a vault path. The path may be omitted and derived; content may be omitted when creating a titled placeholder. The response is stored-document metadata only: docId, normalized path, content hash, and title.
/api/v1/documentsBearer · kb:writeSave markdown through the vault. The file, metadata, chunks, and full-text index commit before 201; embedding warm-up is detached and extraction is handed to the worker queue.
Request body
201 is storage readiness, not enrichment readiness
From document to graph
The 201 means the vault file, document metadata, chunks, and full-text index have committed. Embedding warm-up is started without delaying the response, and entity/relation extraction is handed to the worker queue. The create payload does not report either enrichment stage.
Document ingestion pipeline
Storage, chunks, and FTS commit first; enrichment continues independently.
Downloads
Concepts
- Ingest documents
- Guides
- Ingest
Keywords
- POST /documents
- markdown body
- committed save
- stored metadata
- embedding warm-up
- entity graph grows
- vault · metadata · chunks · FTS
- entity + relation extraction
Source and generation provenance
Status: current
Generated at: 2026-08-12T23:38:01.146Z
Source hash: feaa5d28a6cd761773fe12fd5d7fa73de1736a2f46b71d550876226a17dd0f5f
Metadata payload hash: 9937cc11041577936fb52acff2618d5261d968fd66a5e44c37ae32d2e96ae212
Canonical appearance
src/app/(docs)/docs/guides/ingest-documents/page.tsx:26 route /docs/guides/ingest-documents
All appearances
canonical—src/app/(docs)/docs/guides/ingest-documents/page.tsx:26route/docs/guides/ingest-documents
No mirrored appearances.
Generation versions
App: eli-ai 0.1.0
Mermaid: 11.16.0 · Mermaid CLI: 11.16.0
Node: v26.3.1 · Yarn: 4.17.1
Renderer config hash: 68c10966fe84406ee626034d58bfabd555df9f65f691204b7c46db24038da101
Renderer theme hash: c80287a78d80ad63d27bd5ca348b2ef9a7e2f44da289e436be6484ea28a1b033
Adapter versions: diagramGenerator=2, drawioFlowchart=1, drawioGantt=1, drawioSequence=1, drawioState=1
Full sidecar JSON: document-ingestion-pipeline-feaa5d28.json
Extraction is what turns prose into structure: it reads the chunks, proposes entities and typed relations, and links each to the chunk it came from as a mention. Crucially, extraction reuses existing entities by normalized name — so a document that mentions "Northwind Trading Co" attaches to the same entity a prior document or a manual edit already created, rather than duplicating it. Read the model in Entity graph.
List & read
/api/v1/documentsBearer · kb:readList live, ACL-visible documents alphabetically by path. Paginate with limit/offset.
Query parameters
/api/v1/documents/{id}Bearer · kb:readFetch stored metadata plus full markdown content. missing is true when metadata exists but the vault file cannot be read. An id in another workspace is invisible under RLS → 404.
Update
PATCHrequires the complete replacement content. It commits the updated file, chunks, full-text index, revision, and audit row before responding, then starts the same detached embedding and extraction work. Extraction replaces the document's prior machine projection atomically when it runs.
/api/v1/documents/{id}Bearer · kb:writeReplace a document's markdown content. The durable save/chunk/FTS work commits before the response; enrichment is detached.
Request body
Delete
Deletion moves the file toward recoverable vault trash and commits the document tombstone, graph-provenance cleanup, chunk/vector removal, terminal revision, and audit event as one database transaction. That atomic cleanup prevents retrieval from seeing a half-deleted graph or index. See the full cascade in Export & offboarding.
/api/v1/documents/{id}Bearer · kb:writeSoft-delete a document; atomically tombstone metadata and remove graph/chunk-derived data.
Errors
400 for invalid JSON, pagination, path, or a PATCH without required content; 401 for a bad key, 403 when the key lacks kb:write, and 404 for an unknown or other-workspace id. Details in Errors & rate limits.The leverage
One POST is a document; a stream of them is a self-organizing knowledge graph. Point your CRM, ticket system, or meeting-notes pipeline at this endpoint and every artifact becomes searchable through committed FTS when it lands and available to semantic/graph retrieval as detached enrichment completes — with no schema required up front because extraction discovers the structure. Then ask questions of everything you've fed in, or curate the graph by hand where extraction needs a human's judgment.