API Reference
Complete API documentation for Dexrag
API Reference
Authentication
All API requests require an API key. Get yours from the dashboard.
Authorization: Bearer YOUR_API_KEYBase URL
https://api.dexrag.com/v1Collections
Create Collection
POST /collectionsRequest Body:
{
"name": "my-collection",
"description": "Optional description",
"mode": "adaptive"
}Response:
{
"id": "coll_abc123",
"name": "my-collection",
"documentCount": 0,
"createdAt": "2025-01-15T10:00:00Z"
}List Collections
GET /collectionsResponse:
{
"collections": [
{
"id": "coll_abc123",
"name": "my-collection",
"documentCount": 42,
"queryCount": 150
}
]
}Documents
Add Document
POST /collections/:collectionId/documentsRequest Body:
{
"content": "Document content here...",
"metadata": {
"title": "Document Title",
"source": "internal"
}
}Batch Upload
POST /collections/:collectionId/documents/batchRequest Body:
{
"documents": [
{
"content": "First document...",
"metadata": { "title": "Doc 1" }
},
{
"content": "Second document...",
"metadata": { "title": "Doc 2" }
}
]
}Search
Execute Search
POST /collections/:collectionId/searchRequest Body:
{
"query": "indemnification clause",
"limit": 10,
"includeExplorationTree": true
}Response:
{
"results": [
{
"documentId": "doc_xyz789",
"score": 0.95,
"content": "...relevant content snippet...",
"metadata": {
"title": "Contract #123"
},
"explorationPath": [
"monte_carlo_selection",
"structure_analysis",
"content_match"
]
}
],
"queryTime": "45ms"
}Mark Relevant
Help the adaptive learning by marking relevant results:
POST /queries/:queryId/relevantRequest Body:
{
"documentIds": ["doc_xyz789", "doc_abc456"]
}Error Codes
| Code | Description |
|---|---|
| 200 | Success |
| 400 | Bad Request - Invalid parameters |
| 401 | Unauthorized - Invalid API key |
| 404 | Not Found - Resource doesn't exist |
| 429 | Rate Limit Exceeded |
| 500 | Internal Server Error |
Rate Limits
| Plan | Requests/min | Queries/month |
|---|---|---|
| Hacker | 10 | 1,000 |
| Startup | 60 | 100,000 |
| Growth | 300 | 1,000,000 |
| Enterprise | Unlimited | Unlimited |