Skip to main content
POST
Add content to an existing knowledge base
Add a document to an existing knowledge base. Supported formats: PDF, DOCX, DOC, TXT, PPTX, PNG, JPG, JPEG, MD, JSON, plain text, and URLs (single page or full site crawl).

Supported inputs

Upload a file

Upload from a URL

To crawl an entire site:

Response

Indexing status

Documents pass through: queuedprocessingready (or failed). Poll the parent KB to see all documents’ status:

Best practices

  • Clean text beats fancy PDFs. A PDF with unusual layouts, footnotes, or tables retrieves poorly. Convert to Markdown when you can.
  • Split large documents. A 100-page PDF retrieves worse than 10 well-scoped documents.
  • Use titles that describe content. File names show up in retrieval reasoning; hr-leave-policy-2026.pdf beats document-final-v2.pdf.
  • Re-upload changed docs rather than editing. Delete the old one and upload the new one for a clean index.

Common failures

  • unsupported_format: the file isn’t a PDF, DOCX, or text.
  • file_too_large: max 50 MB per file. Split larger files.
  • crawl_failed: the target URL rejected our crawler (robots.txt, auth-gated, JS-only). Provide static, publicly reachable URLs.
  • extraction_low_confidence: the document was successfully processed but content quality is low. Common with heavily-formatted PDFs.

Next steps

Authorizations

x-api-key
string
header
required

Path Parameters

id
string<uuid>
required

UUID of the Knowledge Base to which the content will be added

Example:

"d837afdc-f95f-4e4d-abe4-40894db22a02"

Body

multipart/form-data
text
string
required

Text or URL content to be added to the Knowledge Base

Example:

"Sample knowledge base text or URL like https://docs.trugen.ai/"

input
file

Optional file upload (e.g., .pdf, .docx)

Response

Content added successfully

added
integer
Example:

1

message
string
Example:

"Content added successfully to existing Knowledge Base"