openapi: 3.1.0 info: # Do not change the title, if the title changes, the import paths will be broken title: Api version: 0.1.0 description: Smart University Campus Assistant API servers: - url: /api description: Base API path tags: - name: health description: Health operations - name: events description: Campus events - name: departments description: Campus departments - name: faqs description: Frequently asked questions - name: chat description: AI assistant chat - name: courses description: Campus courses - name: calendar description: Academic calendar - name: locations description: Campus locations - name: feedback description: Student feedback paths: /healthz: get: operationId: healthCheck tags: [health] summary: Health check description: Returns server health status responses: "200": description: Healthy content: application/json: schema: $ref: "#/components/schemas/HealthStatus" /events: get: operationId: listEvents tags: [events] summary: List campus events parameters: - name: category in: query schema: type: string responses: "200": description: List of events content: application/json: schema: type: array items: $ref: "#/components/schemas/CampusEvent" /events/{id}: get: operationId: getEvent tags: [events] summary: Get a campus event by ID parameters: - name: id in: path required: true schema: type: integer responses: "200": description: Event details content: application/json: schema: $ref: "#/components/schemas/CampusEvent" "404": description: Not found content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" /departments: get: operationId: listDepartments tags: [departments] summary: List campus departments responses: "200": description: List of departments content: application/json: schema: type: array items: $ref: "#/components/schemas/Department" /departments/{id}: get: operationId: getDepartment tags: [departments] summary: Get a department by ID parameters: - name: id in: path required: true schema: type: integer responses: "200": description: Department details content: application/json: schema: $ref: "#/components/schemas/Department" "404": description: Not found content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" /faqs: get: operationId: listFaqs tags: [faqs] summary: List FAQs parameters: - name: category in: query schema: type: string - name: search in: query schema: type: string responses: "200": description: List of FAQs content: application/json: schema: type: array items: $ref: "#/components/schemas/Faq" /chat: post: operationId: sendChatMessage tags: [chat] summary: Send a message to the campus assistant requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/ChatRequest" responses: "200": description: Assistant response content: application/json: schema: $ref: "#/components/schemas/ChatResponse" /chat/{sessionId}/history: get: operationId: getChatHistory tags: [chat] summary: Get chat history for a session parameters: - name: sessionId in: path required: true schema: type: string responses: "200": description: Chat message history content: application/json: schema: type: array items: $ref: "#/components/schemas/ChatMessage" /stats: get: operationId: getCampusStats tags: [health] summary: Get campus overview stats responses: "200": description: Campus statistics content: application/json: schema: $ref: "#/components/schemas/CampusStats" /courses: get: operationId: listCourses tags: [courses] summary: List campus courses parameters: - name: department in: query schema: type: string - name: search in: query schema: type: string responses: "200": description: List of courses content: application/json: schema: type: array items: $ref: "#/components/schemas/Course" /courses/{id}: get: operationId: getCourse tags: [courses] summary: Get a course by ID parameters: - name: id in: path required: true schema: type: integer responses: "200": description: Course details content: application/json: schema: $ref: "#/components/schemas/Course" "404": description: Not found content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" /calendar: get: operationId: listCalendarEvents tags: [calendar] summary: List academic calendar events parameters: - name: category in: query schema: type: string responses: "200": description: List of calendar events content: application/json: schema: type: array items: $ref: "#/components/schemas/CalendarEvent" /locations: get: operationId: listLocations tags: [locations] summary: List campus locations parameters: - name: type in: query schema: type: string - name: search in: query schema: type: string responses: "200": description: List of campus locations content: application/json: schema: type: array items: $ref: "#/components/schemas/CampusLocation" /feedback: post: operationId: submitFeedback tags: [feedback] summary: Submit student feedback requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/FeedbackRequest" responses: "201": description: Feedback submitted content: application/json: schema: $ref: "#/components/schemas/FeedbackResponse" components: schemas: HealthStatus: type: object properties: status: type: string required: - status ErrorResponse: type: object properties: error: type: string required: - error CampusEvent: type: object properties: id: type: integer title: type: string description: type: string nullable: true location: type: string nullable: true eventDate: type: string nullable: true category: type: string nullable: true createdAt: type: string nullable: true required: - id - title Department: type: object properties: id: type: integer name: type: string description: type: string nullable: true contactEmail: type: string nullable: true contactPhone: type: string nullable: true location: type: string nullable: true officeHours: type: string nullable: true website: type: string nullable: true category: type: string nullable: true createdAt: type: string nullable: true required: - id - name Faq: type: object properties: id: type: integer question: type: string answer: type: string category: type: string nullable: true createdAt: type: string nullable: true required: - id - question - answer ChatRequest: type: object properties: message: type: string sessionId: type: string studentId: type: string nullable: true required: - message - sessionId ChatResponse: type: object properties: reply: type: string sessionId: type: string required: - reply - sessionId ChatMessage: type: object properties: id: type: integer sessionId: type: string role: type: string content: type: string createdAt: type: string nullable: true required: - id - sessionId - role - content CampusStats: type: object properties: totalEvents: type: integer totalDepartments: type: integer totalFaqs: type: integer upcomingEvents: type: integer required: - totalEvents - totalDepartments - totalFaqs - upcomingEvents Course: type: object properties: id: type: integer code: type: string name: type: string description: type: string nullable: true instructor: type: string nullable: true credits: type: integer nullable: true schedule: type: string nullable: true location: type: string nullable: true department: type: string nullable: true createdAt: type: string nullable: true required: - id - code - name CalendarEvent: type: object properties: id: type: integer title: type: string description: type: string nullable: true startDate: type: string endDate: type: string nullable: true category: type: string nullable: true createdAt: type: string nullable: true required: - id - title - startDate CampusLocation: type: object properties: id: type: integer name: type: string description: type: string nullable: true buildingCode: type: string nullable: true type: type: string nullable: true floor: type: string nullable: true hours: type: string nullable: true latitude: type: string nullable: true longitude: type: string nullable: true address: type: string nullable: true createdAt: type: string nullable: true required: - id - name FeedbackRequest: type: object properties: studentId: type: string nullable: true rating: type: integer comment: type: string nullable: true category: type: string nullable: true required: - rating FeedbackResponse: type: object properties: id: type: integer studentId: type: string nullable: true rating: type: integer comment: type: string nullable: true category: type: string nullable: true submittedAt: type: string nullable: true required: - id - rating