Endpoint
POST /user/knowledgebases/{knowledgebaseId}/documents
Path parameters
Unique identifier of the knowledge base.
Request
Name of the document. Maximum 255 characters.
Document type:
website, pdf, txt, or docx.Optional description. Maximum 255 characters.
Website documents
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 to upload. Maximum 20 MB. Use
multipart/form-data encoding.Document types
| Type | Description | Input |
|---|---|---|
website | Scrapes web pages and extracts text | URL or list of URLs |
pdf | Extracts text from PDF files | PDF file upload |
txt | Plain text content | TXT file upload |
docx | Extracts text from Word documents | DOCX file upload |
Response
Confirmation message.
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.