Documentation Index
Fetch the complete documentation index at: https://docs.xpander.ai/llms.txt
Use this file to discover all available pages before exploring further.
Upload documents to a knowledge base by providing URLs. The documents will be downloaded, processed, and indexed for semantic search.
Path Parameters
Unique identifier of the knowledge base (UUID format)
Request Body
Array of document URLs to add to the knowledge baseSupported formats:
- PDF documents
- Microsoft Word (.docx, .doc)
- Text files (.txt, .md)
- Web pages (HTML)
- CSV and Excel files
- Presentations (PPTX, PPT)
- JSON and YAML files
Response
Returns an array of created document objects:
Unique identifier for the document (UUID) - initially null, assigned after processing completes
Document name (initially null)
Example Request
curl -X POST -H "x-api-key: <your-api-key>" \
-H "Content-Type: application/json" \
-d '{
"document_urls": [
"https://example.com/product-guide.pdf",
"https://example.com/faq-page"
]
}' \
https://api.xpander.ai/v1/knowledge/<kb-id>/documents
Example Response
[
{
"kb_id": "<kb-id>",
"id": null,
"name": null,
"document_url": "https://example.com/product-guide.pdf"
},
{
"kb_id": "<kb-id>",
"id": null,
"name": null,
"document_url": "https://example.com/faq-page"
}
]
Processing Flow
- Upload - Documents are queued for processing
- Download - System downloads documents from provided URLs
- Extract - Text content is extracted from documents
- Chunk - Content is split into searchable chunks
- Embed - Chunks are converted to vector embeddings
- Index - Embeddings are stored in the vector database
Processing typically takes 10-60 seconds per document depending on size.
Supported File Types
- Documents: PDF, DOCX, DOC, TXT, MD, RTF
- Spreadsheets: CSV, XLSX, XLS
- Presentations: PPTX, PPT
- Web: HTML, XML
- Code: JSON, YAML, various programming languages
Notes
- Documents must be publicly accessible via HTTP/HTTPS
- Maximum file size: 50MB per document
- The
id field is null initially until the document is processed and indexed
- The document ID is assigned after processing/indexing completes
- Use List Documents to check processing progress
- Duplicate URLs will create separate document entries
API Key for authentication
Request model for adding documents to a knowledge base.
Document unique identifier