These notes describe implementation details observed in the public WebUntis frontend bundles. They are not an official or stable API contract. Every MCP operation must still be capability-driven, scoped to the signed-in user, and verified against the connected tenant.
- Classic frontend bundle:
WebUntis/static/2027.1.6/js/untis/main.js - New frontend environment version:
1.96.0-20260821 - New frontend uses both REST endpoints and selected legacy JSON-RPC services.
- The configured event transport is
wss://events.webuntis.com/.
The MCP must discover bundle/environment versions at runtime instead of hard-coding these values.
The classic login posts URL-encoded form data to
/WebUntis/j_spring_security_check with these fields:
schoolj_usernamej_passwordtoken(second-factor flow, when requested)newPassword(forced-password-change flow, when requested)
Observed response states include SUCCESS, NO_MANDANT,
MUST_SET_PASSWORD, MUST_UPDATE_LEGACY_PASSWORD, TOKEN_REQUIRED, and
LOGIN_ERROR. The resulting WebUntis session cookie must remain in one HTTP
session. Password changes and second-factor challenges should be completed
interactively rather than guessed by the MCP.
After cookie login, the new frontend performs GET /api/token/new. A
successful response body is a JWT string. Subsequent REST requests set:
Authorization: Bearer <JWT>Tenant-Id: <tenant id>X-Webuntis-Api-School-Year-Id: <school year id>where applicable
The JWT contains user/person IDs, roles and API permissions. The frontend
refreshes an expiring token through /api/token/new and redirects to the login
page when the cookie session has expired. Session status is checked with
POST /api/rest/view/v1/session/status and a JSON body.
Tokens, cookies, passwords and personally identifiable response values must never be logged or returned by diagnostic MCP tools.
A logged-in student session confirmed these calls and response structures:
GET /api/rest/view/v1/timetable/grid?timetableType=...returns display formats, weekday/time-grid definitions and slot durations.GET /api/rest/view/v1/timetable/filterreturns the preselected resource and the classes/students/teachers/rooms visible to the account.GET /api/rest/view/v1/timetable/entriesreturns days with resource metadata, grid entries, period IDs, durations, status, layout positions, subjects, teachers, rooms, lesson text and substitution text.GET /api/rest/view/v1/timetable/entries/settingsreturns visibility and highlighting flags.GET /api/rest/view/v1/messagesreturns incoming-message summaries including sender shape, timestamps, read state, attachment state and reply permissions.GET /api/rest/view/v1/messages/statusreturns the unread count.
The capture contained only GET traffic. It does not yet establish the concrete JSON DTO fields for absence/homework filters or any write operation.
The bundle contains generated API clients, including parameter assertions, HTTP methods and paths. Important user-facing groups include:
GET /api/rest/view/v1/schoolyearsGET /api/rest/view/v1/app/dataGET /api/rest/view/v1/app/platform-application/menusGET /api/rest/view/v1/app/third-party/dataGET /api/rest/view/v2/trigger/startupGET /api/rest/view/v1/messages/statusGET /api/rest/view/v1/messages/permissions
Menus, JWT permissions and endpoint responses should be used to advertise only operations available to the current account.
GET /api/rest/view/v1/timetable/entries accepts:
- required
start,end,resourceType - optional
format, comma-separatedresources, comma-separatedperiodTypes,timetableType, andlayout
Other discovered reads include entriesWeekOverview, filter, grid,
calendar, menu, search, availableRooms, and timetable settings.
POST /api/rest/view/v4/classreg/absencesloads absences with a JSON filter.PUT /api/rest/view/v3/classreg/absencesupdates an absence with JSON.DELETE /api/rest/view/v1/classreg/absences/{absenceId}deletes an absence.GET /api/rest/view/v1/classreg/absences/metaprovides form/filter metadata.POST /api/rest/view/v1/classreg/homework/listloads homework with JSON.GET /api/rest/view/v1/classreg/homework/metaprovides homework metadata.- Lesson-topic and open-period endpoints are also present.
Exact request DTO fields must come from sanitized live captures before write tools are enabled.
- Inbox/sent/draft reads exist in versions 1 and 2.
POST /api/rest/view/v2/messagessends multipart data with a JSONrequestpart and zero or moreattachmentsparts.POST /api/rest/view/v2/messages/usersis the corresponding user-recipient flow.- Draft create/update, reply, revoke, read-confirmation, attachment and bulk delete operations are present.
A future MCP must require explicit confirmation before sending, replying, revoking or deleting messages.
Student, guardian and class reads use:
GET /api/rest/view/v1/exams/for-studentGET /api/rest/view/v1/exams/for-guardianGET /api/rest/view/v1/exams/for-class
They accept optional start and end dates. Administrative exam creation,
editing, locks, types and statistics are also present but must be permission
gated.
The generated clients expose rooms, buildings, subjects, teachers, students, student duties, absence reasons, calendar entries, iCalendar subscriptions, files, profile settings, parent-teacher days, platform applications and advanced timetable-planning endpoints. Presence in the JavaScript bundle does not imply that the current user is authorized to use them.
The classic helper posts JSON-RPC 2.0 envelopes to
/WebUntis/jsonrpc_web/<service> with this shape:
{"id": 0, "method": "methodName", "params": [], "jsonrpc": "2.0"}The public login page was observed calling jsonCalendarService. JSON-RPC is a
fallback for functionality not exposed through the newer REST clients; REST
should be preferred where the current frontend already uses it.
- Implement school URL discovery, cookie login and interactive handling of token/password-change states.
- Exchange the cookie session for the short-lived REST JWT and refresh it without exposing it to MCP responses.
- Add read-only diagnostics, current-user capability discovery, school years, timetable, homework, absences, exams and message summaries.
- Add a constrained generic REST/JSON-RPC diagnostic call that blocks foreign origins and redacts sensitive data.
- Enable write operations only after their request DTOs have been captured and tested. Require explicit confirmation for messages, absence changes, calendar changes and deletions.
- Add fixture-based tests for token expiry, role restrictions, pagination, malformed responses and tenant-origin enforcement.