Mjara Docs
API Reference

API Reference

FastAPI REST API endpoint reference for the RAG system

API Reference

The RAG system exposes a FastAPI REST API with full OpenAPI documentation.

Base URL: http://localhost:9000 API Prefix: /api/v1

Authentication

All endpoints except health checks require an API key in the X-API-Key header:

curl -H "X-API-Key: your-secret-key" http://localhost:9000/api/v1/query

Exempt paths: /, /docs, /redoc, /openapi.json, /api/v1/health/*

When API_KEYS is empty in .env, authentication is disabled (development mode).

Endpoint Overview

GroupEndpointsDescription
HealthGET /health, /health/ready, /health/statsSystem health and readiness
QueryPOST /query, POST /searchRAG query and semantic search
DocumentsGET/DELETE /documents/*Document CRUD operations
ScrapePOST /scrape, POST /scrape/asyncURL web scraping
UploadPOST /upload, /upload/async, /upload/bulkFile uploads
ParsePOST /parse, /parse/formats, /parse/sections, /parse/sections/stream, /parse/sections/incrementalDocument parsing and semantic chunking
TasksGET/DELETE /tasks/*Background task monitoring

Error Format

All errors follow a consistent JSON format:

{
  "error": "Error type",
  "detail": "Detailed error message",
  "status_code": 400,
  "timestamp": "2025-01-15T10:30:00.000000"
}

HTTP Status Codes

CodeDescription
200Success
400Bad request (invalid parameters)
401Missing API key
403Invalid API key
404Resource not found
500Internal server error

Interactive Documentation

Once the server is running:

On this page