API Reference¶
Complete REST API documentation for the Archivus platform.
Base URL¶
All API requests should be made to:
For local development:
Authentication¶
Archivus supports two authentication methods:
API Key Authentication (Recommended)¶
For server-to-server integrations, use API key authentication:
Benefits: - Never expires - Simpler integration - No token refresh needed - Ideal for backend services
JWT Token Authentication¶
For web and mobile applications:
curl -H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "X-Tenant-Subdomain: your-tenant" \
https://api.archivus.app/api/v1/documents
Benefits: - User-specific permissions - Secure for browser applications - OAuth integration support
API Versioning¶
The current API version is v1, indicated in the URL path:
We maintain backward compatibility within major versions. Breaking changes will result in a new version (v2, v3, etc.).
Response Format¶
Success Responses¶
Single resource responses return the object directly:
List responses include pagination metadata:
{
"data": [
{ "id": "doc_1", "filename": "doc1.pdf" },
{ "id": "doc_2", "filename": "doc2.pdf" }
],
"total": 150,
"page": 1,
"page_size": 20,
"total_pages": 8
}
Error Responses¶
All errors follow a consistent format:
{
"error": "not_found",
"code": "NOT_FOUND",
"message": "Document with ID 'abc123' not found",
"details": {
"resource_type": "document",
"resource_id": "abc123"
}
}
Rate Limits¶
Rate limits are enforced based on your subscription tier:
| Tier | Requests/Minute |
|---|---|
| Free | 15 |
| Starter | 30 |
| Pro | 120 |
| Team | 300 |
| Enterprise | Unlimited |
Rate Limit Headers¶
Every response includes rate limit information:
When rate limited, you'll receive a 429 Too Many Requests response:
{
"error": "rate_limit_exceeded",
"code": "RATE_LIMIT_EXCEEDED",
"message": "Rate limit exceeded. Please try again later.",
"details": {
"limit": 120,
"remaining": 0,
"reset_at": "2026-01-18T10:30:00Z"
}
}
Pagination¶
List endpoints support pagination via query parameters:
| Parameter | Type | Description | Default |
|---|---|---|---|
page | integer | Page number (1-indexed) | 1 |
limit | integer | Items per page | 20 |
sort | string | Sort field | created_at |
order | string | Sort order (asc, desc) | desc |
Example:
curl "https://api.archivus.app/api/v1/documents?page=2&limit=50&sort=filename&order=asc" \
-H "X-API-Key: YOUR_API_KEY"
Filtering¶
Many endpoints support filtering via query parameters:
# Filter documents by folder
curl "https://api.archivus.app/api/v1/documents?folder_id=folder_abc123"
# Filter by date range
curl "https://api.archivus.app/api/v1/documents?date_start=2026-01-01&date_end=2026-01-31"
# Combine filters
curl "https://api.archivus.app/api/v1/documents?folder_id=folder_abc123&file_type=pdf"
Idempotency¶
Mutation requests (POST, PUT, DELETE) support idempotency via the Idempotency-Key header:
curl -X POST https://api.archivus.app/api/v1/documents/upload \
-H "X-API-Key: YOUR_API_KEY" \
-H "Idempotency-Key: unique-key-12345" \
-F "file=@document.pdf"
Duplicate requests with the same idempotency key will return the original response.
CORS¶
The API supports Cross-Origin Resource Sharing (CORS) for browser-based applications.
Allowed origins are configured per tenant in your dashboard settings.
API Endpoints¶
Core APIs¶
-
Documents
Upload, manage, and retrieve documents
22 endpoints
-
Search
Semantic and keyword search across documents
4 endpoints
-
Chat
AI-powered document Q&A with verification
18 endpoints
-
Authentication
Login, register, and manage API keys
14 endpoints
Advanced Features¶
-
Workflows
DAG-based document automation (Team+)
13 endpoints
-
Webhooks
Real-time event notifications
5 endpoints
-
Errors
Error codes and handling strategies
Quick Examples¶
Upload a Document¶
const fs = require('fs');
const FormData = require('form-data');
const form = new FormData();
form.append('file', fs.createReadStream('contract.pdf'));
form.append('folder_id', 'folder_legal');
form.append('enable_ai', 'true');
const response = await fetch('https://api.archivus.app/api/v1/documents/upload', {
method: 'POST',
headers: {
'X-API-Key': 'ak_live_YOUR_API_KEY',
...form.getHeaders()
},
body: form
});
const document = await response.json();
import requests
files = {'file': open('contract.pdf', 'rb')}
data = {
'folder_id': 'folder_legal',
'enable_ai': 'true'
}
headers = {'X-API-Key': 'ak_live_YOUR_API_KEY'}
response = requests.post(
'https://api.archivus.app/api/v1/documents/upload',
files=files,
data=data,
headers=headers
)
document = response.json()
Search Documents¶
Chat with a Document¶
# Create session
curl -X POST https://api.archivus.app/api/v1/chat/sessions \
-H "X-API-Key: ak_live_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"document_id": "doc_abc123", "name": "Analysis"}'
# Ask question
curl -X POST https://api.archivus.app/api/v1/chat/sessions/session_xyz/ask \
-H "X-API-Key: ak_live_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"message": "What are the key terms?"}'
// Create session
const session = await fetch('https://api.archivus.app/api/v1/chat/sessions', {
method: 'POST',
headers: {
'X-API-Key': 'ak_live_YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
document_id: 'doc_abc123',
name: 'Analysis'
})
}).then(r => r.json());
// Ask question
const answer = await fetch(`https://api.archivus.app/api/v1/chat/sessions/${session.id}/ask`, {
method: 'POST',
headers: {
'X-API-Key': 'ak_live_YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
message: 'What are the key terms?'
})
}).then(r => r.json());
# Create session
session = requests.post(
'https://api.archivus.app/api/v1/chat/sessions',
json={'document_id': 'doc_abc123', 'name': 'Analysis'},
headers={'X-API-Key': 'ak_live_YOUR_API_KEY'}
).json()
# Ask question
answer = requests.post(
f'https://api.archivus.app/api/v1/chat/sessions/{session["id"]}/ask',
json={'message': 'What are the key terms?'},
headers={'X-API-Key': 'ak_live_YOUR_API_KEY'}
).json()
Testing¶
Sandbox Environment¶
Test your integration in a sandbox environment:
Sandbox limitations: - Limited to 100 documents - AI processing may be slower - Data is cleared every 7 days - Rate limits are lower
Test API Keys¶
Use test API keys in sandbox:
Test keys are prefixed with ak_test_ and only work in the sandbox environment.
SDKs¶
Official SDKs for popular languages:
Support¶
Need help? We're here for you:
- Documentation: Browse these guides
- API Support: support@ubiship.com
- GitHub Issues: Report bugs
- Community: Join Discord
Next Steps¶
-
Get Started
Learn about authentication and get your API key
-
Upload Documents
Start uploading and processing documents
-
Handle Errors
Learn how to handle API errors properly