Skip to main content
This endpoint creates a new document in a knowledgebase. Documents are processed asynchronously - the endpoint returns immediately while processing continues in the background.

Path Parameters

knowledgebaseId integer required The unique identifier of the knowledgebase

Request Body

name string required The name of the document (max 255 characters) description string Optional description of the document (max 255 characters) type string required Document type: website, pdf, txt, or docx

Website Documents

url string The main URL to scrape. Required if links is not provided. links array Array of specific URLs to scrape. Required if url is not provided. links properties link string required A valid URL to include in the document relative_links_limit integer (default: 10) Maximum number of relative links to follow when scraping (1-50)

File Documents (PDF, TXT, DOCX)

file file required The file to upload (max 20MB). Use multipart/form-data encoding.

Response

message string Success message data object The created document object data properties id integer The unique identifier of the document name string The name of the document description string Description of the document type string Document type type_label string Human-readable type label status string Processing status (will be processing initially) status_label string Human-readable status label created_at string ISO 8601 timestamp of creation
201 Website Document Created
201 PDF Document Created
404 Knowledgebase Not Found
422 Validation Error
500 Processing Error

Document Types

Example: Creating a Website Document

Example: Uploading a PDF Document

Document processing is asynchronous. Poll the get document endpoint to check when processing is complete.