Back to documentation

API Reference

Complete REST API documentation for DocuLume

Base URL

https://api.doculume.com

All 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

POST/api/v1/auth/register

Register a new user account

Request Body:

{ "email": "user@example.com", "password": "secure_password", "full_name": "John Doe" }
POST/api/v1/auth/login

Login and set httpOnly authentication cookie

Request Body:

{ "email": "user@example.com", "password": "secure_password" }

// Response sets httpOnly cookie automatically
POST/api/v1/auth/refresh

Refresh access token (cookie automatically updated)

Request Body:

No body needed - refresh token sent via httpOnly cookie

Documents

POST/api/v1/documents/upload

Upload a new document

Request Body:

multipart/form-data: { "file": <file> }
GET/api/v1/documents/

List all user documents (paginated)

Parameters:

?page=1&page_size=20
GET/api/v1/documents/{id}

Get document details

Parameters:

id: Document ID
DELETE/api/v1/documents/{id}

Delete a document

Parameters:

id: Document ID

Chat

POST/api/v1/chat/ask

Ask a question (with or without RAG)

Request Body:

{ "question": "What is this about?", "conversation_id": 1, "use_rag": true, "top_k": 5 }
GET/api/v1/chat/conversations

List all conversations (paginated)

Parameters:

?page=1&page_size=20
GET/api/v1/chat/conversations/{id}

Get conversation with messages

Parameters:

id: Conversation ID
DELETE/api/v1/chat/conversations/{id}

Delete a conversation

Parameters:

id: Conversation ID
GET/api/v1/chat/conversations/{id}/export

Export conversation to JSON or PDF

Parameters:

id: Conversation ID, format: json|pdf

LLM Settings

GET/api/v1/settings/llm

Get user LLM configuration

POST/api/v1/settings/llm/provider

Add or update LLM provider

Request Body:

{ "provider_name": "ollama", "config": { "type": "ollama", "base_url": "http://localhost:11434/v1", "model": "llama2" } }
DELETE/api/v1/settings/llm/provider/{name}

Delete LLM provider

Parameters:

name: Provider name
POST/api/v1/settings/llm/test

Test LLM provider connection

Request Body:

{ "provider_name": "test", "config": {...} }

Users

GET/api/v1/users/me

Get current user profile

PATCH/api/v1/users/me

Update user profile

Request Body:

{ "full_name": "New Name", "email": "newemail@example.com" }

HTTP Status Codes

200Success - Request completed successfully
201Created - Resource created successfully
400Bad Request - Invalid request parameters
401Unauthorized - Missing or invalid authentication token
404Not Found - Resource not found
429Too Many Requests - Rate limit exceeded
500Internal Server Error - Server error occurred

SDKs & Code Examples

We provide official SDKs and code examples to make integration easier:

🐍 Python

pip install doculume-sdk

📦 JavaScript/TypeScript

npm install doculume-js