Add a document to a KB (text or file)
POST/v1/knowledge-bases/:kb_id/documents
Add a document to a knowledge base. The content is chunked and embedded synchronously, so it is searchable as soon as the call returns.
Provide either raw text or markdown in content, or a file in file_base64
together with a filename whose extension identifies the type — PDF, DOCX,
PPTX, XLSX, CSV, JSON and TXT are extracted server-side. title and an
arbitrary metadata object are optional; metadata comes back with every
search hit, which makes it the natural place for source URLs, owners or tags
you want to filter and cite on.
Because embedding runs inline, large files take proportionally longer.
Requires the knowledge:write scope.
Request
Responses
- 201
- 400
- 401
- 403
- 404
- 422
- 429
Successful Response
Error
Error
Error
Error
Validation Error
Error