Use this file to discover all available pages before exploring further.
The NISIRA Assistant REST API is a Django REST Framework backend that powers a full-stack Retrieval-Augmented Generation (RAG) chat application. Every endpoint lives under the /api/ prefix, all responses are JSON, and all protected routes require a JWT Bearer token in the Authorization header. The sections below describe the available resource groups, the welcome and utility endpoints, and the error conventions you should expect across the entire API surface.
Set REACT_APP_API_URL (or REACT_APP_API_BASE) in your frontend environment to point the client at the correct host. The frontend axios client uses a default of http://localhost:8000 when neither variable is set.
All endpoints that handle user data require a JSON Web Token. Obtain a token via the Authentication endpoints, then attach it to every subsequent request:
Authorization: Bearer <access_token>
Token lifetimes: access token — 24 hours, refresh token — 7 days. The refresh token is rotated on every successful refresh. See the Authentication page for the full flow.
RAG queries involve embedding lookups and LLM generation — these operations can take up to 2 minutes. The official frontend client is configured with a 120-second timeout for standard requests and 180 seconds for RAG-enhanced chat. Set your HTTP client timeout accordingly before calling /api/rag/query/ or /api/rag/chat/.
Register new users, log in, obtain JWT token pairs, and refresh access tokens. All authentication endpoints allow unauthenticated access.
Chat
Send messages to a conversation and receive an assistant reply. The primary endpoint is POST /api/chat/, with a RAG-powered variant at POST /api/rag/chat/.
Conversations
Create, list, retrieve messages from, and delete conversation threads. Conversations are identified by a public slug or a legacy numeric ID.
RAG
Initialize the RAG pipeline, sync documents from Google Drive, run direct retrieval queries, trigger enhanced chat, and inspect pipeline health.
Ratings
Submit thumbs-up / thumbs-down ratings on assistant messages, retrieve aggregated summaries, and export rating data as JSON or CSV.
Admin Endpoints
Admin-only routes covering Google Drive file management, embedding generation and verification, system metrics, query logs, and pipeline status.
Sync documents from Google Drive and build embeddings
POST
/api/rag/query/
Optional
Direct retrieval query with adaptive top-k document selection
POST
/api/rag/chat/
Required
RAG-enhanced chat — retrieves context then generates a response
GET
/api/rag/system-status/
Optional
Detailed system status from the pipeline
POST /api/rag/query/ and GET /api/rag/system-status/ are decorated with AllowAny — a JWT token is not enforced at the Django permission layer for these two endpoints. All other RAG endpoints require a valid Bearer token.