Skip to main content
POST
/
knowledge-bases
/
{kb_id}
/
documents
Add Document
curl --request POST \
  --url https://api.example.com/knowledge-bases/{kb_id}/documents

Path Parameters

ParameterTypeDescription
kb_idstringKnowledge base ID

Request

Content-Type: multipart/form-data
FieldTypeDescription
filefileThe document to upload (PDF, TXT, MD, DOCX)

Processing

The document is processed through:
  1. Chunking — split into overlapping segments
  2. ML enrichment — table and layout extraction (if enabled)
  3. Embedding — vector representations generated
  4. Storage — persisted in PostgreSQL with PGVector

Response

{
  "id": "doc_456",
  "filename": "product-guide.pdf",
  "chunk_count": 28,
  "status": "processed"
}