Skip to main content
Adds a new document to a knowledge base. Documents are processed asynchronously — the endpoint returns immediately while processing continues in the background.

Endpoint

POST /user/knowledgebases/{knowledgebaseId}/documents

Path parameters

integer
required
Unique identifier of the knowledge base.

Request

string
required
Name of the document. Maximum 255 characters.
string
required
Document type: website, pdf, txt, or docx.
string
Optional description. Maximum 255 characters.

Website documents

string
Main URL to scrape. Required if links is not provided.
Specific URLs to scrape. Required if url is not provided.
Maximum number of relative links to follow when scraping. Range: 1–50.

File documents (PDF, TXT, DOCX)

file
required
File to upload. Maximum 20 MB. Use multipart/form-data encoding.

Document types

Response

string
Confirmation message.
object
The created document.

Example

201 Created
404 Knowledge base not found
Document processing is asynchronous. Poll the knowledge base status using Get knowledge bases to check when all documents are ready.