Dexrag

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_KEY

Base URL

https://api.dexrag.com/v1

Collections

Create Collection

POST /collections

Request 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 /collections

Response:

{
  "collections": [
    {
      "id": "coll_abc123",
      "name": "my-collection",
      "documentCount": 42,
      "queryCount": 150
    }
  ]
}

Documents

Add Document

POST /collections/:collectionId/documents

Request Body:

{
  "content": "Document content here...",
  "metadata": {
    "title": "Document Title",
    "source": "internal"
  }
}

Batch Upload

POST /collections/:collectionId/documents/batch

Request Body:

{
  "documents": [
    {
      "content": "First document...",
      "metadata": { "title": "Doc 1" }
    },
    {
      "content": "Second document...",
      "metadata": { "title": "Doc 2" }
    }
  ]
}
POST /collections/:collectionId/search

Request 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/relevant

Request Body:

{
  "documentIds": ["doc_xyz789", "doc_abc456"]
}

Error Codes

CodeDescription
200Success
400Bad Request - Invalid parameters
401Unauthorized - Invalid API key
404Not Found - Resource doesn't exist
429Rate Limit Exceeded
500Internal Server Error

Rate Limits

PlanRequests/minQueries/month
Hacker101,000
Startup60100,000
Growth3001,000,000
EnterpriseUnlimitedUnlimited