API Reference
Complete REST API documentation for DocuLume
Base URL
https://api.doculume.comAll API requests should be made to this base URL with the appropriate endpoint path.
Authentication
DocuLume uses JWT (JSON Web Tokens) stored in httpOnly cookies for secure authentication. Cookies are automatically included in requests - no manual headers needed!
Login to Get Cookie
curl -X POST https://api.doculume.com/api/v1/auth/login \
-H "Content-Type: application/json" \
-c cookies.txt \
-d '{
"email": "user@example.com",
"password": "your_password"
}'
# Cookie is automatically set in response (httpOnly, secure)Making Authenticated Requests
# Cookie is automatically sent with subsequent requests
curl -X GET https://api.doculume.com/api/v1/documents/ \
-b cookies.txt
# Or in browser/JavaScript - cookies sent automatically:
fetch('/api/v1/documents/', {
credentials: 'include' // Important: include cookies
})🔒 Security Note: httpOnly cookies cannot be accessed by JavaScript, protecting against XSS attacks. Cookies are also marked as secure and sameSite for additional protection.
Rate Limits
Free Tier
60
requests/minute
Pro Tier
300
requests/minute
Enterprise
Custom
negotiable limits
Authentication
/api/v1/auth/registerRegister a new user account
Request Body:
{ "email": "user@example.com", "password": "secure_password", "full_name": "John Doe" }/api/v1/auth/loginLogin and set httpOnly authentication cookie
Request Body:
{ "email": "user@example.com", "password": "secure_password" }
// Response sets httpOnly cookie automatically/api/v1/auth/refreshRefresh access token (cookie automatically updated)
Request Body:
No body needed - refresh token sent via httpOnly cookieDocuments
/api/v1/documents/uploadUpload a new document
Request Body:
multipart/form-data: { "file": <file> }/api/v1/documents/List all user documents (paginated)
Parameters:
?page=1&page_size=20/api/v1/documents/{id}Get document details
Parameters:
id: Document ID/api/v1/documents/{id}Delete a document
Parameters:
id: Document IDChat
/api/v1/chat/askAsk a question (with or without RAG)
Request Body:
{ "question": "What is this about?", "conversation_id": 1, "use_rag": true, "top_k": 5 }/api/v1/chat/conversationsList all conversations (paginated)
Parameters:
?page=1&page_size=20/api/v1/chat/conversations/{id}Get conversation with messages
Parameters:
id: Conversation ID/api/v1/chat/conversations/{id}Delete a conversation
Parameters:
id: Conversation ID/api/v1/chat/conversations/{id}/exportExport conversation to JSON or PDF
Parameters:
id: Conversation ID, format: json|pdfLLM Settings
/api/v1/settings/llmGet user LLM configuration
/api/v1/settings/llm/providerAdd or update LLM provider
Request Body:
{ "provider_name": "ollama", "config": { "type": "ollama", "base_url": "http://localhost:11434/v1", "model": "llama2" } }/api/v1/settings/llm/provider/{name}Delete LLM provider
Parameters:
name: Provider name/api/v1/settings/llm/testTest LLM provider connection
Request Body:
{ "provider_name": "test", "config": {...} }Users
/api/v1/users/meGet current user profile
/api/v1/users/meUpdate user profile
Request Body:
{ "full_name": "New Name", "email": "newemail@example.com" }HTTP Status Codes
200Success - Request completed successfully201Created - Resource created successfully400Bad Request - Invalid request parameters401Unauthorized - Missing or invalid authentication token404Not Found - Resource not found429Too Many Requests - Rate limit exceeded500Internal Server Error - Server error occurredSDKs & Code Examples
We provide official SDKs and code examples to make integration easier:
🐍 Python
pip install doculume-sdk📦 JavaScript/TypeScript
npm install doculume-js