RAG Backend API Documentation
Complete API for managing projects, data sources, URL schedules, crawls, and LLM responses.
β οΈ Authentication Required: Most endpoints require Keycloak authentication. Use the Authentication API section to login first.
Core Features
- π¦ Project Management - Create and manage RAG projects
- π₯ Data Sources - Upload websites, documents, text, FAQs, and URLs
- π URL Scheduling - Schedule recurring crawls (daily/weekly/monthly)
- π Crawl Management - Track crawl jobs and progress
- π€ LLM Responses - Store and manage LLM interactions
- π₯ User & Permission Management - RBAC integration
- π OAuth Authentication - Keycloak integration
π Authentication API (Start Here)
OAuth/Keycloak authentication endpoints - Login first to access other APIs
GET /api/auth/login
Initiate OAuth login with Keycloak
GET /api/auth/callback
OAuth callback (handled automatically)
GET /api/auth/me
Get current user info
GET /api/auth/session
Check session status
POST /api/auth/logout
Logout user
π¦ Projects API
Manage RAG projects and their metadata
GET /api/projects
List all projects
POST /api/projects
Create a new project (requires auth)
GET /api/projects/{uuid}
Get specific project by UUID
PUT /api/projects/{uuid}
Update project metadata
DELETE /api/projects/{uuid}
Delete project
GET /api/projects/{uuid}/documents
Get project documents from VectorDB
GET /api/projects/{uuid}/stats
Get project statistics
π₯ Data Sources API
Upload and manage various data source types
POST /api/sources/text
Upload text content (requires auth)
POST /api/sources/website
Upload website URL to crawl
POST /api/sources/sitemap
Upload sitemap URL
POST /api/sources/url-list
Upload multiple URLs
POST /api/sources/faq
Upload FAQ pairs
POST /api/sources/document
Upload documents (multipart/form-data)
π URL Schedules API
Manage scheduled URL crawls and triggers
POST /api/url-schedules
Create/update URL schedule
GET /api/url-schedules/{project}
Get project schedules (name or UUID)
PUT /api/url-schedules/{project}/{url}
Update specific schedule
DELETE /api/url-schedules/{project}/{url}
Delete schedule
POST /api/url-schedules/{uuid}/trigger-now
Trigger immediate crawl
GET /api/url-schedules/scheduler/status
Get scheduler status
π URL Manager API
Manage crawl sessions and URL tracking
POST /api/url-manager/sessions/{job_id}
Create crawl session
PUT /api/url-manager/sessions/{job_id}/urls
Update crawl URLs
POST /api/url-manager/sessions/{job_id}/complete
Complete crawl
GET /api/url-manager/projects/{project}/jobs
Get project crawl jobs (name or UUID)
GET /api/url-manager/projects/{project}/urls
Get project selected URLs
GET /api/url-manager/projects/{project}/summary
Get project crawl summary
π€ LLM Responses API
Store and manage LLM interactions
POST /api/llm-responses
Store LLM response
GET /api/llm-responses
List LLM responses with filters
GET /api/llm-responses/{id}
Get specific response
π§ Other Services
Additional API endpoints and utilities
GET /api/health
Health check (database + services)
GET /api/users
List users (requires auth)
GET /api/services
List registered services
POST /api/webhooks/crawl-complete
Crawl completion webhook
ANY /api/proxy/{service}/{path}
Proxy to backend services (vectordb, webcrawler, etc.)
π‘ Testing Tips:
- Start by logging in with Keycloak using the "Login with Keycloak" button
- 401 errors mean you need to authenticate first
- 404 errors may mean the resource doesn't exist yet
- Check the browser console for detailed error information
- Use Swagger UI for more comprehensive API testing with authentication