{ "openapi": "3.1.1", "info": { "title": "CampusPulse.Api | v1", "version": "1.0.0" }, "paths": { "/health": { "get": { "tags": [ "Health" ], "operationId": "GetHealth", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HealthResponse" } } } } } } }, "/health/ready": { "get": { "tags": [ "Health" ], "operationId": "GetReadiness", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HealthResponse" } } } }, "503": { "description": "Service Unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HealthResponse" } } } } } } }, "/me": { "get": { "tags": [ "Users" ], "operationId": "GetMe", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MeResponse" } } } }, "404": { "description": "Not Found", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "401": { "description": "Unauthorized" } }, "security": [ { "Bearer": [ ] } ] }, "post": { "tags": [ "Users" ], "operationId": "CreateMe", "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MeResponse" } } } }, "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MeResponse" } } } }, "401": { "description": "Unauthorized" } }, "security": [ { "Bearer": [ ] } ] }, "delete": { "tags": [ "Users" ], "operationId": "DeleteMe", "responses": { "204": { "description": "No Content" }, "401": { "description": "Unauthorized" } }, "security": [ { "Bearer": [ ] } ] } }, "/me/devices": { "post": { "tags": [ "Push" ], "operationId": "RegisterPushDevice", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RegisterDeviceRequest" } } }, "required": true }, "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DeviceResponse" } } } }, "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DeviceResponse" } } } }, "400": { "description": "Bad Request", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "404": { "description": "Not Found", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "401": { "description": "Unauthorized" } }, "security": [ { "Bearer": [ ] } ] }, "delete": { "tags": [ "Push" ], "operationId": "UnregisterPushDevice", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UnregisterDeviceRequest" } } }, "required": true }, "responses": { "204": { "description": "No Content" }, "400": { "description": "Bad Request", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "401": { "description": "Unauthorized" } }, "security": [ { "Bearer": [ ] } ] } }, "/me/notifications/test": { "post": { "tags": [ "Push" ], "operationId": "SendTestNotification", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TestNotificationResponse" } } } }, "404": { "description": "Not Found", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "429": { "description": "Too Many Requests", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "502": { "description": "Bad Gateway", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "401": { "description": "Unauthorized" } }, "security": [ { "Bearer": [ ] } ] } }, "/semesters/current": { "get": { "tags": [ "Timetable" ], "operationId": "GetCurrentSemester", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SemesterResponse" } } } }, "404": { "description": "Not Found", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "401": { "description": "Unauthorized" } }, "security": [ { "Bearer": [ ] } ] } }, "/timetable/programmes": { "get": { "tags": [ "Timetable" ], "operationId": "GetProgrammes", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/ProgrammeResponse" } } } } }, "404": { "description": "Not Found", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "401": { "description": "Unauthorized" } }, "security": [ { "Bearer": [ ] } ] } }, "/timetable/groups/{id}": { "get": { "tags": [ "Timetable" ], "operationId": "GetGroupTimetable", "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } }, { "name": "from", "in": "query", "schema": { "type": "string", "format": "date" } }, { "name": "to", "in": "query", "schema": { "type": "string", "format": "date" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TimetableResponse" } } } }, "400": { "description": "Bad Request", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "404": { "description": "Not Found", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "401": { "description": "Unauthorized" } }, "security": [ { "Bearer": [ ] } ] } }, "/timetable/groups/{id}/choices": { "get": { "tags": [ "Timetable" ], "operationId": "GetGroupChoices", "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/ChoiceSubjectResponse" } } } } }, "404": { "description": "Not Found", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "401": { "description": "Unauthorized" } }, "security": [ { "Bearer": [ ] } ] } }, "/me/settings": { "get": { "tags": [ "Timetable" ], "operationId": "GetStudentSettings", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/StudentSettingsResponse" } } } }, "404": { "description": "Not Found", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "401": { "description": "Unauthorized" } }, "security": [ { "Bearer": [ ] } ] }, "put": { "tags": [ "Timetable" ], "operationId": "UpdateStudentSettings", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateStudentSettingsRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/StudentSettingsResponse" } } } }, "400": { "description": "Bad Request", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "404": { "description": "Not Found", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "401": { "description": "Unauthorized" } }, "security": [ { "Bearer": [ ] } ] } }, "/me/subjects": { "get": { "tags": [ "Timetable" ], "operationId": "GetStudentSubjects", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/StudentSubjectResponse" } } } } }, "404": { "description": "Not Found", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "401": { "description": "Unauthorized" } }, "security": [ { "Bearer": [ ] } ] } }, "/me/subjects/{subjectId}": { "put": { "tags": [ "Timetable" ], "operationId": "PickStudentSubject", "parameters": [ { "name": "subjectId", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PickSubjectRequest" } } }, "required": true }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/StudentSubjectResponse" } } } }, "400": { "description": "Bad Request", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "404": { "description": "Not Found", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "401": { "description": "Unauthorized" } }, "security": [ { "Bearer": [ ] } ] }, "delete": { "tags": [ "Timetable" ], "operationId": "DropStudentSubject", "parameters": [ { "name": "subjectId", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } } ], "responses": { "204": { "description": "No Content" }, "404": { "description": "Not Found", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "401": { "description": "Unauthorized" } }, "security": [ { "Bearer": [ ] } ] } }, "/me/timetable": { "get": { "tags": [ "Timetable" ], "operationId": "GetMyTimetable", "parameters": [ { "name": "from", "in": "query", "schema": { "type": "string", "format": "date" } }, { "name": "to", "in": "query", "schema": { "type": "string", "format": "date" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TimetableResponse" } } } }, "400": { "description": "Bad Request", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "404": { "description": "Not Found", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "401": { "description": "Unauthorized" } }, "security": [ { "Bearer": [ ] } ] } }, "/rooms": { "get": { "tags": [ "Timetable" ], "operationId": "GetRooms", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/RoomResponse" } } } } }, "401": { "description": "Unauthorized" } }, "security": [ { "Bearer": [ ] } ] } }, "/rooms/{code}/timetable": { "get": { "tags": [ "Timetable" ], "operationId": "GetRoomTimetable", "parameters": [ { "name": "code", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "date", "in": "query", "schema": { "type": "string", "format": "date" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RoomTimetableResponse" } } } }, "400": { "description": "Bad Request", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "404": { "description": "Not Found", "content": { "application/problem+json": { "schema": { "$ref": "#/components/schemas/ProblemDetails" } } } }, "401": { "description": "Unauthorized" } }, "security": [ { "Bearer": [ ] } ] } } }, "components": { "schemas": { "ActivityKind": { "enum": [ "course", "lab", "seminar", "project", "facultative" ] }, "BreakResponse": { "required": [ "from", "to", "name" ], "type": "object", "properties": { "from": { "type": "string", "format": "date" }, "to": { "type": "string", "format": "date" }, "name": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/CalendarNameResponse" } ] } } }, "CalendarNameResponse": { "required": [ "ro", "en" ], "type": "object", "properties": { "ro": { "type": "string" }, "en": { "type": "string" } } }, "ChoiceSubjectResponse": { "required": [ "id", "name", "shortName", "campusVirtualUrl", "choice", "offers" ], "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "name": { "type": "string" }, "shortName": { "type": [ "null", "string" ] }, "campusVirtualUrl": { "type": [ "null", "string" ] }, "choice": { "$ref": "#/components/schemas/SubjectChoice" }, "offers": { "type": "array", "items": { "$ref": "#/components/schemas/OfferedSlotResponse" } } } }, "DayOfWeek": { "enum": [ "sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday" ] }, "DeviceResponse": { "required": [ "id", "platform", "createdAt", "lastRegisteredAt" ], "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "platform": { "$ref": "#/components/schemas/PushPlatform" }, "createdAt": { "type": "string", "format": "date-time" }, "lastRegisteredAt": { "type": "string", "format": "date-time" } } }, "HealthResponse": { "required": [ "status" ], "type": "object", "properties": { "status": { "type": "string" } } }, "MeResponse": { "required": [ "id", "email", "displayName" ], "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "email": { "type": "string" }, "displayName": { "type": "string" } } }, "NonTeachingDayResponse": { "required": [ "date", "reason" ], "type": "object", "properties": { "date": { "type": "string", "format": "date" }, "reason": { "$ref": "#/components/schemas/CalendarNameResponse" } } }, "OccurrenceResponse": { "required": [ "date", "week", "startsAt", "endsAt", "subjectId", "subject", "shortName", "campusVirtualUrl", "kinds", "room", "teacher", "note", "optional", "slotId", "offeredSlotId" ], "type": "object", "properties": { "date": { "type": "string", "format": "date" }, "week": { "type": "integer", "format": "int32" }, "startsAt": { "type": "string", "format": "time" }, "endsAt": { "type": "string", "format": "time" }, "subjectId": { "type": "string", "format": "uuid" }, "subject": { "type": "string" }, "shortName": { "type": [ "null", "string" ] }, "campusVirtualUrl": { "type": [ "null", "string" ] }, "kinds": { "type": "array", "items": { "$ref": "#/components/schemas/ActivityKind" } }, "room": { "type": [ "null", "string" ] }, "teacher": { "type": [ "null", "string" ] }, "note": { "type": [ "null", "string" ] }, "optional": { "type": "boolean" }, "slotId": { "type": [ "null", "string" ], "format": "uuid" }, "offeredSlotId": { "type": [ "null", "string" ], "format": "uuid" } } }, "OfferedSlotResponse": { "required": [ "id", "kinds", "weekday", "startsAt", "endsAt", "room", "weeks" ], "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "kinds": { "type": "array", "items": { "$ref": "#/components/schemas/ActivityKind" } }, "weekday": { "$ref": "#/components/schemas/DayOfWeek" }, "startsAt": { "type": "string", "format": "time" }, "endsAt": { "type": "string", "format": "time" }, "room": { "type": [ "null", "string" ] }, "weeks": { "type": "array", "items": { "type": "integer", "format": "int32" } } } }, "PickSubjectRequest": { "required": [ "offeredSlotId" ], "type": "object", "properties": { "offeredSlotId": { "type": [ "null", "string" ], "format": "uuid" } } }, "ProblemDetails": { "type": "object", "properties": { "type": { "type": [ "null", "string" ] }, "title": { "type": [ "null", "string" ] }, "status": { "type": [ "null", "integer" ], "format": "int32" }, "detail": { "type": [ "null", "string" ] }, "instance": { "type": [ "null", "string" ] } } }, "ProgrammeResponse": { "required": [ "code", "name", "years" ], "type": "object", "properties": { "code": { "type": "string" }, "name": { "type": "string" }, "years": { "type": "array", "items": { "$ref": "#/components/schemas/ProgrammeYearResponse" } } } }, "ProgrammeYearResponse": { "required": [ "year", "groups" ], "type": "object", "properties": { "year": { "type": "integer", "format": "int32" }, "groups": { "type": "array", "items": { "$ref": "#/components/schemas/StudyGroupResponse" } } } }, "PushPlatform": { "enum": [ "android", "ios" ] }, "RegisterDeviceRequest": { "required": [ "token", "platform" ], "type": "object", "properties": { "token": { "type": "string" }, "platform": { "$ref": "#/components/schemas/PushPlatform" } } }, "RoomOccurrenceResponse": { "required": [ "startsAt", "endsAt", "subject", "campusVirtualUrl", "kinds", "groups", "offered" ], "type": "object", "properties": { "startsAt": { "type": "string", "format": "time" }, "endsAt": { "type": "string", "format": "time" }, "subject": { "type": "string" }, "campusVirtualUrl": { "type": [ "null", "string" ] }, "kinds": { "type": "array", "items": { "$ref": "#/components/schemas/ActivityKind" } }, "groups": { "type": "array", "items": { "type": "string" } }, "offered": { "type": "boolean" } } }, "RoomResponse": { "required": [ "code", "building", "floor", "capacity" ], "type": "object", "properties": { "code": { "type": "string" }, "building": { "type": [ "null", "string" ] }, "floor": { "type": [ "null", "string" ] }, "capacity": { "type": [ "null", "integer" ], "format": "int32" } } }, "RoomTimetableResponse": { "required": [ "date", "week", "room", "occurrences" ], "type": "object", "properties": { "date": { "type": "string", "format": "date" }, "week": { "type": [ "null", "integer" ], "format": "int32" }, "room": { "$ref": "#/components/schemas/RoomResponse" }, "occurrences": { "type": "array", "items": { "$ref": "#/components/schemas/RoomOccurrenceResponse" } } } }, "SemesterResponse": { "required": [ "id", "academicYear", "number", "weeks", "nonTeachingDays", "breaks", "today", "todayWeek" ], "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "academicYear": { "type": "string" }, "number": { "type": "integer", "format": "int32" }, "weeks": { "type": "array", "items": { "$ref": "#/components/schemas/TeachingWeekResponse" } }, "nonTeachingDays": { "type": "array", "items": { "$ref": "#/components/schemas/NonTeachingDayResponse" } }, "breaks": { "type": "array", "items": { "$ref": "#/components/schemas/BreakResponse" } }, "today": { "type": "string", "format": "date" }, "todayWeek": { "type": [ "null", "integer" ], "format": "int32" } } }, "StudentSettingsResponse": { "required": [ "studyGroup", "noLongerOffered", "fromAnotherSemester" ], "type": "object", "properties": { "studyGroup": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/StudyGroupResponse" } ] }, "noLongerOffered": { "type": "boolean" }, "fromAnotherSemester": { "type": "boolean" } } }, "StudentSubjectResponse": { "required": [ "subjectId", "name", "shortName", "campusVirtualUrl", "choice", "offeredSlotId", "noLongerOffered" ], "type": "object", "properties": { "subjectId": { "type": "string", "format": "uuid" }, "name": { "type": "string" }, "shortName": { "type": [ "null", "string" ] }, "campusVirtualUrl": { "type": [ "null", "string" ] }, "choice": { "$ref": "#/components/schemas/SubjectChoice" }, "offeredSlotId": { "type": [ "null", "string" ], "format": "uuid" }, "noLongerOffered": { "type": "boolean" } } }, "StudyGroupResponse": { "required": [ "id", "programmeCode", "programmeName", "year", "series", "label" ], "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "programmeCode": { "type": "string" }, "programmeName": { "type": "string" }, "year": { "type": "integer", "format": "int32" }, "series": { "type": "string" }, "label": { "type": "string" } } }, "SubjectChoice": { "enum": [ "fixed", "optional", "pickSlot" ] }, "TeachingWeekResponse": { "required": [ "number", "startsOn" ], "type": "object", "properties": { "number": { "type": "integer", "format": "int32" }, "startsOn": { "type": "string", "format": "date" } } }, "TestNotificationResponse": { "required": [ "sent" ], "type": "object", "properties": { "sent": { "type": "integer", "format": "int32" } } }, "TimetableNoteResponse": { "required": [ "text" ], "type": "object", "properties": { "text": { "type": "string" } } }, "TimetableResponse": { "required": [ "from", "to", "studyGroup", "occurrences", "notes" ], "type": "object", "properties": { "from": { "type": "string", "format": "date" }, "to": { "type": "string", "format": "date" }, "studyGroup": { "oneOf": [ { "type": "null" }, { "$ref": "#/components/schemas/StudyGroupResponse" } ] }, "occurrences": { "type": "array", "items": { "$ref": "#/components/schemas/OccurrenceResponse" } }, "notes": { "type": "array", "items": { "$ref": "#/components/schemas/TimetableNoteResponse" } } } }, "UnregisterDeviceRequest": { "required": [ "token" ], "type": "object", "properties": { "token": { "type": "string" } } }, "UpdateStudentSettingsRequest": { "required": [ "studyGroupId" ], "type": "object", "properties": { "studyGroupId": { "type": [ "null", "string" ], "format": "uuid" } } } }, "securitySchemes": { "Bearer": { "type": "http", "description": "A Microsoft access token for a UPT account, for this API's access_as_user scope.", "scheme": "bearer", "bearerFormat": "JWT" } } }, "tags": [ { "name": "Health" }, { "name": "Users" }, { "name": "Push" }, { "name": "Timetable" } ] }