{ "openapi": "3.0.1", "info": { "title": "Agentic AI Tutor APIs", "version": "v1" }, "paths": { "/api/Analytics/progress": { "get": { "tags": [ "Analytics" ], "summary": "Gets the progress and analytics dashboard for the current user.", "responses": { "200": { "description": "Success", "content": { "text/plain": { "schema": { "$ref": "#/components/schemas/ProgressDashboardResponseDto" } }, "application/json": { "schema": { "$ref": "#/components/schemas/ProgressDashboardResponseDto" } }, "text/json": { "schema": { "$ref": "#/components/schemas/ProgressDashboardResponseDto" } } } }, "401": { "description": "Unauthorized", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } } } } }, "/api/Auth/register": { "post": { "tags": [ "Auth" ], "summary": "Register a New User Account", "description": "Creates a new user in the database and returns a JWT Token.\r\n**Required Fields:** `FirstName`, `LastName`, `Email`, `Password`.\r\nPasswords must match and follow security standards (e.g., minimum length).", "requestBody": { "description": "The user registration details", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RegisterRequest" } }, "text/json": { "schema": { "$ref": "#/components/schemas/RegisterRequest" } }, "application/*+json": { "schema": { "$ref": "#/components/schemas/RegisterRequest" } } } }, "responses": { "200": { "description": "Registration successful — returns AuthResponse containing the JWT token", "content": { "text/plain": { "schema": { "$ref": "#/components/schemas/AuthResponse" } }, "application/json": { "schema": { "$ref": "#/components/schemas/AuthResponse" } }, "text/json": { "schema": { "$ref": "#/components/schemas/AuthResponse" } } } }, "400": { "description": "Email already exists or validation failed", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } } } } }, "/api/Auth/login": { "post": { "tags": [ "Auth" ], "summary": "Login With Existing Credentials", "description": "Authenticates the user and returns a JWT Token on Success.\r\nThe JWT Token must be included in the `Authorization: Bearer {token}` header for all secured endpoints.", "requestBody": { "description": "The user's login credentials (Email and Password)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LoginRequest" } }, "text/json": { "schema": { "$ref": "#/components/schemas/LoginRequest" } }, "application/*+json": { "schema": { "$ref": "#/components/schemas/LoginRequest" } } } }, "responses": { "200": { "description": "Login successful — returns AuthResponse containing the JWT token", "content": { "text/plain": { "schema": { "$ref": "#/components/schemas/AuthResponse" } }, "application/json": { "schema": { "$ref": "#/components/schemas/AuthResponse" } }, "text/json": { "schema": { "$ref": "#/components/schemas/AuthResponse" } } } }, "400": { "description": "Invalid email or password", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } } } } }, "/api/Auth/forgot-password": { "post": { "tags": [ "Auth" ], "summary": "Request a 6-digit OTP for password reset", "description": "Generates a secure 6-digit one-time password and sends it to the user's email.\r\nAlways returns the same successful response to prevent account enumeration.\r\nThe OTP expires after 15 minutes.", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ForgotPasswordRequestDto" } }, "text/json": { "schema": { "$ref": "#/components/schemas/ForgotPasswordRequestDto" } }, "application/*+json": { "schema": { "$ref": "#/components/schemas/ForgotPasswordRequestDto" } } } }, "responses": { "200": { "description": "Success", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } } } } }, "/api/Auth/reset-password": { "post": { "tags": [ "Auth" ], "summary": "Reset a password using the 6-digit OTP", "description": "Validates the OTP sent to the user's email, then updates the password.\r\nReturns 400 if the OTP is incorrect or has expired.", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ResetPasswordRequestDto" } }, "text/json": { "schema": { "$ref": "#/components/schemas/ResetPasswordRequestDto" } }, "application/*+json": { "schema": { "$ref": "#/components/schemas/ResetPasswordRequestDto" } } } }, "responses": { "200": { "description": "Success", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } }, "400": { "description": "Bad Request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } } } } }, "/api/Auth/change-password": { "post": { "tags": [ "Auth" ], "summary": "Change the current user's password", "description": "Requires the user to be authenticated and to provide their current password.", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChangePasswordRequestDto" } }, "text/json": { "schema": { "$ref": "#/components/schemas/ChangePasswordRequestDto" } }, "application/*+json": { "schema": { "$ref": "#/components/schemas/ChangePasswordRequestDto" } } } }, "responses": { "200": { "description": "Success", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } }, "400": { "description": "Bad Request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } }, "401": { "description": "Unauthorized", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } } } } }, "/api/ChatMessage/SendMessage": { "post": { "tags": [ "ChatMessage" ], "summary": "Send a message and receive an AI response", "description": "Sends a user message to the AI.\r\nSet **searchWeb: False** to query your uploaded documents contextually.\r\n**Note:** Do not send `UserId` or `AllowedDocumentIds` in the request body; they are resolved automatically on the backend from the Token and Session.", "requestBody": { "description": "Contains the `SessionId`, `UserMessage`, and `SearchWeb` (must be false).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserMessageRequest" } }, "text/json": { "schema": { "$ref": "#/components/schemas/UserMessageRequest" } }, "application/*+json": { "schema": { "$ref": "#/components/schemas/UserMessageRequest" } } } }, "responses": { "200": { "description": "Returns AIMessageResponse containing the AI's answer, confidence score, and document citations", "content": { "text/plain": { "schema": { "$ref": "#/components/schemas/AIMessageResponse" } }, "application/json": { "schema": { "$ref": "#/components/schemas/AIMessageResponse" } }, "text/json": { "schema": { "$ref": "#/components/schemas/AIMessageResponse" } } } }, "401": { "description": "Invalid or missing token", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } }, "400": { "description": "Message processing failed, Validation Error, or SearchWeb is true", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } } } } }, "/api/ChatMessage/SearchWeb": { "post": { "tags": [ "ChatMessage" ], "summary": "Send a message and receive a Web Search response", "description": "Sends a user message to the AI but forces it to search the live web for answers instead of local documents.\r\nSet **searchWeb: True**.\r\n**Note:** Do not send `UserId` or `AllowedDocumentIds` in the request body.", "requestBody": { "description": "Contains the `SessionId`, `UserMessage`, and `SearchWeb` (must be true).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserMessageRequest" } }, "text/json": { "schema": { "$ref": "#/components/schemas/UserMessageRequest" } }, "application/*+json": { "schema": { "$ref": "#/components/schemas/UserMessageRequest" } } } }, "responses": { "200": { "description": "Returns WebSearchResponse containing the AI's answer and the web sources", "content": { "text/plain": { "schema": { "$ref": "#/components/schemas/WebSearchResponse" } }, "application/json": { "schema": { "$ref": "#/components/schemas/WebSearchResponse" } }, "text/json": { "schema": { "$ref": "#/components/schemas/WebSearchResponse" } } } }, "401": { "description": "Invalid or missing token", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } }, "400": { "description": "Message processing failed, Validation Error, or SearchWeb is false", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } } } } }, "/api/ChatMessage/{sessionId}": { "get": { "tags": [ "ChatMessage" ], "summary": "Get all messages in a chat session", "parameters": [ { "name": "sessionId", "in": "path", "description": "Session GUID", "required": true, "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "List of messages", "content": { "text/plain": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/ChatMessageResponse" } } }, "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/ChatMessageResponse" } } }, "text/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/ChatMessageResponse" } } } } }, "401": { "description": "Invalid or missing token", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } }, "400": { "description": "Validation Error", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } } } } }, "/api/ChatMessage/STT": { "post": { "tags": [ "ChatMessage" ], "summary": "Convert an audio file to text (Transcription)", "description": "Transcribes a spoken audio file into text using the AI Speech-To-Text model.\r\nUseful for capturing user voice queries before sending them to the AI.\r\nAccepts standard audio formats (wav, mp3, m4a, etc.). Max size: 10MB.", "requestBody": { "content": { "multipart/form-data": { "schema": { "type": "object", "properties": { "audio_file": { "type": "string", "format": "binary" } } }, "encoding": { "audio_file": { "style": "form" } } } } }, "responses": { "200": { "description": "Returns the transcribed text", "content": { "text/plain": { "schema": { "$ref": "#/components/schemas/STTResponse" } }, "application/json": { "schema": { "$ref": "#/components/schemas/STTResponse" } }, "text/json": { "schema": { "$ref": "#/components/schemas/STTResponse" } } } }, "400": { "description": "Audio processing failed, invalid format, or missing file", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } }, "401": { "description": "Invalid or missing token" } } } }, "/api/ChatMessage/{messageId}/TTS": { "post": { "tags": [ "ChatMessage" ], "summary": "Generate playable audio for an existing AI message", "description": "Generates a Text-To-Speech (TTS) audio file for a specific message that the AI previously generated.\r\nIf the audio was already generated before, it returns the cached URL instantly.", "parameters": [ { "name": "messageId", "in": "path", "description": "The GUID of the AI's chat message", "required": true, "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Returns TTSResponse with the URL of the generated/cached audio file", "content": { "text/plain": { "schema": { "$ref": "#/components/schemas/TTSResponse" } }, "application/json": { "schema": { "$ref": "#/components/schemas/TTSResponse" } }, "text/json": { "schema": { "$ref": "#/components/schemas/TTSResponse" } } } }, "400": { "description": "TTS generation failed, message not found, or unauthorized access", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } }, "401": { "description": "Invalid or missing token" } } } }, "/api/ChatSession": { "post": { "tags": [ "ChatSession" ], "summary": "Create a new chat session", "description": "Initializes a new chat session. Pass a list of `DocumentIds` to scope the AI context.\r\nThe JWT Token must be passed in the `Authorization` header.", "requestBody": { "description": "Contains an optional list of `DocumentIds`.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChatSessionRequest" } }, "text/json": { "schema": { "$ref": "#/components/schemas/ChatSessionRequest" } }, "application/*+json": { "schema": { "$ref": "#/components/schemas/ChatSessionRequest" } } } }, "responses": { "200": { "description": "Session created — returns ChatSessionResponse", "content": { "text/plain": { "schema": { "$ref": "#/components/schemas/ChatSessionResponse" } }, "application/json": { "schema": { "$ref": "#/components/schemas/ChatSessionResponse" } }, "text/json": { "schema": { "$ref": "#/components/schemas/ChatSessionResponse" } } } }, "401": { "description": "Invalid or missing token", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } }, "400": { "description": "Validation error or Document ID does not belong to user", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } } } }, "get": { "tags": [ "ChatSession" ], "summary": "Get all chat sessions for the current user(Chat History)", "responses": { "200": { "description": "List of chat sessions", "content": { "text/plain": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/ChatSessionResponse" } } }, "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/ChatSessionResponse" } } }, "text/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/ChatSessionResponse" } } } } }, "401": { "description": "Invalid or missing token", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } }, "400": { "description": "Validation error", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } } } }, "put": { "tags": [ "ChatSession" ], "summary": "Update the title of a chat session", "description": "Allows the user or frontend to dynamically rename a chat session.", "requestBody": { "description": "Contains the `SessionId` and the new `Title`.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ChatSessionUpdate" } }, "text/json": { "schema": { "$ref": "#/components/schemas/ChatSessionUpdate" } }, "application/*+json": { "schema": { "$ref": "#/components/schemas/ChatSessionUpdate" } } } }, "responses": { "200": { "description": "Title updated successfully", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } }, "401": { "description": "Invalid or missing token", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } }, "400": { "description": "Validation error or Session Not Found", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } } } } }, "/api/ChatSession/{sessionId}": { "delete": { "tags": [ "ChatSession" ], "summary": "Delete a chat session by ID", "parameters": [ { "name": "sessionId", "in": "path", "description": "Session GUID", "required": true, "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Session deleted", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } }, "401": { "description": "Invalid or missing token", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } }, "400": { "description": "Validation error", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } } } } }, "/api/Document": { "post": { "tags": [ "Document" ], "summary": "Upload a new document", "description": "Accepts a file upload via `multipart/form-data`. \r\n**Required Fields:** `File` (the physical file), `SubjectId` (groups the document).\r\nAfter upload, the file is queued for background processing (text extraction and chunking).", "requestBody": { "content": { "multipart/form-data": { "schema": { "required": [ "File", "SubjectId", "UserId" ], "type": "object", "properties": { "UserId": { "type": "string", "format": "uuid" }, "File": { "type": "string", "format": "binary" }, "SubjectId": { "type": "string", "format": "uuid" } } }, "encoding": { "UserId": { "style": "form" }, "File": { "style": "form" }, "SubjectId": { "style": "form" } } } } }, "responses": { "200": { "description": "Document uploaded and queued for processing — returns DocumentResponse", "content": { "text/plain": { "schema": { "$ref": "#/components/schemas/DocumentResponse" } }, "application/json": { "schema": { "$ref": "#/components/schemas/DocumentResponse" } }, "text/json": { "schema": { "$ref": "#/components/schemas/DocumentResponse" } } } }, "401": { "description": "Invalid or missing token", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } }, "400": { "description": "Validation error (e.g., file too large or invalid format)", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } } } }, "put": { "tags": [ "Document" ], "summary": "Update document metadata (title or subject)", "description": "Allows changing a document's Title, associating it with a new Subject.", "requestBody": { "description": "Contains the new metadata", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DocumentUpdate" } }, "text/json": { "schema": { "$ref": "#/components/schemas/DocumentUpdate" } }, "application/*+json": { "schema": { "$ref": "#/components/schemas/DocumentUpdate" } } } }, "responses": { "200": { "description": "Document updated successfully — returns updated DocumentResponse", "content": { "text/plain": { "schema": { "$ref": "#/components/schemas/DocumentResponse" } }, "application/json": { "schema": { "$ref": "#/components/schemas/DocumentResponse" } }, "text/json": { "schema": { "$ref": "#/components/schemas/DocumentResponse" } } } }, "401": { "description": "Invalid or missing token", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } }, "400": { "description": "Validation error or Document not found", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } } } }, "get": { "tags": [ "Document" ], "summary": "Get all documents for the current user", "description": "Retrieves every document uploaded by the authenticated user, regardless of subject.", "responses": { "200": { "description": "List of DocumentResponse objects", "content": { "text/plain": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/DocumentResponse" } } }, "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/DocumentResponse" } } }, "text/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/DocumentResponse" } } } } }, "401": { "description": "Invalid or missing token", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } } } } }, "/api/Document/{id}": { "delete": { "tags": [ "Document" ], "summary": "Delete a document by ID", "description": "Permanently deletes a document.\r\n**Warning:** This deletes the database record, the physical file in storage, and triggers a purge of all associated AI Knowledge Graph entities.", "parameters": [ { "name": "id", "in": "path", "description": "Document GUID", "required": true, "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Document deleted successfully", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } }, "401": { "description": "Invalid or missing token", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } }, "400": { "description": "Document not found or belongs to another user", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } } } }, "get": { "tags": [ "Document" ], "summary": "Get a document by ID", "parameters": [ { "name": "id", "in": "path", "description": "Document GUID", "required": true, "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Document details", "content": { "text/plain": { "schema": { "$ref": "#/components/schemas/DocumentResponse" } }, "application/json": { "schema": { "$ref": "#/components/schemas/DocumentResponse" } }, "text/json": { "schema": { "$ref": "#/components/schemas/DocumentResponse" } } } }, "401": { "description": "Invalid or missing token", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } } } } }, "/api/Document/subject/{subjectId}": { "get": { "tags": [ "Document" ], "summary": "Get all documents under a specific subject", "parameters": [ { "name": "subjectId", "in": "path", "description": "Subject GUID", "required": true, "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "List of documents", "content": { "text/plain": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/DocumentResponse" } } }, "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/DocumentResponse" } } }, "text/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/DocumentResponse" } } } } }, "401": { "description": "Invalid or missing token", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } } } } }, "/api/Document/{id}/retry-processing": { "post": { "tags": [ "Document" ], "summary": "Retry processing a document that previously failed", "description": "Only documents with a **FAILED** processing status can be retried.\r\nAttempting to retry a PENDING, PROCESSING, or COMPLETED document will return 400.\r\nOn success the document status is reset to PENDING and the chunking job is re-queued.", "parameters": [ { "name": "id", "in": "path", "description": "Document GUID", "required": true, "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Document re-queued — returns updated document", "content": { "text/plain": { "schema": { "$ref": "#/components/schemas/DocumentResponse" } }, "application/json": { "schema": { "$ref": "#/components/schemas/DocumentResponse" } }, "text/json": { "schema": { "$ref": "#/components/schemas/DocumentResponse" } } } }, "400": { "description": "Document is not in FAILED status, or validation error", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } }, "401": { "description": "Invalid or missing token", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } } } } }, "/api/Document/{id}/download": { "get": { "tags": [ "Document" ], "summary": "Securely view or download a document", "parameters": [ { "name": "id", "in": "path", "description": "Document GUID", "required": true, "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "File stream returned", "content": { "text/plain": { "schema": { "type": "string", "format": "binary" } }, "application/json": { "schema": { "type": "string", "format": "binary" } }, "text/json": { "schema": { "type": "string", "format": "binary" } } } }, "404": { "description": "Document or physical file not found", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } }, "401": { "description": "Invalid or missing token", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } } } } }, "/api/DocumentChunk/{documentId}": { "get": { "tags": [ "DocumentChunk" ], "summary": "Get chunks for a specific document", "description": "Retrieves the processed chunks (text segments) of an uploaded document.\r\nThis is useful for frontend debugging or displaying how the document was split for RAG.", "parameters": [ { "name": "documentId", "in": "path", "description": "The GUID of the document", "required": true, "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Returns a list of document chunks" }, "401": { "description": "Invalid or missing token", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } }, "404": { "description": "No chunks found or document is still processing", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } } } } }, "/api/mock-ai/quiz/generate": { "post": { "tags": [ "MockAI" ], "summary": "Mock MCQ generation — generates one question per quiz chunk.\r\nAccepts the same McqGenerateRequest the real Python service expects.", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/McqGenerateRequest" } }, "text/json": { "schema": { "$ref": "#/components/schemas/McqGenerateRequest" } }, "application/*+json": { "schema": { "$ref": "#/components/schemas/McqGenerateRequest" } } } }, "responses": { "200": { "description": "Success", "content": { "text/plain": { "schema": { "$ref": "#/components/schemas/McqGenerateResponse" } }, "application/json": { "schema": { "$ref": "#/components/schemas/McqGenerateResponse" } }, "text/json": { "schema": { "$ref": "#/components/schemas/McqGenerateResponse" } } } }, "400": { "description": "Bad Request", "content": { "text/plain": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } }, "application/json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } }, "text/json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } } } } }, "/api/mock-ai/quiz/process": { "post": { "tags": [ "MockAI" ], "summary": "Mock quiz chunking - creates quiz-ready chunks from the document metadata.\r\nAccepts the same AIChunkRequest the real Python service expects.", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AIChunkRequest" } }, "text/json": { "schema": { "$ref": "#/components/schemas/AIChunkRequest" } }, "application/*+json": { "schema": { "$ref": "#/components/schemas/AIChunkRequest" } } } }, "responses": { "200": { "description": "Success", "content": { "text/plain": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/QuizChunkResponse" } } }, "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/QuizChunkResponse" } } }, "text/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/QuizChunkResponse" } } } } }, "400": { "description": "Bad Request", "content": { "text/plain": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } }, "application/json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } }, "text/json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } } } } }, "/api/Quiz/initiate": { "post": { "tags": [ "Quiz" ], "summary": "Initiate quiz generation or reuse a cached quiz", "description": "Computes a hash from userId + sorted documentIds.\r\n- Returns **200** if an identical READY quiz already exists (cache hit).\r\n- Returns **202** if a new generation job was enqueued.\r\n- Returns **409** if generation is already in progress for this combination.\r\n- Returns **400** on validation errors (invalid documents, subject, etc.).", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/QuizInitiateRequest" } }, "text/json": { "schema": { "$ref": "#/components/schemas/QuizInitiateRequest" } }, "application/*+json": { "schema": { "$ref": "#/components/schemas/QuizInitiateRequest" } } } }, "responses": { "200": { "description": "Success", "content": { "text/plain": { "schema": { "$ref": "#/components/schemas/QuizInitiateResponse" } }, "application/json": { "schema": { "$ref": "#/components/schemas/QuizInitiateResponse" } }, "text/json": { "schema": { "$ref": "#/components/schemas/QuizInitiateResponse" } } } }, "202": { "description": "Accepted", "content": { "text/plain": { "schema": { "$ref": "#/components/schemas/QuizInitiateResponse" } }, "application/json": { "schema": { "$ref": "#/components/schemas/QuizInitiateResponse" } }, "text/json": { "schema": { "$ref": "#/components/schemas/QuizInitiateResponse" } } } }, "409": { "description": "Conflict", "content": { "text/plain": { "schema": { "$ref": "#/components/schemas/QuizInitiateResponse" } }, "application/json": { "schema": { "$ref": "#/components/schemas/QuizInitiateResponse" } }, "text/json": { "schema": { "$ref": "#/components/schemas/QuizInitiateResponse" } } } }, "400": { "description": "Bad Request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } }, "401": { "description": "Unauthorized", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } } } } }, "/api/Quiz/{quizId}/status": { "get": { "tags": [ "Quiz" ], "summary": "Poll quiz generation status", "description": "Returns GENERATING, READY, or FAILED.", "parameters": [ { "name": "quizId", "in": "path", "description": "Quiz GUID", "required": true, "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Success", "content": { "text/plain": { "schema": { "$ref": "#/components/schemas/QuizStatusResponse" } }, "application/json": { "schema": { "$ref": "#/components/schemas/QuizStatusResponse" } }, "text/json": { "schema": { "$ref": "#/components/schemas/QuizStatusResponse" } } } }, "400": { "description": "Bad Request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } }, "401": { "description": "Unauthorized", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } }, "404": { "description": "Not Found", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } } } } }, "/api/Quiz/{quizId}/start": { "get": { "tags": [ "Quiz" ], "summary": "Start a quiz exam attempt", "description": "Creates a new attempt row. Options are shuffled server-side using Fisher-Yates\r\nseeded by the attemptId. The shuffle mapping is stored server-side only —\r\nthe response contains **no correct-answer information**.", "parameters": [ { "name": "quizId", "in": "path", "description": "Quiz GUID", "required": true, "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Success", "content": { "text/plain": { "schema": { "$ref": "#/components/schemas/QuizStartResponse" } }, "application/json": { "schema": { "$ref": "#/components/schemas/QuizStartResponse" } }, "text/json": { "schema": { "$ref": "#/components/schemas/QuizStartResponse" } } } }, "400": { "description": "Bad Request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } }, "401": { "description": "Unauthorized", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } }, "404": { "description": "Not Found", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } } } } }, "/api/Quiz/{quizId}/submit": { "post": { "tags": [ "Quiz" ], "summary": "Submit answers and receive a score", "description": "**Idempotent** — submitting the same attemptId twice returns the original score.\r\nThe server reverse-maps shuffled option labels to original labels before scoring.", "parameters": [ { "name": "quizId", "in": "path", "description": "Quiz GUID", "required": true, "schema": { "type": "string", "format": "uuid" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/QuizSubmitRequest" } }, "text/json": { "schema": { "$ref": "#/components/schemas/QuizSubmitRequest" } }, "application/*+json": { "schema": { "$ref": "#/components/schemas/QuizSubmitRequest" } } } }, "responses": { "200": { "description": "Success", "content": { "text/plain": { "schema": { "$ref": "#/components/schemas/QuizSubmitResponse" } }, "application/json": { "schema": { "$ref": "#/components/schemas/QuizSubmitResponse" } }, "text/json": { "schema": { "$ref": "#/components/schemas/QuizSubmitResponse" } } } }, "400": { "description": "Bad Request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } }, "401": { "description": "Unauthorized", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } }, "404": { "description": "Not Found", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } } } } }, "/api/Quiz/{quizId}/attempts": { "get": { "tags": [ "Quiz" ], "summary": "List all attempts for a quiz by the current user", "parameters": [ { "name": "quizId", "in": "path", "description": "Quiz GUID", "required": true, "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Success", "content": { "text/plain": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/QuizAttemptSummary" } } }, "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/QuizAttemptSummary" } } }, "text/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/QuizAttemptSummary" } } } } }, "401": { "description": "Unauthorized", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } }, "404": { "description": "Not Found", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } } } } }, "/api/Quiz/attempt/{attemptId}/review": { "get": { "tags": [ "Quiz" ], "summary": "Full review of a completed attempt", "description": "Returns correct answers, the student's answers, AI explanations, and\r\nsource chunk citations for each question.", "parameters": [ { "name": "attemptId", "in": "path", "description": "Attempt GUID", "required": true, "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Success", "content": { "text/plain": { "schema": { "$ref": "#/components/schemas/QuizReviewResponse" } }, "application/json": { "schema": { "$ref": "#/components/schemas/QuizReviewResponse" } }, "text/json": { "schema": { "$ref": "#/components/schemas/QuizReviewResponse" } } } }, "400": { "description": "Bad Request", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } }, "401": { "description": "Unauthorized", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } }, "404": { "description": "Not Found", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } } } } }, "/api/Quiz/history": { "get": { "tags": [ "Quiz" ], "summary": "Paginated, filterable history of all quizzes generated by the user", "parameters": [ { "name": "SubjectId", "in": "query", "schema": { "type": "string", "format": "uuid" } }, { "name": "Status", "in": "query", "schema": { "type": "string" } }, { "name": "Page", "in": "query", "schema": { "type": "integer", "format": "int32" } }, { "name": "PageSize", "in": "query", "schema": { "type": "integer", "format": "int32" } } ], "responses": { "200": { "description": "Success", "content": { "text/plain": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/QuizHistoryItem" } } }, "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/QuizHistoryItem" } } }, "text/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/QuizHistoryItem" } } } } }, "401": { "description": "Unauthorized", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } } } } }, "/api/Quiz/subject/{subjectId}": { "get": { "tags": [ "Quiz" ], "summary": "All quizzes for a specific subject", "parameters": [ { "name": "subjectId", "in": "path", "description": "Subject GUID", "required": true, "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Success", "content": { "text/plain": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/QuizHistoryItem" } } }, "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/QuizHistoryItem" } } }, "text/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/QuizHistoryItem" } } } } }, "401": { "description": "Unauthorized", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } } } } }, "/api/Subject": { "post": { "tags": [ "Subject" ], "summary": "Create a new study subject", "description": "Subjects act as folders to group related documents together.\r\nSubject names must be unique per user.", "requestBody": { "description": "Contains the `Name` of the new subject.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SubjectRequest" } }, "text/json": { "schema": { "$ref": "#/components/schemas/SubjectRequest" } }, "application/*+json": { "schema": { "$ref": "#/components/schemas/SubjectRequest" } } } }, "responses": { "200": { "description": "Subject created successfully — returns SubjectResponse", "content": { "text/plain": { "schema": { "$ref": "#/components/schemas/SubjectResponse" } }, "application/json": { "schema": { "$ref": "#/components/schemas/SubjectResponse" } }, "text/json": { "schema": { "$ref": "#/components/schemas/SubjectResponse" } } } }, "401": { "description": "Invalid or missing token", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } }, "400": { "description": "Validation Error or Subject Name already exists", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } } } }, "get": { "tags": [ "Subject" ], "summary": "Get all subjects for the current user", "description": "Retrieves a list of all subjects created by the authenticated user, along with a nested list of their associated Documents.", "responses": { "200": { "description": "List of subjects and their documents", "content": { "text/plain": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/SubjectResponse" } } }, "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/SubjectResponse" } } }, "text/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/SubjectResponse" } } } } }, "401": { "description": "Invalid or missing token", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } } } } }, "/api/Subject/{id}": { "get": { "tags": [ "Subject" ], "summary": "Get a subject by ID", "parameters": [ { "name": "id", "in": "path", "description": "Subject GUID", "required": true, "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Subject found", "content": { "text/plain": { "schema": { "$ref": "#/components/schemas/SubjectResponse" } }, "application/json": { "schema": { "$ref": "#/components/schemas/SubjectResponse" } }, "text/json": { "schema": { "$ref": "#/components/schemas/SubjectResponse" } } } }, "401": { "description": "Invalid or missing token", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } }, "404": { "description": "Subject not found", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } } } }, "put": { "tags": [ "Subject" ], "summary": "Update a subject by ID", "description": "Updates the name of an existing subject.", "parameters": [ { "name": "id", "in": "path", "description": "Subject GUID", "required": true, "schema": { "type": "string", "format": "uuid" } } ], "requestBody": { "description": "Contains the new `Name` for the subject.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SubjectRequest" } }, "text/json": { "schema": { "$ref": "#/components/schemas/SubjectRequest" } }, "application/*+json": { "schema": { "$ref": "#/components/schemas/SubjectRequest" } } } }, "responses": { "200": { "description": "Subject updated successfully", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } }, "400": { "description": "Validation Error or Name already exists", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } }, "401": { "description": "Invalid or missing token", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } } } }, "delete": { "tags": [ "Subject" ], "summary": "Delete a subject by ID", "description": "Deletes the subject. \r\n**Warning:** This will also permanently delete all Documents grouped under this subject, including their physical files and AI Knowledge Graph data.", "parameters": [ { "name": "id", "in": "path", "description": "Subject GUID", "required": true, "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "Subject and its associated documents deleted", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } }, "400": { "description": "Subject not found or validation error", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } }, "401": { "description": "Invalid or missing token", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } } } } }, "/api/Subject/{id}/documents/dropdown": { "get": { "tags": [ "Subject" ], "summary": "Get documents for a subject (Dropdown Optimized)", "description": "Returns a lightweight list containing only the `Id` and `FileName` of the documents belonging to a subject.\r\nOptimized for use in dropdown menus when creating a new Chat Session.", "parameters": [ { "name": "id", "in": "path", "description": "Subject GUID", "required": true, "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "List of document dropdown items", "content": { "text/plain": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/DocumentDropdownResponse" } } }, "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/DocumentDropdownResponse" } } }, "text/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/DocumentDropdownResponse" } } } } }, "401": { "description": "Invalid or missing token", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } }, "404": { "description": "Subject not found", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } } } } }, "/api/User/profile": { "get": { "tags": [ "User" ], "summary": "Get the current user's profile", "description": "Fetches the profile data (FirstName, LastName, Email) for the currently authenticated user.", "responses": { "200": { "description": "Returns UserResponse profile data", "content": { "text/plain": { "schema": { "$ref": "#/components/schemas/UserResponse" } }, "application/json": { "schema": { "$ref": "#/components/schemas/UserResponse" } }, "text/json": { "schema": { "$ref": "#/components/schemas/UserResponse" } } } }, "401": { "description": "Invalid or missing token", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } }, "404": { "description": "User not found", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } } } }, "put": { "tags": [ "User" ], "summary": "Update the current user's profile", "description": "Updates the authenticated user's Data", "requestBody": { "description": "Contains the new `FirstName` `LastName` and/or `Email`.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserUpdateRequest" } }, "text/json": { "schema": { "$ref": "#/components/schemas/UserUpdateRequest" } }, "application/*+json": { "schema": { "$ref": "#/components/schemas/UserUpdateRequest" } } } }, "responses": { "200": { "description": "Profile updated successfully — returns UserResponse", "content": { "text/plain": { "schema": { "$ref": "#/components/schemas/UserResponse" } }, "application/json": { "schema": { "$ref": "#/components/schemas/UserResponse" } }, "text/json": { "schema": { "$ref": "#/components/schemas/UserResponse" } } } }, "401": { "description": "Invalid or missing token", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } }, "404": { "description": "Not Found", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } }, "400": { "description": "Validation error" } } }, "delete": { "tags": [ "User" ], "summary": "Delete the current user's account permanently", "responses": { "200": { "description": "Account deleted Successfully", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } }, "401": { "description": "Invalid or missing token", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } }, "404": { "description": "Not Found", "content": { "text/plain": { "schema": { "type": "string" } }, "application/json": { "schema": { "type": "string" } }, "text/json": { "schema": { "type": "string" } } } }, "400": { "description": "Validation error" } } } } }, "components": { "schemas": { "AIChunkRequest": { "type": "object", "properties": { "file_path": { "type": "string", "nullable": true }, "file_type": { "type": "string", "nullable": true } }, "additionalProperties": false }, "AICitation": { "type": "object", "properties": { "document_id": { "type": "string", "format": "uuid", "nullable": true }, "chunk_id": { "type": "string", "format": "uuid" }, "page_start": { "type": "integer", "format": "int32", "nullable": true }, "page_end": { "type": "integer", "format": "int32", "nullable": true } }, "additionalProperties": false }, "AIMessageResponse": { "type": "object", "properties": { "answer": { "type": "string", "nullable": true }, "confidence_score": { "type": "number", "format": "double" }, "citations": { "type": "array", "items": { "$ref": "#/components/schemas/AICitation" }, "nullable": true }, "kg_context": { "$ref": "#/components/schemas/KgContextData" } }, "additionalProperties": false }, "AuthResponse": { "type": "object", "properties": { "userId": { "type": "string", "format": "uuid" }, "email": { "type": "string", "nullable": true }, "token": { "type": "string", "nullable": true }, "expiresIn": { "type": "string", "format": "date-time" }, "message": { "type": "string", "nullable": true }, "isAuthenticated": { "type": "boolean" } }, "additionalProperties": false }, "ChangePasswordRequestDto": { "type": "object", "properties": { "oldPassword": { "type": "string", "nullable": true }, "newPassword": { "type": "string", "nullable": true }, "confirmNewPassword": { "type": "string", "nullable": true } }, "additionalProperties": false }, "ChatMessageResponse": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "sessionId": { "type": "string", "format": "uuid" }, "role": { "type": "string", "nullable": true }, "content": { "type": "string", "nullable": true }, "confidenceScore": { "type": "number", "format": "double", "nullable": true }, "createdAt": { "type": "string", "format": "date-time", "nullable": true }, "audioUrl": { "type": "string", "nullable": true }, "webSource": { "type": "array", "items": { "$ref": "#/components/schemas/WebSources" }, "nullable": true }, "aiCitation": { "type": "array", "items": { "$ref": "#/components/schemas/AICitation" }, "nullable": true }, "kgContext": { "$ref": "#/components/schemas/KgContextData" } }, "additionalProperties": false }, "ChatSessionRequest": { "required": [ "documentIds", "userId" ], "type": "object", "properties": { "userId": { "type": "string", "format": "uuid" }, "documentIds": { "type": "array", "items": { "type": "string", "format": "uuid" } } }, "additionalProperties": false }, "ChatSessionResponse": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "title": { "type": "string", "nullable": true }, "startedAt": { "type": "string", "format": "date-time", "nullable": true }, "updatedAt": { "type": "string", "format": "date-time", "nullable": true }, "numberOfDocuments": { "type": "integer", "format": "int32" }, "documents": { "type": "array", "items": { "$ref": "#/components/schemas/DocumentResponse" }, "nullable": true } }, "additionalProperties": false }, "ChatSessionUpdate": { "required": [ "sessionId", "title", "userId" ], "type": "object", "properties": { "sessionId": { "type": "string", "format": "uuid" }, "userId": { "type": "string", "format": "uuid" }, "title": { "maxLength": 255, "minLength": 1, "type": "string" } }, "additionalProperties": false }, "ConceptMasteryDto": { "type": "object", "properties": { "conceptName": { "type": "string", "nullable": true }, "errorCount": { "type": "integer", "format": "int32" } }, "additionalProperties": false }, "DocumentDropdownResponse": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "fileName": { "type": "string", "nullable": true } }, "additionalProperties": false }, "DocumentResponse": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "subjectId": { "type": "string", "format": "uuid" }, "userId": { "type": "string", "format": "uuid" }, "fileName": { "type": "string", "nullable": true }, "fileType": { "type": "string", "nullable": true }, "fileSize": { "type": "integer", "format": "int32", "nullable": true }, "uploadTime": { "type": "string", "format": "date-time", "nullable": true }, "processingStatus": { "type": "string", "nullable": true }, "kgStatus": { "type": "string", "nullable": true }, "quizChunkingStatus": { "type": "string", "nullable": true }, "storagePath": { "type": "string", "nullable": true } }, "additionalProperties": false }, "DocumentUpdate": { "required": [ "id", "userId" ], "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "userId": { "type": "string", "format": "uuid" }, "newName": { "type": "string", "nullable": true }, "newSubjectId": { "type": "string", "format": "uuid" } }, "additionalProperties": false }, "ForgotPasswordRequestDto": { "type": "object", "properties": { "email": { "type": "string", "nullable": true } }, "additionalProperties": false }, "KgContextData": { "type": "object", "properties": { "entities": { "type": "array", "items": { "$ref": "#/components/schemas/KgEntity" }, "nullable": true }, "relationships": { "type": "array", "items": { "$ref": "#/components/schemas/KgRelation" }, "nullable": true } }, "additionalProperties": false }, "KgEntity": { "type": "object", "properties": { "id": { "type": "string", "nullable": true }, "label": { "type": "string", "nullable": true }, "type": { "type": "string", "nullable": true } }, "additionalProperties": false }, "KgRelation": { "type": "object", "properties": { "source": { "type": "string", "nullable": true }, "relation": { "type": "string", "nullable": true }, "target": { "type": "string", "nullable": true } }, "additionalProperties": false }, "LoginRequest": { "type": "object", "properties": { "email": { "type": "string", "nullable": true }, "password": { "type": "string", "nullable": true } }, "additionalProperties": false }, "McqChunkInput": { "type": "object", "properties": { "chunk_id": { "type": "string", "format": "uuid" }, "document_id": { "type": "string", "format": "uuid", "nullable": true }, "chunk_text": { "type": "string", "nullable": true }, "context_prev_sentence": { "type": "string", "nullable": true }, "context_next_sentence": { "type": "string", "nullable": true }, "bloom_level": { "type": "string", "nullable": true }, "chunk_type": { "type": "string", "nullable": true }, "concepts": { "type": "array", "items": { "type": "string" }, "nullable": true }, "keywords": { "type": "array", "items": { "type": "string" }, "nullable": true } }, "additionalProperties": false }, "McqGenerateRequest": { "type": "object", "properties": { "chunks": { "type": "array", "items": { "$ref": "#/components/schemas/McqChunkInput" }, "nullable": true }, "number_of_questions": { "type": "integer", "format": "int32" }, "mcqs_per_chunk": { "type": "integer", "format": "int32" } }, "additionalProperties": false }, "McqGenerateResponse": { "type": "object", "properties": { "mcqs": { "type": "array", "items": { "$ref": "#/components/schemas/McqGeneratedQuestion" }, "nullable": true } }, "additionalProperties": false }, "McqGeneratedOption": { "type": "object", "properties": { "label": { "type": "string" }, "text": { "type": "string", "nullable": true } }, "additionalProperties": false }, "McqGeneratedQuestion": { "type": "object", "properties": { "question_text": { "type": "string", "nullable": true }, "options": { "type": "array", "items": { "$ref": "#/components/schemas/McqGeneratedOption" }, "nullable": true }, "correct_option": { "type": "string" }, "explanation": { "type": "string", "nullable": true }, "concept": { "type": "string", "nullable": true }, "bloom_level": { "type": "string", "nullable": true }, "chunk_id": { "type": "string", "description": "Primary source chunk that generated this question.", "format": "uuid", "nullable": true } }, "additionalProperties": false }, "MonthlyPerformanceDto": { "type": "object", "properties": { "month": { "type": "string", "nullable": true }, "score": { "type": "integer", "format": "int32" } }, "additionalProperties": false }, "ProblemDetails": { "type": "object", "properties": { "type": { "type": "string", "nullable": true }, "title": { "type": "string", "nullable": true }, "status": { "type": "integer", "format": "int32", "nullable": true }, "detail": { "type": "string", "nullable": true }, "instance": { "type": "string", "nullable": true } }, "additionalProperties": { } }, "ProgressDashboardResponseDto": { "type": "object", "properties": { "totalQuizzes": { "type": "integer", "format": "int32" }, "activeSubjects": { "type": "integer", "format": "int32" }, "overallMastery": { "type": "integer", "format": "int32" }, "monthlyPerformance": { "type": "array", "items": { "$ref": "#/components/schemas/MonthlyPerformanceDto" }, "nullable": true }, "subjectProgress": { "type": "array", "items": { "$ref": "#/components/schemas/SubjectProgressDto" }, "nullable": true }, "weakConcepts": { "type": "array", "items": { "$ref": "#/components/schemas/ConceptMasteryDto" }, "nullable": true } }, "additionalProperties": false }, "QuizAnswerItem": { "required": [ "questionId", "selectedOption" ], "type": "object", "properties": { "questionId": { "type": "string", "format": "uuid" }, "selectedOption": { "type": "string" } }, "additionalProperties": false }, "QuizAttemptSummary": { "type": "object", "properties": { "attemptId": { "type": "string", "format": "uuid" }, "attemptNumber": { "type": "integer", "format": "int32" }, "score": { "type": "number", "format": "double", "nullable": true }, "startedAt": { "type": "string", "format": "date-time", "nullable": true }, "finishedAt": { "type": "string", "format": "date-time", "nullable": true } }, "additionalProperties": false }, "QuizChunkResponse": { "type": "object", "properties": { "chunk_index": { "type": "integer", "format": "int32" }, "text": { "type": "string", "nullable": true }, "context_prev_sentence": { "type": "string", "nullable": true }, "context_next_sentence": { "type": "string", "nullable": true }, "semantic_score": { "type": "number", "format": "double", "nullable": true }, "quality_score": { "type": "number", "format": "double", "nullable": true }, "bloom_level": { "type": "string", "nullable": true }, "chunk_type": { "type": "string", "nullable": true }, "concepts": { "type": "array", "items": { "type": "string" }, "nullable": true }, "keywords": { "type": "array", "items": { "type": "string" }, "nullable": true } }, "additionalProperties": false }, "QuizHistoryItem": { "type": "object", "properties": { "quizId": { "type": "string", "format": "uuid" }, "status": { "type": "string", "nullable": true }, "subjectId": { "type": "string", "format": "uuid", "nullable": true }, "subjectName": { "type": "string", "nullable": true }, "questionCount": { "type": "integer", "format": "int32" }, "createdAt": { "type": "string", "format": "date-time", "nullable": true }, "attemptCount": { "type": "integer", "format": "int32" }, "bestScore": { "type": "number", "format": "double", "nullable": true } }, "additionalProperties": false }, "QuizInitiateRequest": { "required": [ "documentIds", "numberOfQuestions", "subjectId" ], "type": "object", "properties": { "subjectId": { "type": "string", "format": "uuid" }, "documentIds": { "minItems": 1, "type": "array", "items": { "type": "string", "format": "uuid" } }, "numberOfQuestions": { "maximum": 2147483647, "minimum": 1, "type": "integer", "format": "int32" } }, "additionalProperties": false }, "QuizInitiateResponse": { "type": "object", "properties": { "quizId": { "type": "string", "format": "uuid" }, "status": { "type": "string", "nullable": true }, "message": { "type": "string", "nullable": true } }, "additionalProperties": false }, "QuizOptionDto": { "type": "object", "properties": { "label": { "type": "string" }, "text": { "type": "string", "nullable": true } }, "additionalProperties": false }, "QuizQuestionDto": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "slotIndex": { "type": "integer", "format": "int32" }, "questionText": { "type": "string", "nullable": true }, "bloomLevel": { "type": "string", "nullable": true }, "concept": { "type": "string", "nullable": true }, "options": { "type": "array", "items": { "$ref": "#/components/schemas/QuizOptionDto" }, "nullable": true } }, "additionalProperties": false }, "QuizReviewQuestionDto": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "questionText": { "type": "string", "nullable": true }, "explanation": { "type": "string", "nullable": true }, "bloomLevel": { "type": "string", "nullable": true }, "concept": { "type": "string", "nullable": true }, "correctOption": { "type": "string", "description": "The original (unshuffled) correct label stored in DB." }, "selectedOption": { "type": "string", "description": "The original label the student selected (after reverse-mapping).", "nullable": true }, "isCorrect": { "type": "boolean" }, "options": { "type": "array", "items": { "$ref": "#/components/schemas/QuizOptionDto" }, "nullable": true } }, "additionalProperties": false }, "QuizReviewResponse": { "type": "object", "properties": { "attemptId": { "type": "string", "format": "uuid" }, "quizId": { "type": "string", "format": "uuid" }, "score": { "type": "number", "format": "double" }, "correctCount": { "type": "integer", "format": "int32" }, "totalCount": { "type": "integer", "format": "int32" }, "startedAt": { "type": "string", "format": "date-time", "nullable": true }, "finishedAt": { "type": "string", "format": "date-time", "nullable": true }, "questions": { "type": "array", "items": { "$ref": "#/components/schemas/QuizReviewQuestionDto" }, "nullable": true } }, "additionalProperties": false }, "QuizStartResponse": { "type": "object", "properties": { "quizId": { "type": "string", "format": "uuid" }, "attemptId": { "type": "string", "format": "uuid" }, "attemptNumber": { "type": "integer", "format": "int32" }, "questions": { "type": "array", "items": { "$ref": "#/components/schemas/QuizQuestionDto" }, "nullable": true } }, "additionalProperties": false }, "QuizStatusResponse": { "type": "object", "properties": { "quizId": { "type": "string", "format": "uuid" }, "status": { "type": "string", "nullable": true }, "questionCount": { "type": "integer", "format": "int32" }, "generatedAt": { "type": "string", "format": "date-time", "nullable": true } }, "additionalProperties": false }, "QuizSubmitRequest": { "required": [ "answers", "attemptId" ], "type": "object", "properties": { "attemptId": { "type": "string", "format": "uuid" }, "answers": { "minItems": 1, "type": "array", "items": { "$ref": "#/components/schemas/QuizAnswerItem" } } }, "additionalProperties": false }, "QuizSubmitResponse": { "type": "object", "properties": { "attemptId": { "type": "string", "format": "uuid" }, "score": { "type": "number", "format": "double" }, "correctCount": { "type": "integer", "format": "int32" }, "totalCount": { "type": "integer", "format": "int32" }, "finishedAt": { "type": "string", "format": "date-time" } }, "additionalProperties": false }, "RegisterRequest": { "type": "object", "properties": { "firstName": { "type": "string", "nullable": true }, "lastName": { "type": "string", "nullable": true }, "email": { "type": "string", "nullable": true }, "password": { "type": "string", "nullable": true } }, "additionalProperties": false }, "ResetPasswordRequestDto": { "type": "object", "properties": { "email": { "type": "string", "nullable": true }, "otp": { "pattern": "^\\d{6}$", "type": "string", "description": "The 6-digit one-time password sent to the user's email.", "nullable": true }, "newPassword": { "type": "string", "nullable": true }, "confirmNewPassword": { "type": "string", "nullable": true } }, "additionalProperties": false }, "STTResponse": { "type": "object", "properties": { "text": { "type": "string", "nullable": true } }, "additionalProperties": false }, "SubjectProgressDto": { "type": "object", "properties": { "subject": { "type": "string", "nullable": true }, "mastery": { "type": "integer", "format": "int32" }, "quizzes": { "type": "integer", "format": "int32" }, "studyTime": { "type": "string", "nullable": true } }, "additionalProperties": false }, "SubjectRequest": { "required": [ "name" ], "type": "object", "properties": { "name": { "maxLength": 255, "minLength": 0, "type": "string" } }, "additionalProperties": false }, "SubjectResponse": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "name": { "type": "string", "nullable": true }, "userId": { "type": "string", "format": "uuid" }, "documents": { "type": "array", "items": { "$ref": "#/components/schemas/DocumentResponse" }, "nullable": true } }, "additionalProperties": false }, "TTSResponse": { "type": "object", "properties": { "audio_url": { "type": "string", "nullable": true } }, "additionalProperties": false }, "UserMessageRequest": { "required": [ "question", "searchWeb", "session_id", "user_id" ], "type": "object", "properties": { "question": { "minLength": 1, "type": "string" }, "user_id": { "type": "string", "format": "uuid" }, "session_id": { "type": "string", "format": "uuid" }, "allowed_document_ids": { "type": "array", "items": { "type": "string", "format": "uuid" }, "nullable": true }, "searchWeb": { "type": "boolean" } }, "additionalProperties": false }, "UserResponse": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "firstName": { "type": "string", "nullable": true }, "lastName": { "type": "string", "nullable": true }, "email": { "type": "string", "nullable": true }, "createdDate": { "type": "string", "format": "date-time", "nullable": true }, "numberOfSubjects": { "type": "integer", "format": "int32" }, "numberOfDocuments": { "type": "integer", "format": "int32" }, "numberOfQuizzes": { "type": "integer", "format": "int32" } }, "additionalProperties": false }, "UserUpdateRequest": { "type": "object", "properties": { "firstName": { "type": "string", "nullable": true }, "lastName": { "type": "string", "nullable": true }, "email": { "type": "string", "format": "email", "nullable": true } }, "additionalProperties": false }, "WebSearchResponse": { "type": "object", "properties": { "answer": { "type": "string", "nullable": true }, "sources": { "type": "array", "items": { "$ref": "#/components/schemas/WebSources" }, "nullable": true } }, "additionalProperties": false }, "WebSources": { "type": "object", "properties": { "title": { "type": "string", "nullable": true }, "url": { "type": "string", "nullable": true }, "domain": { "type": "string", "nullable": true } }, "additionalProperties": false } }, "securitySchemes": { "Bearer": { "type": "http", "description": "Enter Your JWT Access Token", "scheme": "Bearer", "bearerFormat": "JWT" } } }, "security": [ { "Bearer": [ ] } ] }