{"openapi":"3.1.0","info":{"title":"Tvoia API","description":"Backend for **Tvoia** (Твоя Школа) — an iOS client for the *Moia Shkola*\n(«Моя школа») school platform used by Ukrainian schools.\n\nTvoia does not own the school data. A fleet of scrapers signs in to the\nplatform on each user's behalf, normalises what it finds into MongoDB, and\nthis API serves that cache to the app. That shapes almost everything below:\nresponses come from the cache and are therefore fast but eventually\nconsistent, and most collections carry a \"last scraped\" timestamp so the\nclient can show its own freshness.\n\n---\n\n## Authentication\n\nEvery endpoint outside `/v1/auth` and `/v1/files` needs a **bearer token**:\n\n```http\nAuthorization: Bearer <jwt>\n```\n\n`POST /v1/auth/login` issues one. Tokens are HS256 JWTs valid for **90 days**\nwhose `sub` is the Tvoia user id; there is no refresh endpoint, so a client\nlogs in again when the token expires. Resolved users are cached for 60s, so a\npermission or profile change can take up to a minute to take effect.\n\nA missing, malformed or expired token gives `401`. Press **Authorize** above\nto try endpoints from this page.\n\n### Tvoia Web tokens\n\nThe browser workspace (web.tvoia.app) never takes a password. It shows a\nsix-character code and a QR; the phone app claims that code, chooses how\nlong the session lives and approves it; the browser then exchanges its own\nsecret for a **web token** (`/v1/web/pair/…`, tag *Web*). A web token is the\nsame HS256 JWT plus `sid` (the session record) and `aud: \"web\"`, and its\n`exp` is the session's expiry, so it stops exactly when the student asked.\nWeb sessions are listed and revoked under `/v1/auth/web/sessions`; a revoked\nor expired one answers `401` with `detail` `session_revoked`,\n`session_expired` or `session_not_found` — slugs only ever sent to web\ntokens. App tokens carry no `sid` and behave exactly as before. A few\nphone-only calls (approving a pairing, changing a session's lifetime)\nanswer `403 web_token_not_allowed` to a web token.\n\nWhen Moia Shkola stops accepting the password stored for an account (its\nOAuth server answers `invalid_grant`), every token of that account, app and\nweb alike, answers `401` with `detail` `platform_credentials_rejected` until\nthe student signs in again with the working password. Apps return to the\nlogin screen on any `401`, so nothing new is needed client side. `/v1/auth/logout`\nkeeps working for such an account.\n\n## Conventions\n\n**Trailing slashes** — automatic redirects are off (`redirect_slashes=False`),\nso every route is registered twice, with and without the trailing slash. Both\nspellings are live and identical; this page lists only the canonical one.\n\n**Field names** are `camelCase` in JSON, even though the Python and Mongo\nsides are `snake_case`. Ids are strings unless they come from the school\nplatform, which uses integers (`platformID`, recipient `id`).\n\n**Timestamps** are ISO-8601 UTC with a trailing `Z`\n(`2026-09-17T14:03:11Z`). A field that would otherwise be null sometimes\nserialises as the empty string for older clients' sake — treat `\"\"`,\n`null` and `1-01-01T00:00:00Z` as \"absent\".\n\n**Pagination** uses `skip`/`limit` and a consistent envelope:\n\n```json\n{ \"data\": [ ... ], \"total\": 412, \"skip\": 0, \"limit\": 50, \"hasMore\": true }\n```\n\n**Errors** are FastAPI's standard shape — `{\"detail\": \"...\"}` — with a\nmachine-readable slug rather than prose where the client branches on it\n(`already_answered`, `form_not_captured`, `platform_session_expired`).\nValidation failures give `422` with the usual per-field array.\n\n**Upstream failures.** When the school platform is unreachable the API\ngenerally serves the cache and succeeds rather than failing. Endpoints that\nmust talk to the platform live (sending a message, answering a survey) return\n`502` with a slug instead.\n\n## Parent mode\n\nA platform account without an own enrollment but with `childEnrollments` is a **parent**. Its scraped data belongs to the children, so every child-scoped read (`/grades*`, `/analytics/*`, `/attendance*`, `/remarks`, `/events*`, `/schedule*`, `/notifications`, `/activity`, `/homework*`, `/leaderboard*`, `/students/classmates`) accepts an optional `childID` query parameter (the child's `studentID` from `Me.children`) and defaults to `activeChildID`. Messaging, surveys, push and profile stay the parent's own. Parents cannot change the student's things — homework state/edits/sharing, custom lessons, room rules, study mode, library: with the `X-Tvoia-Client: ios/<version>` header those writes return 403 `parent_read_only`; without it (older builds) the routes behave exactly as before. Push titles for parents are prefixed with the child's first name and the payload carries `childID`.\n\nParent-centric additions: `GET /students/me/children/overview` (every child's day at a glance), `GET /students/me/weekly-summary` (the numbers behind the Sunday digest), `GET /people/resolve?name=` (the person behind a teacher name from the schedule, a grade or a remark — to open a chat from there). Alert rules in `PUT /push/preferences`: `low_grade_alert` + `low_grade_threshold` (a new grade at or below the threshold is pushed as `low_grade`), `unexcused_absence_alert` (`unexcused_absence`), `parent_meeting_alert` (`parent_meeting`, with `eventDate`), `homework_due_alert` (evening `homework_due` digest for the next school day), `weekly_digest` (Sunday `weekly_digest`), and when those two go out: `homework_due_time` / `weekly_digest_time` (\"HH:MM\" Kyiv, default \"17:00\", snapped to 30 minutes; 12:00-22:00 and 09:00-22:00). All default to off for students; parent accounts get them on once, when first recognised as a parent — except `homework_due_alert`, which stays off until the parent switches it on. Live Activities for parents follow the active child (the subject is prefixed with the child's name).\n\n## Realtime\n\n`GET /v1/chats/events` is a Server-Sent Events stream carrying new messages,\nread receipts and chat setting changes, so the app does not have to poll to feel\nlive. It uses the same bearer header as every other endpoint.\n\nMessages between two Tvoia users are also delivered directly rather than waiting\nfor the recipient's next scrape of the school platform, which is what used to\nput a couple of minutes between sending and receiving.\n\nThe stream is **best-effort**. Events published while a client is disconnected\nare not replayed, so it supplements polling rather than replacing it — reconcile\non connect, on `stream.lagged`, and on returning to the foreground. Unknown\nevent names must be ignored so new ones can be added safely.\n\nTvoia Web sessions ride the same stream: `session.created`, `session.updated`\n(the phone changed a session's lifetime), `session.expiring` (two minutes\nleft) and `session.revoked` (`sid` or `sids`, `reason` `user` / `all` /\n`expired`) — a browser whose `sid` appears there signs itself out at once.\n\nNotes (tag *Notes*) send `note.changed` (`id`, `version`, `batchId`, `meta`,\n`ops`), `note.removed` (`ids`), `folder.changed` and `folder.removed`.\nThe clipboard (tag *Clipboard*) rides it too: `clip.added` / `clip.updated`\n(`item`), `clip.removed` (`ids`, `reason` `user` / `clear` / `expired`),\neach with `sourceSid` (the web session that wrote, null from the phone) so\na writer can skip its own echo.\n\n## Compatibility policy\n\nSome users run a very old build, so the contract is strictly additive:\n**fields are only ever added — never renamed, removed, retyped, or made\nrequired.** An existing key keeps its type forever; new information arrives\nas new optional keys. Anything that hides data (privacy mode, feature gates)\nblanks a value in place rather than dropping the key.\n\n## Privacy\n\nA user who sets `hideNameOnLeaderboard` is hidden everywhere they appear as\na third party. Person payloads then carry only `id`, `name`, `avatarURL`,\n`isPrivate`, `isCurrentUser` and `isTvoiaUser`; their class, school, username\nand role are withheld. The person themself still sees their own full profile.\n\n## Feature gates\n\n`SURVEYS_ENABLED` and `SURVEYS_ALLOWED_USERNAMES` gate the Surveys endpoints.\nWhile the gate is closed, `GET /v1/surveys` returns an empty list with\n`pendingCount: 0` and survey detail/answer routes return `404` — for everyone\noutside the allow-list. Scraping and form capture keep running regardless, so\nno data is lost while the feature is dark.","version":"2.0.0","contact":{"name":"Tvoia","url":"https://tvoia.app"},"x-logo":{"url":"https://tvoia.app/icon.png","altText":"Tvoia"}},"paths":{"/v1/analytics/summary":{"get":{"tags":["Analytics"],"summary":"Get an analytics summary","operationId":"analytics_summary_v1_analytics_summary_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"period","in":"query","required":true,"schema":{"type":"string","title":"Period"}},{"name":"month","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":12,"minimum":1},{"type":"null"}],"title":"Month"}},{"name":"childID","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Parent accounts: which child (enrollment student id). Defaults to the active child.","title":"Childid"},"description":"Parent accounts: which child (enrollment student id). Defaults to the active child."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Headline numbers for the analytics screen: average, counts, best and worst subject."}},"/v1/analytics/trend":{"get":{"tags":["Analytics"],"summary":"Get the grade trend","operationId":"analytics_trend_v1_analytics_trend_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"period","in":"query","required":true,"schema":{"type":"string","title":"Period"}},{"name":"month","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":12,"minimum":1},{"type":"null"}],"title":"Month"}},{"name":"points","in":"query","required":false,"schema":{"type":"integer","maximum":365,"minimum":1,"default":30,"title":"Points"}},{"name":"childID","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Parent accounts: which child (enrollment student id). Defaults to the active child.","title":"Childid"},"description":"Parent accounts: which child (enrollment student id). Defaults to the active child."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Average grade bucketed over time, for the trend chart."}},"/v1/analytics/by-subject":{"get":{"tags":["Analytics"],"summary":"Break grades down by subject","operationId":"analytics_by_subject_v1_analytics_by_subject_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"period","in":"query","required":true,"schema":{"type":"string","title":"Period"}},{"name":"month","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":12,"minimum":1},{"type":"null"}],"title":"Month"}},{"name":"childID","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Parent accounts: which child (enrollment student id). Defaults to the active child.","title":"Childid"},"description":"Parent accounts: which child (enrollment student id). Defaults to the active child."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Average, count and spread per subject."}},"/v1/analytics/by-type":{"get":{"tags":["Analytics"],"summary":"Break grades down by type","operationId":"analytics_by_type_v1_analytics_by_type_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"period","in":"query","required":true,"schema":{"type":"string","title":"Period"}},{"name":"month","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":12,"minimum":1},{"type":"null"}],"title":"Month"}},{"name":"childID","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Parent accounts: which child (enrollment student id). Defaults to the active child.","title":"Childid"},"description":"Parent accounts: which child (enrollment student id). Defaults to the active child."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"How marks split across the platform's grade types."}},"/v1/analytics/heatmap":{"get":{"tags":["Analytics"],"summary":"Get a grade heatmap","operationId":"analytics_heatmap_v1_analytics_heatmap_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"weeks","in":"query","required":false,"schema":{"type":"integer","maximum":52,"minimum":1,"default":12,"title":"Weeks"}},{"name":"childID","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Parent accounts: which child (enrollment student id). Defaults to the active child.","title":"Childid"},"description":"Parent accounts: which child (enrollment student id). Defaults to the active child."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Per-day grade activity, shaped for a calendar heatmap."}},"/v1/analytics/subject":{"get":{"tags":["Analytics"],"summary":"One subject in depth","operationId":"analytics_subject_v1_analytics_subject_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"period","in":"query","required":true,"schema":{"type":"string","title":"Period"}},{"name":"month","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":12,"minimum":1},{"type":"null"}],"title":"Month"}},{"name":"subjectID","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subjectid"}},{"name":"subject","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Platform subject name, for rows /by-subject could not resolve","title":"Subject"},"description":"Platform subject name, for rows /by-subject could not resolve"},{"name":"childID","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Parent accounts: which child (enrollment student id). Defaults to the active child.","title":"Childid"},"description":"Parent accounts: which child (enrollment student id). Defaults to the active child."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`subject_not_found`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"`?period=&month=` as the other analytics routes, plus `subjectID` (or `subject`, the platform name, for rows `/by-subject` could not resolve). Every grade of the subject in the period, newest first, each with `value` (null when it does not count towards the average), `raw`, `type`, `typeName`, `date`, `color`, `attendance`, `counts`, and the lesson's `topic` and `teacher` when the timetable has them; plus `average`, `sum`, `count`, `distribution` (1 to 12), `byType`, `trend` (running average per day), `absences`, `otherMarks`, `teachers` and `overall` `{sum, count, average}` across all subjects. Same averaging rule as `/summary` and `/by-subject`."}},"/v1/auth/login":{"post":{"tags":["Auth"],"summary":"Log in","operationId":"login_v1_auth_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Wrong credentials, or the platform rejected them.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; `Retry-After` says when. Body: `{\"detail\": {\"code\": \"rate_limited\", \"scope\": \"login.account\", \"retryAfter\": 540}}`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Exchange school-platform credentials for a bearer token valid for 90 days. There is no refresh endpoint — log in again when it expires.\n\n**Rate limited:** 5 logins per account and 30 per IP address per 10 minutes, since every login authenticates against the school platform. A returning account also gets its full background sync at most once per ten minutes; the login itself still succeeds. Cache the token (it is valid for 90 days) instead of logging in per request."}},"/v1/auth/reset-password":{"post":{"tags":["Auth"],"summary":"Reset the stored platform password","operationId":"reset_password_v1_auth_reset_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetPasswordRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}}},"description":"Replace the platform password Tvoia replays from its scrapers. Needed after the student changes it on the school site, otherwise every scrape starts failing."}},"/v1/auth/logout":{"post":{"tags":["Auth"],"summary":"Log out","operationId":"logout_v1_auth_logout_post","requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/LogoutRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"HTTPBearer":[]}],"description":"Unregister the device's push tokens and end the app token the call was made with: from then on that token answers 401 everywhere (other devices keep their own tokens). A web token can call it too but never clears the phones' push devices."}},"/v1/auth/account":{"delete":{"tags":["Auth"],"summary":"Delete account","operationId":"delete_account_v1_auth_account_delete","responses":{"204":{"description":"Successful Response"},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"HTTPBearer":[]}],"description":"Permanently delete the Tvoia account and everything scraped for it. Irreversible. Does not touch the student's account on the school platform. The shared demo account answers 204 and is kept."}},"/v1/auth/register":{"post":{"tags":["Auth"],"summary":"Register","operationId":"register_v1_auth_register_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_register_v1_auth_register_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"The platform rejected the credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"An account already exists for these credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"HTTPBearer":[]}],"description":"Create a Tvoia account from the student's school-platform credentials. The credentials are verified against the platform, stored encrypted, and an initial scrape is kicked off. Returns a bearer token."}},"/v1/auth/web/sessions":{"get":{"tags":["Auth"],"summary":"Signed-in browsers","description":"Every active Tvoia Web session (`?includeEnded=true` adds the last 30 days of ended ones). `isCurrent` marks the caller's own web session. From a web session the other browsers' IPs are masked.","operationId":"list_web_sessions_v1_auth_web_sessions_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"includeEnded","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Includeended"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Auth"],"summary":"Sign out everywhere (web)","description":"Revoke every web session. From a web session the caller's own is kept unless `keepCurrent=false`. Returns `{\"revoked\": n}`; each browser gets `session.revoked` on its event stream.","operationId":"revoke_all_web_sessions_v1_auth_web_sessions_delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"keepCurrent","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Keepcurrent"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/auth/web/sessions/{sid}":{"delete":{"tags":["Auth"],"summary":"Revoke one web session","operationId":"revoke_web_session_v1_auth_web_sessions__sid__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"sid","in":"path","required":true,"schema":{"type":"string","title":"Sid"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`session_not_found` — not this account's session.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Ends that browser's session; its next request answers `401 session_revoked` and its stream gets `session.revoked`."},"patch":{"tags":["Auth"],"summary":"Rename or extend a web session","description":"Body `{\"label\"?, \"expiryMode\"?, \"customMinutes\"?, \"childID\"?}`. Changing `expiryMode` is allowed from an **app** token only (the phone extends, the browser never extends itself); the browser then calls `POST /auth/web/refresh` for a token carrying the new expiry. Publishes `session.updated`.","operationId":"patch_web_session_v1_auth_web_sessions__sid__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"sid","in":"path","required":true,"schema":{"type":"string","title":"Sid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebSessionPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`web_token_not_allowed` — a web session tried to change its own lifetime.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"410":{"description":"`session_ended`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/auth/web/logout":{"post":{"tags":["Auth"],"summary":"Sign out (web)","description":"Revoke the caller's own web session. Web tokens only (`400 not_a_web_session` otherwise).","operationId":"web_logout_v1_auth_web_logout_post","responses":{"204":{"description":"Successful Response"},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/auth/web/refresh":{"post":{"tags":["Auth"],"summary":"Refresh a web token","description":"A new token for the caller's still-active web session whose `exp` matches the session's current expiry. Never extends anything by itself.","operationId":"web_refresh_v1_auth_web_refresh_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"`session_revoked` — the session has ended.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/students/me":{"get":{"tags":["Students"],"summary":"Get my profile","operationId":"get_me_v1_students_me_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"childID","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Parent accounts: which child (enrollment student id). Defaults to the active child.","title":"Childid"},"description":"Parent accounts: which child (enrollment student id). Defaults to the active child."}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"The signed-in student, merged from both platform accounts and the Tvoia account. This is the app's launch call."}},"/v1/students/me/children/overview":{"get":{"tags":["Students"],"summary":"All children at a glance (parent accounts)","description":"For each child: today's lesson count, the current and next lesson, grades and absences dated today, remarks in the last 7 days and what is due on the next school day (`homeworkDue.pending`; `doneKnown` is false when the child does not share done marks, in which case `pending` equals `total`). Students get `children: []`.","operationId":"children_overview_v1_students_me_children_overview_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/students/me/today":{"get":{"tags":["Students"],"summary":"Today in one call (Siri / Shortcuts)","description":"The day at a glance: today's lessons exactly as `GET /schedule` returns them (school and user-created lessons merged, each with an added `isCurrent`), the current and next lesson with the same rules as `/schedule/current-lesson`, what is due (`homeworkNext` — today's tasks until 15:00 Kyiv, the next school day after that; `date` says which), today's study mode when the student set one up, and a one-line `text` ready to be spoken. `lang` (`uk`, `en`, `lt`) picks the language of `text`; anything else means the account locale. Not cached — it depends on the wall clock. Parents: the active child or `childID`.","operationId":"today_briefing_v1_students_me_today_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"lang","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Language of `text`: uk, en or lt. Anything else falls back to the account locale.","title":"Lang"},"description":"Language of `text`: uk, en or lt. Anything else falls back to the account locale."},{"name":"childID","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Parent accounts: which child (enrollment student id). Defaults to the active child.","title":"Childid"},"description":"Parent accounts: which child (enrollment student id). Defaults to the active child."}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TodayBriefing"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/students/me/weekly-summary":{"get":{"tags":["Students"],"summary":"Week in review","description":"Grades (count, average, best subject, low grades), attendance (excused/unexcused/late), remarks (positive/negative), upcoming parent meetings and assessments, homework due next week, plus a ready-made one-line `text`. `weekOffset=1` is last week. `lang` (`uk`, `en`, `lt`) picks the language of `text` and the localised labels; anything else, or no value, means the account locale. Parents: the active child or `childID`.","operationId":"weekly_summary_v1_students_me_weekly_summary_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"weekOffset","in":"query","required":false,"schema":{"type":"integer","maximum":8,"minimum":0,"description":"0 = the current week (Monday to today), 1 = last week, …","default":0,"title":"Weekoffset"},"description":"0 = the current week (Monday to today), 1 = last week, …"},{"name":"lang","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Language of `text`: uk, en or lt. Anything else falls back to the account locale.","title":"Lang"},"description":"Language of `text`: uk, en or lt. Anything else falls back to the account locale."},{"name":"childID","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Parent accounts: which child (enrollment student id). Defaults to the active child.","title":"Childid"},"description":"Parent accounts: which child (enrollment student id). Defaults to the active child."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/students/me/active-child":{"patch":{"tags":["Students"],"summary":"Choose the child shown by default (parent accounts)","description":"Body `{\"childID\": <studentID>}`. 400 `unknown_child` when the id is not one of `children`; 400 `not_a_parent_account` for students. Returns the `Me` payload.","operationId":"set_active_child_v1_students_me_active_child_patch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActiveChildRequest"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/students/me/sharing":{"patch":{"tags":["Students"],"summary":"Share with parents (student accounts)","description":"Body `{\"shareWithParents\": true|false}`. Lets a linked parent account see this student's homework done marks (`childDone`) and study mode, read-only.","operationId":"set_sharing_v1_students_me_sharing_patch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SharingRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/students/me/privacy":{"patch":{"tags":["Students"],"summary":"Set privacy mode","operationId":"update_privacy_v1_students_me_privacy_patch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PrivacyRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"HTTPBearer":[]}],"description":"Toggle `hideNameOnLeaderboard`. When on, this student is reduced to avatar and name everywhere they appear to someone else — leaderboard, chat participants, person profiles and recipient search. See *Privacy* in the overview. Optional `leaderboardVisibility` (`everyone`, `school`, `class`, `off`; default `off`) is the one picker for both boards, with nested audiences: `everyone`/`school` name the student on the class board and on the Tvoia-wide board (to everyone / to their own school), `class` names them on the class board only, `off` leaves them an anonymous ranked row on the class board and off the Tvoia-wide one. Legacy `globalLeaderboard` (`everyone`, `school`, `off`; never `class`, which reads as `off`) and `classLeaderboardOptIn` are still accepted and returned; `leaderboardVisibility` wins when sent. Every field may be sent alone."}},"/v1/students/classmates":{"get":{"tags":["Students"],"summary":"List classmates","operationId":"get_classmates_v1_students_classmates_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"childID","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Parent accounts: which child (enrollment student id). Defaults to the active child.","title":"Childid"},"description":"Parent accounts: which child (enrollment student id). Defaults to the active child."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"The student's class as a leaderboard-shaped list, honouring each classmate's privacy mode."}},"/v1/subjects":{"get":{"tags":["Subjects"],"summary":"List subjects","operationId":"list_subjects_v1_subjects_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"HTTPBearer":[]}],"description":"The student's subjects with Tvoia's translated names and assigned colours."}},"/v1/teachers":{"get":{"tags":["Teachers"],"summary":"List teachers","operationId":"list_teachers_v1_teachers_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"HTTPBearer":[]}],"description":"Teachers seen across this student's lessons, grades and homework."}},"/v1/schedule":{"get":{"tags":["Schedule"],"summary":"Get the timetable","operationId":"get_schedule_v1_schedule_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"date","in":"query","required":true,"schema":{"type":"string","description":"YYYY-MM-DD","title":"Date"},"description":"YYYY-MM-DD"},{"name":"refresh","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Refresh"}},{"name":"childID","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Parent accounts: which child (enrollment student id). Defaults to the active child.","title":"Childid"},"description":"Parent accounts: which child (enrollment student id). Defaults to the active child."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Lessons for a date range, with room overrides and user-created lessons merged in.\n\n`refresh=1` skips the short server-side response cache (an explicit reload from the app after saving a room rule or custom lesson)."}},"/v1/schedule/lesson/{lesson_id}":{"get":{"tags":["Schedule"],"summary":"Get one lesson","operationId":"get_lesson_v1_schedule_lesson__lesson_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"lesson_id","in":"path","required":true,"schema":{"type":"string","title":"Lesson Id"}},{"name":"childID","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Parent accounts: which child (enrollment student id). Defaults to the active child.","title":"Childid"},"description":"Parent accounts: which child (enrollment student id). Defaults to the active child."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"A single lesson with its homework, grades and teacher resolved."}},"/v1/schedule/room":{"put":{"tags":["Schedule"],"summary":"Set a room override","operationId":"set_room_rule_v1_schedule_room_put","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoomRuleRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Pin a room for a subject; overrides whatever the platform's timetable says."},"delete":{"tags":["Schedule"],"summary":"Delete a room override","operationId":"delete_room_rule_v1_schedule_room_delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"weekday","in":"query","required":true,"schema":{"type":"integer","title":"Weekday"}},{"name":"lessonNumber","in":"query","required":true,"schema":{"type":"integer","title":"Lessonnumber"}},{"name":"subjectMatter","in":"query","required":true,"schema":{"type":"string","title":"Subjectmatter"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Reverts to the platform's room for that subject."}},"/v1/schedule/links":{"get":{"tags":["Schedule"],"summary":"List Lesson Links","operationId":"list_lesson_links_v1_schedule_links_get","security":[{"HTTPBearer":[]}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"tags":["Schedule"],"summary":"Set Lesson Link","description":"Sets the link for the lesson's teacher, its weekly slot or that one\nday. The lesson is named by its schedule id; subject, teacher, weekday,\nnumber and date are read from it, never trusted from the client.","operationId":"set_lesson_link_v1_schedule_links_put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"childID","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Parent accounts: which child (enrollment student id). Defaults to the active child.","title":"Childid"},"description":"Parent accounts: which child (enrollment student id). Defaults to the active child."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LessonLinkRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/schedule/links/{rule_id}":{"delete":{"tags":["Schedule"],"summary":"Delete Lesson Link","operationId":"delete_lesson_link_v1_schedule_links__rule_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","title":"Rule Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/schedule/current-lesson":{"get":{"tags":["Schedule"],"summary":"Get the current or next lesson","operationId":"get_current_lesson_v1_schedule_current_lesson_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"childID","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Parent accounts: which child (enrollment student id). Defaults to the active child.","title":"Childid"},"description":"Parent accounts: which child (enrollment student id). Defaults to the active child."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Computed live rather than served from cache — this drives the app's Live Activity and the home screen countdown."}},"/v1/schedule/rooms":{"get":{"tags":["Schedule"],"summary":"List room overrides","operationId":"list_room_rules_v1_schedule_rooms_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"HTTPBearer":[]}],"description":"Per-subject room rules the student has set, for when the timetable's room is wrong."}},"/v1/schedule/custom":{"get":{"tags":["Schedule"],"summary":"List user-created lessons","operationId":"list_custom_lessons_v1_schedule_custom_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"HTTPBearer":[]}],"description":"Lessons the student added themselves, which the platform knows nothing about."},"post":{"tags":["Schedule"],"summary":"Create a lesson","operationId":"create_custom_lesson_v1_schedule_custom_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomLessonBody"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"HTTPBearer":[]}],"description":"Add a lesson the timetable is missing — a club, a tutor, an extra class."}},"/v1/schedule/custom/{lesson_id}":{"patch":{"tags":["Schedule"],"summary":"Update a user-created lesson","operationId":"update_custom_lesson_v1_schedule_custom__lesson_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"lesson_id","in":"path","required":true,"schema":{"type":"string","title":"Lesson Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomLessonBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, or not the caller's.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Partial update of a lesson the student added themselves. Platform lessons are not editable here — set a room override or create a custom lesson instead."},"delete":{"tags":["Schedule"],"summary":"Delete a user-created lesson","operationId":"delete_custom_lesson_v1_schedule_custom__lesson_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"lesson_id","in":"path","required":true,"schema":{"type":"string","title":"Lesson Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, or not the caller's.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Removes the lesson from the timetable permanently. Only user-created lessons can be deleted; the platform's own lessons cannot."}},"/v1/schedule/study-mode":{"get":{"tags":["Schedule"],"summary":"Get study-mode settings","operationId":"get_study_mode_v1_schedule_study_mode_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"childID","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Parent accounts: which child (enrollment student id). Defaults to the active child.","title":"Childid"},"description":"Parent accounts: which child (enrollment student id). Defaults to the active child."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Which weekdays the student attends in person versus remotely."},"put":{"tags":["Schedule"],"summary":"Set study-mode settings","operationId":"set_study_mode_v1_schedule_study_mode_put","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StudyModeSettingsBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Replace the in-person/remote pattern: the school week (`schoolDays`), ordered rules (`weekdays`, `day_parity`, `week_parity`, or a `cycle` of N in-person then M remote school days, optionally carrying over across weeks) and one-off overrides."}},"/v1/schedule/study-mode/override":{"put":{"tags":["Schedule"],"summary":"Override study mode for one day","operationId":"set_study_override_v1_schedule_study_mode_override_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StudyModeOverrideRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"HTTPBearer":[]}],"description":"For a single date, e.g. a remote day in an otherwise in-person week."}},"/v1/schedule/study-mode/days":{"get":{"tags":["Schedule"],"summary":"Get resolved study-mode days","operationId":"study_mode_days_v1_schedule_study_mode_days_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"from","in":"query","required":true,"schema":{"type":"string","title":"From"}},{"name":"to","in":"query","required":true,"schema":{"type":"string","title":"To"}},{"name":"childID","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Parent accounts: which child (enrollment student id). Defaults to the active child.","title":"Childid"},"description":"Parent accounts: which child (enrollment student id). Defaults to the active child."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"The pattern expanded over a date range, with one-off overrides applied."}},"/v1/grades":{"get":{"tags":["Grades"],"summary":"List grades","operationId":"list_grades_v1_grades_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"subjectID","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subjectid"}},{"name":"semester","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Semester"}},{"name":"type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type"}},{"name":"dateFrom","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Datefrom"}},{"name":"dateTo","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dateto"}},{"name":"allYears","in":"query","required":false,"schema":{"type":"boolean","description":"Include grades from previous academic years","default":false,"title":"Allyears"},"description":"Include grades from previous academic years"},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Skip"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"subjectIDs","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Daybook filter: comma-separated subject ids (any of)","title":"Subjectids"},"description":"Daybook filter: comma-separated subject ids (any of)"},{"name":"types","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Daybook filter: comma-separated type keys (any of); __attendance, __none","title":"Types"},"description":"Daybook filter: comma-separated type keys (any of); __attendance, __none"},{"name":"facets","in":"query","required":false,"schema":{"type":"boolean","description":"With subjectIDs/types: add picker counts under `facets`","default":false,"title":"Facets"},"description":"With subjectIDs/types: add picker counts under `facets`"},{"name":"childID","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Parent accounts: which child (enrollment student id). Defaults to the active child.","title":"Childid"},"description":"Parent accounts: which child (enrollment student id). Defaults to the active child."}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Paginated"}],"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Grade"}},"total":{"type":"integer"},"skip":{"type":"integer"},"limit":{"type":"integer"},"hasMore":{"type":"boolean"}}}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Diary grades, filterable by subject, semester, type and date range. `allYears` includes previous academic years, which is off by default."}},"/v1/grades/info":{"get":{"tags":["Grades"],"summary":"Get grade metadata","operationId":"get_grade_info_v1_grades_info_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"description":"Explains the 1–12 scale and the non-numeric marks, for the app's legend."}},"/v1/grades/filters":{"get":{"tags":["Grades"],"summary":"Get available grade filters","operationId":"get_grade_filters_v1_grades_filters_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"childID","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Parent accounts: which child (enrollment student id). Defaults to the active child.","title":"Childid"},"description":"Parent accounts: which child (enrollment student id). Defaults to the active child."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"The subjects, semesters and grade types actually present in this student's diary."}},"/v1/grades/final":{"get":{"tags":["Grades"],"summary":"Get final grades","operationId":"final_grades_v1_grades_final_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"semester","in":"query","required":true,"schema":{"type":"integer","maximum":2,"minimum":1,"title":"Semester"}},{"name":"childID","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Parent accounts: which child (enrollment student id). Defaults to the active child.","title":"Childid"},"description":"Parent accounts: which child (enrollment student id). Defaults to the active child."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"End-of-semester and end-of-year marks as the platform published them."}},"/v1/grades/yearly":{"get":{"tags":["Grades"],"summary":"Get yearly grades","operationId":"yearly_grades_v1_grades_yearly_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"childID","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Parent accounts: which child (enrollment student id). Defaults to the active child.","title":"Childid"},"description":"Parent accounts: which child (enrollment student id). Defaults to the active child."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Per-subject averages and totals for the academic year."}},"/v1/homework/subjects":{"get":{"tags":["Homework"],"summary":"List homework subjects","operationId":"list_homework_subjects_v1_homework_subjects_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"childID","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Parent accounts: which child (enrollment student id). Defaults to the active child.","title":"Childid"},"description":"Parent accounts: which child (enrollment student id). Defaults to the active child."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Subjects that actually have homework, for the filter chips."}},"/v1/homework":{"get":{"tags":["Homework"],"summary":"List homework","operationId":"list_homework_v1_homework_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"subjectID","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"title":"Subjectid"}},{"name":"subject","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"title":"Subject"}},{"name":"dueDate","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Duedate"}},{"name":"dueDateFrom","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Duedatefrom"}},{"name":"dueDateTo","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Duedateto"}},{"name":"isDone","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Isdone"}},{"name":"allYears","in":"query","required":false,"schema":{"type":"boolean","description":"Include homework from previous academic years","default":false,"title":"Allyears"},"description":"Include homework from previous academic years"},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Skip"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"childID","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Parent accounts: which child (enrollment student id). Defaults to the active child.","title":"Childid"},"description":"Parent accounts: which child (enrollment student id). Defaults to the active child."}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Paginated"}],"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Homework"}},"total":{"type":"integer"},"skip":{"type":"integer"},"limit":{"type":"integer"},"hasMore":{"type":"boolean"}}}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Platform homework merged with Tvoia's own edits, reminders, done-flags and user-created items. `descriptionHtml` (additive) carries the teacher's formatting as a small XHTML subset (`p`, `br`, `b`, `i`, `u`, `s`, `ul`, `ol`, `li`, `a[href]`); it is null when the plain `description` already says it all, and for tasks the student rewrote."},"post":{"tags":["Homework"],"summary":"Create homework","operationId":"create_homework_v1_homework_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HomeworkCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Homework"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Add homework the platform never had. The result has `isCustom: true`."}},"/v1/homework/{homework_id}":{"get":{"tags":["Homework"],"summary":"Get one homework item","description":"The same shape as one element of the list, for a push or a Siri result that carries only the id. Accepts the composite id or the bare platform id older clients still send. Parents may read it and get the list's `readOnly` and `childDone` keys.","operationId":"get_homework_v1_homework__homework_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"homework_id","in":"path","required":true,"schema":{"type":"string","title":"Homework Id"}},{"name":"childID","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Parent accounts: which child (enrollment student id). Defaults to the active child.","title":"Childid"},"description":"Parent accounts: which child (enrollment student id). Defaults to the active child."}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Homework"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, or not the caller's.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Homework"],"summary":"Edit homework","operationId":"update_homework_v1_homework__homework_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"homework_id","in":"path","required":true,"schema":{"type":"string","title":"Homework Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HomeworkUpdateRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Homework"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, or not the caller's.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Override the description or due date. The platform's own text is preserved in `originalDescription`/`originalDueDate` and `isEdited` becomes true."},"delete":{"tags":["Homework"],"summary":"Delete homework","operationId":"delete_homework_v1_homework__homework_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"homework_id","in":"path","required":true,"schema":{"type":"string","title":"Homework Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"400":{"description":"Platform homework cannot be deleted — revert the edits instead.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Only user-created homework can be deleted; platform homework cannot."}},"/v1/homework/{homework_id}/edits":{"delete":{"tags":["Homework"],"summary":"Revert edits","description":"Drop the user's overrides and go back to exactly what the platform published.","operationId":"revert_homework_v1_homework__homework_id__edits_delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"homework_id","in":"path","required":true,"schema":{"type":"string","title":"Homework Id"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Homework"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/homework/{homework_id}/files":{"post":{"tags":["Homework"],"summary":"Add Homework Files","description":"Attach one or more files (multipart field `files`) to a task the user\ncreated in Tvoia. Same pipeline as message attachments: per file and per\naccount limits, metadata stripped, a public tvoia.link per file. Returns\nthe task with its `attachments`.","operationId":"add_homework_files_v1_homework__homework_id__files_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"homework_id","in":"path","required":true,"schema":{"type":"string","title":"Homework Id"}}],"requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_add_homework_files_v1_homework__homework_id__files_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/homework/{homework_id}/files/{file_id}":{"delete":{"tags":["Homework"],"summary":"Remove Homework File","description":"Detach a file from the user's own task. The stored file stays: links\nalready shared keep working.","operationId":"remove_homework_file_v1_homework__homework_id__files__file_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"homework_id","in":"path","required":true,"schema":{"type":"string","title":"Homework Id"}},{"name":"file_id","in":"path","required":true,"schema":{"type":"string","title":"File Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/homework/{homework_id}/done":{"patch":{"tags":["Homework"],"summary":"Toggle done","operationId":"toggle_done_v1_homework__homework_id__done_patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"homework_id","in":"path","required":true,"schema":{"type":"string","title":"Homework Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HomeworkDoneRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Tvoia-only; the platform has no concept of completion."}},"/v1/homework/{homework_id}/reminder":{"put":{"tags":["Homework"],"summary":"Set a reminder","operationId":"set_reminder_v1_homework__homework_id__reminder_put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"homework_id","in":"path","required":true,"schema":{"type":"string","title":"Homework Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReminderRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Schedule a local push before the due date. The scheduler sends it and marks it sent."},"delete":{"tags":["Homework"],"summary":"Clear the reminder","operationId":"clear_reminder_v1_homework__homework_id__reminder_delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"homework_id","in":"path","required":true,"schema":{"type":"string","title":"Homework Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Cancels a pending reminder. Safe to call when none is set. Does not change the due date."}},"/v1/homework/{homework_id}/share":{"post":{"tags":["Homework"],"summary":"Share homework","operationId":"share_homework_v1_homework__homework_id__share_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"homework_id","in":"path","required":true,"schema":{"type":"string","title":"Homework Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Mint a public short link to this homework so it can be sent to a classmate."}},"/v1/homework/share/{share_key}/import":{"post":{"tags":["Homework"],"summary":"Import a shared link into my homework","description":"Copies the tasks behind `tvoia.link/s/<key>` into the caller's homework as their own (custom) tasks. Skipped: tasks the caller already has (a classmate's copy of the same teacher task), tasks already imported from this link, the caller's own tasks, and empty ones. Returns `{imported, alreadyHad, total, dueDate, items: [Homework]}`; `dueDate` is the first task's Kyiv day. The share page links here through `tvoia://open/homework?due=…&import=<key>`, which older app builds open as the Homework tab on that day.","operationId":"import_share_v1_homework_share__share_key__import_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"share_key","in":"path","required":true,"schema":{"type":"string","title":"Share Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`share_not_found`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`parent_read_only`: parents cannot add tasks.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/homework/share":{"post":{"tags":["Homework"],"summary":"Share Many","description":"Several tasks behind one `tvoia.link/s/<key>` link. Order is kept;\nduplicates dropped; at most 30 tasks.","operationId":"share_many_v1_homework_share_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShareManyBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/chats/events":{"get":{"tags":["Chats"],"summary":"Realtime event stream","description":"Server-sent events for this user's chats, so the app does not have to poll.\n\nAuthenticate with the usual `Authorization: Bearer` header — a token is never accepted in the query string. Frames follow the SSE format; a `: ping` comment arrives every 15s to keep proxies from closing an idle connection, and the stream closes itself after 30 minutes so the client reconnects.\n\nEvent names: `hello`, `message.new`, `message.sent`, `message.updated`, `message.read`, `chat.read`, `chat.updated`, `stream.lagged`, and for Tvoia Web `session.created`, `session.updated`, `session.expiring`, `session.revoked`. Every payload carries a `v` field. **Ignore event names you do not recognise** — new ones are added without warning and are not a breaking change.\n\n**Best-effort, not a queue.** Anything published while you were disconnected is gone. This is a latency optimisation on top of polling, never a replacement: refetch on connect, on `stream.lagged`, and whenever the app returns to the foreground.","operationId":"chat_events_v1_chats_events_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"too_many_streams","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"realtime_disabled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/chats/{chat_id}/platform-copy":{"get":{"tags":["Chats"],"summary":"Get the «Копіювати в МШ» setting","operationId":"get_platform_copy_v1_chats__chat_id__platform_copy_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","title":"Chat Id"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformCopyState"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Whether messages in this chat are also sent through Moia Shkola.\n\n`canDisable` is computed fresh on every read, because it changes the moment a counterpart joins or leaves Tvoia. When it is false the upstream copy is mandatory and `copyToPlatform` reads true whatever is stored."},"patch":{"tags":["Chats"],"summary":"Set the «Копіювати в МШ» setting","description":"Takes an explicit `{\"enabled\": bool}` rather than toggling, because both participants can change it and they have to converge on a value.\n\nThe change is mirrored onto the other participant's copy of the conversation, so both sides always agree on where the thread lives; `syncedToCounterpart` reports how many were updated. Turning it off is refused with `409` when any counterpart has no Tvoia account, since the message would then reach nobody.","operationId":"set_platform_copy_v1_chats__chat_id__platform_copy_patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","title":"Chat Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformCopyBody"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformCopyState"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"platform_copy_required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/chats/upload-limits":{"get":{"tags":["Chats"],"summary":"Get upload limits","description":"Per-file and per-send attachment caps plus the account storage quota and usage.","operationId":"upload_limits_v1_chats_upload_limits_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/chats/unread":{"get":{"tags":["Chats"],"summary":"Count unread chats","operationId":"unread_count_v1_chats_unread_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"HTTPBearer":[]}],"description":"Cheap badge count — the number of unread incoming messages across all chats."}},"/v1/chats/messages/unread":{"get":{"tags":["Chats"],"summary":"List unread messages (Siri / Shortcuts)","description":"Unread incoming messages across every chat, newest first, up to `limit` (default 20, max 100). Each item is a `ChatMessage` plus the chat it belongs to — `chatTitle` and `chatTag` — so it can be read out or opened without a second call. `since` (ISO 8601) keeps only messages at or after that time. The page always starts at the newest message; `total` is the full unread count and `hasMore` says whether it was cut at `limit`.","operationId":"list_unread_messages_v1_chats_messages_unread_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}},{"name":"since","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Since"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Paginated"}],"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/UnreadMessage"}},"total":{"type":"integer"},"skip":{"type":"integer"},"limit":{"type":"integer"},"hasMore":{"type":"boolean"}}}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/chats":{"get":{"tags":["Chats"],"summary":"List chats","operationId":"list_chats_v1_chats_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type"}},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Skip"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":30,"title":"Limit"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Paginated"}],"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Chat"}},"total":{"type":"integer"},"skip":{"type":"integer"},"limit":{"type":"integer"},"hasMore":{"type":"boolean"}}}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Conversations newest-first, pinned ones on top, with an unread count and a last-message preview."}},"/v1/chats/{chat_id}/participants":{"get":{"tags":["Chats"],"summary":"List chat participants","operationId":"get_participants_v1_chats__chat_id__participants_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","title":"Chat Id"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ChatParticipant"}}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Chat not found, or not the caller's.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Everyone who has sent or received a message in this chat. `personID` links to `/v1/people/{person_id}`; it is null when the people index cannot resolve them, and clients should then not offer a profile link. Private participants have their class, school, role and username withheld."}},"/v1/chats/{chat_id}/messages":{"get":{"tags":["Chats"],"summary":"List messages in a chat","description":"A window of the thread, oldest-first within the page. The window is taken from the newest end: with no cursor you get the last `limit` messages; `before` (a message id) moves it back past that message, and `hasMore` says whether older history remains — open at the end, load history as the reader scrolls up. `since` (ISO 8601) returns only messages at or after that time, for catching up on an open thread. A message the user just sent appears immediately with `syncState: \"pending\"` and flips to `synced` once a scraper confirms it.","operationId":"list_messages_v1_chats__chat_id__messages_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","title":"Chat Id"}},{"name":"before","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Before"}},{"name":"since","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Since"}},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Skip"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Paginated"}],"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ChatMessage"}},"total":{"type":"integer"},"skip":{"type":"integer"},"limit":{"type":"integer"},"hasMore":{"type":"boolean"}}}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Chat not found, or not the caller's.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/chats/{chat_id}/read":{"patch":{"tags":["Chats"],"summary":"Mark a chat read","operationId":"mark_chat_read_v1_chats__chat_id__read_patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","title":"Chat Id"}},{"name":"unread","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Unread"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Chat not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Marks every incoming message in the chat read. Local to Tvoia; the platform is not told."}},"/v1/chats/{chat_id}/pin":{"patch":{"tags":["Chats"],"summary":"Pin or unpin a chat","operationId":"toggle_pin_v1_chats__chat_id__pin_patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","title":"Chat Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Chat not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Toggles; pinned chats sort first. Local to Tvoia."}},"/v1/chats/{chat_id}/mute":{"patch":{"tags":["Chats"],"summary":"Mute or unmute a chat","operationId":"toggle_mute_v1_chats__chat_id__mute_patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","title":"Chat Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Chat not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Toggles. A muted chat still syncs but sends no push. Local to Tvoia."}},"/v1/chats/recipients/types":{"get":{"tags":["Chats"],"summary":"List receiver types","operationId":"get_receiver_types_v1_chats_recipients_types_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"HTTPBearer":[]}],"description":"The audience categories this student may write to, straight from the platform's own select — «Вчителі школи», «Учні свого класу» and so on. Empty for demo accounts."}},"/v1/chats/recipients":{"get":{"tags":["Chats"],"summary":"List recipients of one type","operationId":"get_recipients_v1_chats_recipients_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"type","in":"query","required":true,"schema":{"type":"integer","title":"Type"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Recipient"}}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Scrapes the platform's recipient list for a receiver type, caches it globally, and warms the people index in the background. Slower than search — prefer `/recipients/search` for lookups."}},"/v1/chats/send":{"post":{"tags":["Chats"],"summary":"Send a message","operationId":"send_message_v1_chats_send_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_send_message_v1_chats_send_post"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendResult"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"An attachment is over 1 GiB (`code: file_too_large`), or the account would exceed its 150 GiB of kept uploads (`code: storage_quota_exceeded`; the detail carries `usedBytes` and `quotaBytes`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: at most 90 sends per 10 minutes, 15 of them with a platform copy. `Retry-After` says when.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The platform session expired or the submission failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"HTTPBearer":[]}],"description":"Queue a message for the platform. Accepts either `recipientIds` with a `receiverType`, or an existing `chatID` to reply into.\n\n**Asynchronous.** The reply is a local message with `syncState: \"pending\"`; a scraper submits the real form shortly after and the state becomes `synced` or `failed`. Render it optimistically.\n\nA `[TC…]` tag is injected into the subject so the platform's threading can be matched back to this chat.\n\n**Recipients who use Tvoia get the message immediately** — their copy is written directly rather than waiting for their next scrape — and `mirroredTo` reports how many. If the chat has «Копіювати в МШ» turned off and every recipient is on Tvoia, no upstream copy is sent at all and `syncState` comes back `synced` rather than `pending`. A recipient who cannot be resolved to a Tvoia account always forces the upstream copy, whatever the setting says.\n\n**Opening a chat Tvoia-only.** Send `copyToPlatform=false` with the first message to create the chat with «Копіювати в МШ» off; the recipient's copy starts with the same setting. Ignored on replies (the chat's stored flag wins) and forced on when any recipient is not on Tvoia. The result echoes the effective `copyToPlatform`.\n\n**Replying to one message.** Send `replyToID` (a message id from this chat). The platform copy gets the parent's text appended under its own «<<<<< Вам писав: >>>>>» line, so Moia Shkola shows exactly which message is being answered; in Tvoia the message carries `replyTo`. An id that is not in this chat is ignored, not an error."}},"/v1/chats/recipients/search":{"get":{"tags":["Chats"],"summary":"Search recipients","description":"Typo-tolerant people search across every cached recipient and Tvoia account, backed by Meilisearch (one typo allowed from 4 characters, two from 7).\n\nEach result carries **both** the legacy fields (`id`, `name`, `receiverType`, `school`, `tvoiaUser`) and the newer ones (`personID`, `role`, `className`, `avatarURL`, `isPrivate`), so old clients keep working unchanged.\n\nA purely numeric query is also treated as a raw platform id. If the index is unavailable or returns nothing, the endpoint silently falls back to the older MongoDB regex search.","operationId":"search_recipients_v1_chats_recipients_search_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"title":"Q"}},{"name":"receiverType","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Receivertype"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Recipient"}}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/chats/{chat_id}":{"get":{"tags":["Chats"],"summary":"Get one chat","description":"The same row as an item of `GET /v1/chats`, for one chat: what the app fills in when it opens a chat by id (a notification or a link).","operationId":"get_chat_v1_chats__chat_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","title":"Chat Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such chat on this account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/attendance":{"get":{"tags":["Attendance"],"summary":"List attendance records","operationId":"list_attendance_v1_attendance_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"month","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":12,"minimum":1},{"type":"null"}],"title":"Month"}},{"name":"subjectID","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subjectid"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Skip"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":100,"title":"Limit"}},{"name":"childID","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Parent accounts: which child (enrollment student id). Defaults to the active child.","title":"Childid"},"description":"Parent accounts: which child (enrollment student id). Defaults to the active child."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Derived from the diary's attendance marks («н», «зв» and friends)."}},"/v1/attendance/summary":{"get":{"tags":["Attendance"],"summary":"Get attendance summary","operationId":"attendance_summary_v1_attendance_summary_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"month","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":12,"minimum":1},{"type":"null"}],"title":"Month"}},{"name":"childID","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Parent accounts: which child (enrollment student id). Defaults to the active child.","title":"Childid"},"description":"Parent accounts: which child (enrollment student id). Defaults to the active child."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Totals and an attendance rate over the requested period."}},"/v1/leaderboard/options":{"get":{"tags":["Leaderboard"],"summary":"Get leaderboard filters","operationId":"get_leaderboard_options_v1_leaderboard_options_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"childID","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Parent accounts: which child (enrollment student id). Defaults to the active child.","title":"Childid"},"description":"Parent accounts: which child (enrollment student id). Defaults to the active child."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"The periods and subjects the leaderboard can be sliced by."}},"/v1/leaderboard":{"get":{"tags":["Leaderboard"],"summary":"Get the leaderboard","operationId":"get_leaderboard_v1_leaderboard_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"period","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Period"}},{"name":"subjectID","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Subjectid"}},{"name":"childID","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Parent accounts: which child (enrollment student id). Defaults to the active child.","title":"Childid"},"description":"Parent accounts: which child (enrollment student id). Defaults to the active child."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Class or school ranking by average. Students with privacy mode on keep their position but lose their name and avatar."}},"/v1/leaderboard/global/options":{"get":{"tags":["Leaderboard"],"summary":"Get Tvoia-wide leaderboard filters","description":"Periods, plus the schools and class years with at least `minCohort` ranked students. The viewer's own school is always listed (`isMine`).","operationId":"get_global_leaderboard_options_v1_leaderboard_global_options_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"period","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Period"}},{"name":"childID","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Parent accounts: which child (enrollment student id). Defaults to the active child.","title":"Childid"},"description":"Parent accounts: which child (enrollment student id). Defaults to the active child."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/leaderboard/global":{"get":{"tags":["Leaderboard"],"summary":"Get the Tvoia-wide leaderboard","description":"Every Tvoia student ranked by the average of their numeric grades in `period` (`week`, `month`, `semester`, `year`), optionally narrowed by `scope=school` / `schoolID` and `classYear`. Rows have the class board's shape plus `rowID`, `classYear`, `schoolID`, `isNew`; `delta` is the rank change against the board a week earlier. Names follow each student's `leaderboardVisibility` choice (opt-in, default `off`; `class` is not on this board) and `hideNameOnLeaderboard` always wins; a cohort smaller than `minCohort` returns `tooFew` and no rows.","operationId":"get_global_leaderboard_v1_leaderboard_global_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"period","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Period"}},{"name":"scope","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scope"}},{"name":"schoolID","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Schoolid"}},{"name":"classYear","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Classyear"}},{"name":"childID","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Parent accounts: which child (enrollment student id). Defaults to the active child.","title":"Childid"},"description":"Parent accounts: which child (enrollment student id). Defaults to the active child."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/leaderboard/global/schools":{"get":{"tags":["Leaderboard"],"summary":"Rank schools","description":"Schools with at least `minCohort` ranked students, by the mean of their students' averages.","operationId":"get_global_school_ranking_v1_leaderboard_global_schools_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"period","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Period"}},{"name":"childID","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Parent accounts: which child (enrollment student id). Defaults to the active child.","title":"Childid"},"description":"Parent accounts: which child (enrollment student id). Defaults to the active child."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/events/mine":{"get":{"tags":["Events"],"summary":"List the events I marked","operationId":"list_marked_v1_events_mine_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"from","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From"}},{"name":"to","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"To"}},{"name":"childID","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Parent accounts: which child (enrollment student id). Defaults to the active child.","title":"Childid"},"description":"Parent accounts: which child (enrollment student id). Defaults to the active child."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Tests, exams and other events the student marked themselves, optionally within `from`/`to` (YYYY-MM-DD). Each carries the lesson it falls on (`lessonNumber`, `startTime`), resolved from the current timetable: the lesson it was marked on, else the first lesson of its subject that day. Kinds: test, exam, quiz, project, olympiad, presentation, other. Parents get an empty list."},"post":{"tags":["Events"],"summary":"Mark an event","operationId":"create_marked_v1_events_mine_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"childID","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Parent accounts: which child (enrollment student id). Defaults to the active child.","title":"Childid"},"description":"Parent accounts: which child (enrollment student id). Defaults to the active child."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserEventBody"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"400":{"description":"A field is invalid (message says which).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`parent_read_only` (parent on the parent-aware app).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"`{kind, date, subjectID?, lessonNumber?, startTime?, title?, emoji?, note?, reminder}`. `reminder` is `evening` (18:00 Kyiv the day before, the default), `morning` (07:30 that day) or `none`; a time already past is stored as sent, so no stale push. Students only."}},"/v1/events/mine/suggest":{"get":{"tags":["Events"],"summary":"Suggest lessons for a subject","description":"The next (up to 6) lessons of `subjectID` in the coming two weeks, one per day, as `[{date, lessonNumber, startTime}]`, for the one-tap \"which lesson\" choice. Weeks with no timetable stored yet are fetched in the background for the next call.","operationId":"suggest_lessons_v1_events_mine_suggest_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"subjectID","in":"query","required":true,"schema":{"type":"string","title":"Subjectid"}},{"name":"childID","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Parent accounts: which child (enrollment student id). Defaults to the active child.","title":"Childid"},"description":"Parent accounts: which child (enrollment student id). Defaults to the active child."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/events/mine/{event_id}":{"patch":{"tags":["Events"],"summary":"Edit a marked event","operationId":"update_marked_v1_events_mine__event_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"string","title":"Event Id"}},{"name":"childID","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Parent accounts: which child (enrollment student id). Defaults to the active child.","title":"Childid"},"description":"Parent accounts: which child (enrollment student id). Defaults to the active child."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserEventBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found or not yours.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"The full form again, as for POST. A changed date or reminder restarts the reminder; other edits keep its state."},"delete":{"tags":["Events"],"summary":"Delete a marked event","operationId":"delete_marked_v1_events_mine__event_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"string","title":"Event Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found or not yours.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Also cancels its reminder."}},"/v1/events":{"get":{"tags":["Events"],"summary":"List school events","operationId":"list_events_v1_events_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"from","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From"}},{"name":"to","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"To"}},{"name":"eventType","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Eventtype"}},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Skip"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":30,"title":"Limit"}},{"name":"includeMine","in":"query","required":false,"schema":{"type":"boolean","description":"Merge in the events the student marked (eventType \"Custom\")","default":false,"title":"Includemine"},"description":"Merge in the events the student marked (eventType \"Custom\")"},{"name":"childID","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Parent accounts: which child (enrollment student id). Defaults to the active child.","title":"Childid"},"description":"Parent accounts: which child (enrollment student id). Defaults to the active child."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Calendar events from the platform. With `includeMine=1` the events the student marked themselves are merged in date order as `eventType: \"Custom\"` with a `customContent` block (the `/v1/events/mine` shape); without it the payload is exactly as before."}},"/v1/events/next":{"get":{"tags":["Events"],"summary":"Get the next event","operationId":"next_event_v1_events_next_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"includeMine","in":"query","required":false,"schema":{"type":"boolean","description":"Consider the events the student marked too","default":false,"title":"Includemine"},"description":"Consider the events the student marked too"},{"name":"childID","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Parent accounts: which child (enrollment student id). Defaults to the active child.","title":"Childid"},"description":"Parent accounts: which child (enrollment student id). Defaults to the active child."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"The soonest upcoming event, for the home screen. With `includeMine=1` a marked event can win (`eventType: \"Custom\"`, plus `customContent`)."}},"/v1/remarks":{"get":{"tags":["Remarks"],"summary":"List teacher remarks","operationId":"list_remarks_v1_remarks_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"isPositive","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Ispositive"}},{"name":"subjectID","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subjectid"}},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Skip"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"childID","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Parent accounts: which child (enrollment student id). Defaults to the active child.","title":"Childid"},"description":"Parent accounts: which child (enrollment student id). Defaults to the active child."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Remarks and commendations («Зауваження») the platform recorded."}},"/v1/notifications":{"get":{"tags":["Notifications"],"summary":"List notifications","operationId":"list_notifications_v1_notifications_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"isRead","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Isread"}},{"name":"type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type"}},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Skip"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"childID","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Parent accounts: which child (enrollment student id). Defaults to the active child.","title":"Childid"},"description":"Parent accounts: which child (enrollment student id). Defaults to the active child."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"The in-app feed of everything Tvoia has notified this user about."}},"/v1/notifications/{notification_id}/read":{"patch":{"tags":["Notifications"],"summary":"Mark a notification read","operationId":"mark_read_v1_notifications__notification_id__read_patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"notification_id","in":"path","required":true,"schema":{"type":"string","title":"Notification Id"}},{"name":"childID","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Parent accounts: which child (enrollment student id). Defaults to the active child.","title":"Childid"},"description":"Parent accounts: which child (enrollment student id). Defaults to the active child."}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Clears this entry from the unread feed. Idempotent, and returns `204` with no body."}},"/v1/activity":{"get":{"tags":["Activity"],"summary":"List the activity feed","operationId":"list_activity_v1_activity_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"group","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"grades | homework | attendance | remarks | lessons | news","title":"Group"},"description":"grades | homework | attendance | remarks | lessons | news"},{"name":"before","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"`nextCursor` of the previous page","title":"Before"},"description":"`nextCursor` of the previous page"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":30,"title":"Limit"}},{"name":"appVersion","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Appversion"}},{"name":"childID","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Parent accounts: which child (enrollment student id). Defaults to the active child.","title":"Childid"},"description":"Parent accounts: which child (enrollment student id). Defaults to the active child."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Tvoia's own list of what happened: grades (new, changed), attendance, homework (new and edited, with the previous text and due date), remarks, surveys, parent meetings, the account's earlier history copied from the platform's news, and Tvoia news (announcements, Tvoia Wrapped). Newest first; page with `before=<nextCursor>`. `group` filters on the server and `groups` lists the choices with their counts. Reading has no side effects: `isNew` and `unreadCount` follow the watermark that only `POST /v1/activity/seen` moves. Each item's `target` has the keys of a push payload. Accepts `childID` for parent accounts."}},"/v1/activity/seen":{"post":{"tags":["Activity"],"summary":"Mark the activity feed read","description":"Moves the read watermark to `until` (default and at most: now). It only moves forward. Returns the new `unreadCount`.","operationId":"mark_seen_v1_activity_seen_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"appVersion","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Appversion"}},{"name":"childID","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Parent accounts: which child (enrollment student id). Defaults to the active child.","title":"Childid"},"description":"Parent accounts: which child (enrollment student id). Defaults to the active child."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeenIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/search":{"get":{"tags":["Search"],"summary":"Search everything","operationId":"search_v1_search_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":200,"title":"Q"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":20,"minimum":1,"default":5,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"One query across the student's homework, grades, chats and events."}},"/v1/weather":{"get":{"tags":["Weather"],"summary":"Get local weather","operationId":"get_weather_v1_weather_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"description":"Weather for the school's city, shown on the home screen."}},"/v1/push/apns/device":{"post":{"tags":["Push"],"summary":"Register a device token","operationId":"register_device_token_v1_push_apns_device_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceTokenRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"HTTPBearer":[]}],"description":"App token only (a Tvoia Web token gets 403 `web_token_not_allowed`). Idempotent upsert. A user may have several devices; each gets its own record. `platform` (optional, default `ios`): send `android` with an FCM registration token."}},"/v1/push/apns/activity/start":{"post":{"tags":["Push"],"summary":"Register a Live Activity push-to-start token","operationId":"register_push_to_start_token_v1_push_apns_activity_start_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"HTTPBearer":[]}],"description":"Attached to exactly one device — registering it again moves it rather than duplicating, which used to double every lesson push."}},"/v1/push/apns/activity/update":{"post":{"tags":["Push"],"summary":"Register a per-activity update token","operationId":"register_per_activity_token_v1_push_apns_activity_update_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"HTTPBearer":[]}],"description":"Scoped to one running Live Activity, used to update it in place."}},"/v1/push/apns/activity":{"post":{"tags":["Push"],"summary":"Register an activity token (legacy)","operationId":"register_activity_token_compat_v1_push_apns_activity_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"HTTPBearer":[]}],"description":"**Deprecated.** Kept for old clients; use `/apns/activity/start` or `/apns/activity/update`."}},"/v1/push/preferences":{"get":{"tags":["Push"],"summary":"Get notification preferences","operationId":"get_preferences_v1_push_preferences_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"HTTPBearer":[]}],"description":"Per-event switches: new grade, homework, message, remark, survey, Live Activity and more, plus the alert rules `low_grade_alert`/`low_grade_threshold`, `unexcused_absence_alert`, `parent_meeting_alert`, `homework_due_alert`, `weekly_digest` with their send times `homework_due_time` / `weekly_digest_time` (see *Parent mode*)."},"put":{"tags":["Push"],"summary":"Update notification preferences","operationId":"update_preferences_v1_push_preferences_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationPreferences"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"HTTPBearer":[]}],"description":"Partial update — only the switches you send are changed."}},"/v1/push/locale":{"get":{"tags":["Push"],"summary":"Get the push locale","operationId":"get_locale_v1_push_locale_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"HTTPBearer":[]}],"description":"Which of `uk`/`en`/`lt` push payloads are written in."},"put":{"tags":["Push"],"summary":"Set the push locale","operationId":"set_locale_v1_push_locale_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LocaleRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"HTTPBearer":[]}],"description":"Chooses the language APNs payloads are written in — `uk`, `en` or `lt`. Independent of the device's own language, since the server renders the notification text."}},"/v1/status":{"get":{"tags":["Status"],"summary":"App status and update check","operationId":"get_status_v1_status_get","parameters":[{"name":"version","in":"query","required":false,"schema":{"type":"string","default":"1.0","title":"Version"}},{"name":"build","in":"query","required":false,"schema":{"type":"string","default":"1","title":"Build"}},{"name":"platform","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Platform"}},{"name":"x-tvoia-client","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tvoia-Client"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}}},"description":"Called on launch with the app's `version` and `build`. `state` is `free`, `unsynced`, `maintenance` or `outdated`; `update` says whether a newer store version exists and whether it is required. The platform comes from `?platform=` or the `X-Tvoia-Client` header (`android/1.0.0`), default `ios`: each platform has its own release block, and a status record applies to one platform or to every app."}},"/v1/status/release":{"get":{"tags":["Status"],"summary":"Get the app-release block","operationId":"get_release_v1_status_release_get","parameters":[{"name":"platform","in":"query","required":false,"schema":{"type":"string","default":"ios","title":"Platform"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}}},"description":"What the client checks on launch. Carries the current version, the minimum supported one, and whether an update prompt should be shown — the app passes its own `version` and `build` as query parameters. One block per platform: `?platform=ios` (default) or `?platform=android`."}},"/v1/status/changelog":{"get":{"tags":["Status"],"summary":"Get Tvoia's release notes","description":"Tvoia's own \"What's new\": every published version, newest first, as `{versions: [{version, date, notes, language}]}`. `lang` picks uk, en or lt; a version without that translation comes back in Ukrainian, and `language` says which one was used. `notes` is plain text where lines starting with \"- \" are bullet points. Public, no sign-in needed.","operationId":"get_changelog_v1_status_changelog_get","parameters":[{"name":"lang","in":"query","required":false,"schema":{"type":"string","default":"uk","title":"Lang"}},{"name":"platform","in":"query","required":false,"schema":{"type":"string","default":"ios","title":"Platform"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}}}}},"/v1/files/resolve/{short_key}":{"get":{"tags":["Files"],"summary":"Resolve a file short key","operationId":"resolve_file_v1_files_resolve__short_key__get","parameters":[{"name":"short_key","in":"path","required":true,"schema":{"type":"string","title":"Short Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"404":{"description":"Unknown key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"**Unauthenticated.** Trades an unguessable short key for a short-lived signed download URL, so attachment links work outside the app. A message sent with more than 3 attachments carries one link for all of them on the platform: its key resolves with `bundle: true` and `files: [{shortKey, url, name, size}]` (additive), which tvoia.link shows as a list. Inside Tvoia the attachments stay individual files."}},"/v1/files/share/{short_key}":{"get":{"tags":["Files"],"summary":"Resolve a share link","operationId":"resolve_share_v1_files_share__short_key__get","parameters":[{"name":"short_key","in":"path","required":true,"schema":{"type":"string","title":"Short Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"404":{"description":"Unknown or revoked share key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"**Unauthenticated.** Resolves a homework share link created by `POST /v1/homework/{id}/share`."}},"/v1/files/wrapped/{short_key}":{"get":{"tags":["Files"],"summary":"Resolve a Wrapped link","description":"**Unauthenticated.** What the tvoia.link worker needs to serve `tvoia.link/w/<key>`: `{\"season\", \"scope\", \"lang\", \"rev\", \"status\", \"images\": [{\"slide\", \"name\", \"width\", \"height\", \"ready\"}], \"og\": {\"name\", \"width\", \"height\", \"ready\"}, \"theme\", \"expiresAt\"}`. It carries no names, numbers or copy; the posters are the content, served at `tvoia.link/w/<key>/<rev>/<name>.jpg`.","operationId":"resolve_wrapped_share_v1_files_wrapped__short_key__get","parameters":[{"name":"short_key","in":"path","required":true,"schema":{"type":"string","title":"Short Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"404":{"description":"Unknown, unshared or expired; sharing switched off; or the posters still carry a name and the sharer has since turned privacy mode on.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/files/note/{short_key}":{"get":{"tags":["Files"],"summary":"Resolve Note Share","description":"The data behind a shared note's page (tvoia.link/n/<key>). The body is\nalready sanitized HTML frozen when the note was shared; the sharer's name\nand photo follow their current privacy mode, resolved here like a homework\nshare.","operationId":"resolve_note_share_v1_files_note__short_key__get","parameters":[{"name":"short_key","in":"path","required":true,"schema":{"type":"string","title":"Short Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}}}}},"/v1/library/catalog":{"get":{"tags":["Library"],"summary":"Search the book catalogue","operationId":"search_catalog_v1_library_catalog_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Q"}},{"name":"category","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"}},{"name":"grade","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Grade"}},{"name":"subject_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject Id"}},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Skip"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Meilisearch over the whole catalogue, filterable by grade, subject and category."}},"/v1/library/books":{"get":{"tags":["Library"],"summary":"List my books","operationId":"list_user_books_v1_library_books_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"HTTPBearer":[]}],"description":"The student's shelf, with reading progress."},"post":{"tags":["Library"],"summary":"Add a book to my shelf","operationId":"add_book_v1_library_books_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddBookRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"HTTPBearer":[]}],"description":"Idempotent — adding a book already on the shelf is a no-op."}},"/v1/library/books/{book_id}":{"delete":{"tags":["Library"],"summary":"Remove a book from my shelf","operationId":"remove_book_v1_library_books__book_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"book_id","in":"path","required":true,"schema":{"type":"string","title":"Book Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not on the shelf.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Drops progress and bookmarks with it."}},"/v1/library/books/{book_id}/progress":{"patch":{"tags":["Library"],"summary":"Update reading progress","operationId":"update_progress_v1_library_books__book_id__progress_patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"book_id","in":"path","required":true,"schema":{"type":"string","title":"Book Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProgressRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Stores the current page/locator so reading resumes across devices."}},"/v1/library/books/{book_id}/bookmarks":{"post":{"tags":["Library"],"summary":"Add a bookmark","operationId":"add_bookmark_v1_library_books__book_id__bookmarks_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"book_id","in":"path","required":true,"schema":{"type":"string","title":"Book Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BookmarkRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Saves a page or EPUB locator with an optional title. Bookmarks are per user, not per device, so they follow the reader across installs."}},"/v1/library/books/{book_id}/bookmarks/{bookmark_id}":{"delete":{"tags":["Library"],"summary":"Remove a bookmark","operationId":"remove_bookmark_v1_library_books__book_id__bookmarks__bookmark_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"book_id","in":"path","required":true,"schema":{"type":"string","title":"Book Id"}},{"name":"bookmark_id","in":"path","required":true,"schema":{"type":"string","title":"Bookmark Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Bookmark not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Deletes one bookmark. Reading progress is stored separately and is untouched."}},"/v1/library/books/{book_id}/subjects":{"patch":{"tags":["Library"],"summary":"Assign a book to subjects","operationId":"update_subjects_v1_library_books__book_id__subjects_patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"book_id","in":"path","required":true,"schema":{"type":"string","title":"Book Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubjectLinksRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Files a book under one or more school subjects on the shelf."}},"/v1/library/books/{book_id}/download":{"get":{"tags":["Library"],"summary":"Get a download URL","operationId":"download_book_v1_library_books__book_id__download_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"book_id","in":"path","required":true,"schema":{"type":"string","title":"Book Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Book not found, or that format is not stored.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"A short-lived signed S3 URL for the PDF or EPUB."}},"/v1/library/suggestions":{"get":{"tags":["Library"],"summary":"Get book suggestions","operationId":"get_suggestions_v1_library_suggestions_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"current_subject_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Subject Id"}},{"name":"today_subject_ids","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Today Subject Ids"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Catalogue picks for this student's grade and subjects."}},"/v1/library/books/by-subject/{subject_id}":{"get":{"tags":["Library"],"summary":"List my books for a subject","operationId":"books_by_subject_v1_library_books_by_subject__subject_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"subject_id","in":"path","required":true,"schema":{"type":"string","title":"Subject Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"The shelf filtered to one school subject, using the assignments made by `PATCH /v1/library/books/{book_id}/subjects`."}},"/v1/surveys":{"get":{"tags":["Surveys"],"summary":"List surveys","operationId":"list_surveys_v1_surveys_get","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SurveyList"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"HTTPBearer":[]}],"description":"Every survey visible to this user, open ones first. **Returns an empty list while the feature gate is closed** — see *Feature gates* in the overview."}},"/v1/surveys/refresh":{"post":{"tags":["Surveys"],"summary":"Refresh surveys now","description":"Pull the platform's survey list immediately (pull-to-refresh). Falls back to the cached list when the platform is unreachable, so this rarely fails.","operationId":"refresh_surveys_v1_surveys_refresh_post","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SurveyList"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/surveys/{survey_id}":{"get":{"tags":["Surveys"],"summary":"Get a survey with its questions","operationId":"get_survey_v1_surveys__survey_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"survey_id","in":"path","required":true,"schema":{"type":"string","title":"Survey Id"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Survey"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such survey for this user, or the feature gate is closed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Returns the survey including `questions`. If the form was never captured, or was captured without recognisable questions, this captures it from the platform on demand — so the first call on a survey can be slow."}},"/v1/surveys/{survey_id}/answers":{"post":{"tags":["Surveys"],"summary":"Answer a survey","operationId":"submit_answers_v1_surveys__survey_id__answers_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"survey_id","in":"path","required":true,"schema":{"type":"string","title":"Survey Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SurveyAnswersRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Survey"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"400":{"description":"A required question is unanswered, or a question id is unknown.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`already_answered`, `survey_closed`, or `form_not_captured`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"`platform_session_expired`, or the platform rejected the submission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such survey for this user, or the feature gate is closed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Validates the answers against the captured form, then replays them to the platform as a form POST. Required questions must be answered; a `single` question keeps only the first option; unknown question ids are rejected.\n\nOn success the survey is marked answered and a background refresh confirms it against the platform's own status column."}},"/v1/people/resolve":{"get":{"tags":["People"],"summary":"Resolve Person","description":"Find the person behind a teacher name from the schedule, a grade or a\nremark, so the app can open their profile or start a chat from there.\nUses the viewer's own messaging module (parents: the child's teachers,\ntype 11; students: school teachers, type 2) and prefers the viewer's\nschool. 404 when nobody matches unambiguously.","operationId":"resolve_person_v1_people_resolve_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"name","in":"query","required":true,"schema":{"type":"string","minLength":2,"maxLength":120,"description":"Platform name as shown in the schedule / grade / remark (\"Прізвище Ім'я По батькові\")","title":"Name"},"description":"Platform name as shown in the schedule / grade / remark (\"Прізвище Ім'я По батькові\")"},{"name":"role","in":"query","required":false,"schema":{"type":"string","description":"teacher | admin","default":"teacher","title":"Role"},"description":"teacher | admin"},{"name":"childID","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Parent accounts: which child (enrollment student id). Defaults to the active child.","title":"Childid"},"description":"Parent accounts: which child (enrollment student id). Defaults to the active child."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/people/{person_id}":{"get":{"tags":["People"],"summary":"Get a person's public profile","operationId":"get_person_v1_people__person_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"person_id","in":"path","required":true,"schema":{"type":"string","title":"Person Id"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Person"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such person in the index or the recipient cache.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Look up anyone reachable through the platform by their person id (`p<platformID>_<receiverType>`, e.g. `p277838_9`). Ids come from chat participants and recipient search.\n\nServed from the Meilisearch people index, falling back to MongoDB while the index is cold or unavailable.\n\n**If this person has privacy mode on and is not you, the response carries only `id`, `name`, `avatarURL`, `isPrivate`, `isCurrentUser` and `isTvoiaUser`.**"}},"/v1/announcements":{"get":{"tags":["Announcements"],"summary":"List Announcements","operationId":"list_announcements_v1_announcements_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"lang","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"uk | en | lt (defaults to uk)","title":"Lang"},"description":"uk | en | lt (defaults to uk)"},{"name":"appVersion","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Appversion"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/ads":{"get":{"tags":["Advertisements"],"summary":"List advertisements","operationId":"list_ads_v1_ads_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"lang","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"uk | en | lt (defaults to uk)","title":"Lang"},"description":"uk | en | lt (defaults to uk)"},{"name":"appVersion","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Appversion"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Live, targeted home-screen ads for this user in their language; dismissed ones are omitted. A survey ad carries the viewer's own survey copy and the advertised answer to preselect."}},"/v1/ads/{key}/events":{"post":{"tags":["Advertisements"],"summary":"Record an ad event","operationId":"record_event_v1_ads__key__events_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdEventIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"impression (deduplicated per 12 h), click, or dismiss (hides the ad for this user on every device)."}},"/v1/miytracker/changelog":{"get":{"tags":["MiyTracker"],"summary":"Public Changelog","description":"Published releases, one language, no excerpts. The only MiyTracker route\nwithout the admin key and the only API response a shared cache may keep.","operationId":"public_changelog_v1_miytracker_changelog_get","parameters":[{"name":"lang","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"uk | en | lt (defaults to uk)","title":"Lang"},"description":"uk | en | lt (defaults to uk)"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}}}}},"/v1/web/pair":{"post":{"tags":["Web"],"summary":"Start a browser pairing","operationId":"create_pairing_v1_web_pair_post","requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/PairCreateBody"},{"type":"null"}],"title":"Body"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"503":{"description":"`web_pairing_disabled`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; `Retry-After` says when.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"No auth. Body `{\"clientHint\": {\"browser\", \"os\"}}` (optional, from `navigator.userAgentData`). Returns the six-character `code` (`codeDisplay` is `XXX-XXX`), the browser's private `pollSecret`, the `qrUrl` to render as the QR (`https://web.tvoia.app/p/<code>#s=<approveSecret>` — the secret rides in the fragment, so no server ever sees it) and `expiresAt` (five minutes). **Rate limited** per IP."}},"/v1/web/pair/{pairing_id}/poll":{"post":{"tags":["Web"],"summary":"Wait for the phone","description":"No auth. Body `{\"pollSecret\", \"wait\": 0-10}`. Long-poll: answers as soon as the status changes or after `wait` seconds. `status` is `pending`, `claimed` (the phone is looking at the confirm sheet; `claimedVia` is `qr` or `code`), `approved` (call `/token`), `denied`, `expired` or `consumed`. Carries no user data.","operationId":"poll_pairing_v1_web_pair__pairing_id__poll_post","parameters":[{"name":"pairing_id","in":"path","required":true,"schema":{"type":"string","title":"Pairing Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PollBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"404":{"description":"`pairing_not_found` — wrong id or wrong secret, deliberately indistinguishable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/web/pair/{pairing_id}/token":{"post":{"tags":["Web"],"summary":"Exchange the pairing for a web token","description":"No auth. Body `{\"pollSecret\"}`. Single use: the pairing becomes `consumed`. Returns `token`, `tokenExpiresAt`, the `session` and the `Me` profile.","operationId":"exchange_token_v1_web_pair__pairing_id__token_post","parameters":[{"name":"pairing_id","in":"path","required":true,"schema":{"type":"string","title":"Pairing Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"404":{"description":"`pairing_not_found`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`pairing_not_approved` / `pairing_already_used`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"410":{"description":"`pairing_expired`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`pairing_denied`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/web/pair/claim":{"post":{"tags":["Web"],"summary":"Claim a code (phone)","description":"App token only. Body `{\"code\", \"secret\"?, \"childID\"?}` — `secret` is the QR's `approveSecret` and means the phone scanned the real screen; a typed code carries none. Returns a preview of the browser (browser, OS, IP, location, when) and `expiryOptions`, the same payload as `/pair/expiry-preview`, so the confirm sheet needs no second call. Idempotent for the same account. **Rate limited** per user, IP and code.","operationId":"claim_pairing_v1_web_pair_claim_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`pairing_not_found` — unknown or mistyped code, or a wrong QR secret.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`pairing_claimed` — another account is already looking at this code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"410":{"description":"`pairing_expired`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`web_token_not_allowed`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/web/pair/expiry-preview":{"get":{"tags":["Web"],"summary":"Duration options (phone)","description":"App token only. Every `expiryMode` (`40m`, `1h`, `6h`, `lesson_end`, `never`, `custom`) with the exact `expiresAt` it resolves to right now. `lesson_end` follows today's schedule like `/schedule/current-lesson` (`resolvedFrom`: `current_lesson`, `next_lesson`, or `fallback` = one hour when there are no more lessons). Parents: `?childID=`.","operationId":"expiry_preview_v1_web_pair_expiry_preview_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"childID","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Parent accounts: which child (enrollment student id). Defaults to the active child.","title":"Childid"},"description":"Parent accounts: which child (enrollment student id). Defaults to the active child."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/web/pair/{pairing_id}/approve":{"post":{"tags":["Web"],"summary":"Approve a pairing (phone)","operationId":"approve_pairing_v1_web_pair__pairing_id__approve_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"pairing_id","in":"path","required":true,"schema":{"type":"string","title":"Pairing Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApproveBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`pairing_forbidden` — claimed by another account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`pairing_not_claimed`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"410":{"description":"`pairing_expired`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"400":{"description":"`invalid_expiry_mode`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"App token only. Body `{\"expiryMode\", \"customMinutes\"?, \"label\"?, \"childID\"?}`. Creates the web session, pushes `web_login` to the account's devices (preference `web_login_alert`) and publishes `session.created`. The browser's next poll sees `approved`."}},"/v1/web/pair/{pairing_id}/deny":{"post":{"tags":["Web"],"summary":"Deny a pairing (phone)","operationId":"deny_pairing_v1_web_pair__pairing_id__deny_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"pairing_id","in":"path","required":true,"schema":{"type":"string","title":"Pairing Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"App token only. The browser sees `denied`."}},"/v1/web/bootstrap":{"get":{"tags":["Web"],"summary":"Workspace bootstrap","description":"One call for the workspace's first paint: `me` (the `Me` profile), `today` (as `/students/me/today`), `unreadChats`, the caller's own `session` (null for an app token), the saved `layout` and `serverTime`.","operationId":"bootstrap_v1_web_bootstrap_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"lang","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lang"}},{"name":"childID","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Parent accounts: which child (enrollment student id). Defaults to the active child.","title":"Childid"},"description":"Parent accounts: which child (enrollment student id). Defaults to the active child."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/web/layout":{"get":{"tags":["Web"],"summary":"Saved workspace layout","operationId":"get_layout_v1_web_layout_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"HTTPBearer":[]}],"description":"`{\"version\", \"layout\", \"updatedAt\"}`; `version` 0 and an empty object when nothing was saved. The layout is opaque to the server."},"put":{"tags":["Web"],"summary":"Save the workspace layout","description":"Body `{\"ifVersion\"?, \"layout\"}`. With `ifVersion` a stale write from another tab gets 409 `layout_conflict` carrying the current document. At most 32 KB.","operationId":"put_layout_v1_web_layout_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LayoutBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`layout_conflict`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"`layout_too_large`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/clip":{"get":{"tags":["Clipboard"],"summary":"The clipboard","operationId":"list_items_v1_clip_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"since","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Only items changed after this instant, tombstones included","title":"Since"},"description":"Only items changed after this instant, tombstones included"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Every live item, newest first: `{\"data\": [Item], \"count\", \"maxItems\", \"retentionDays\", \"maxTextChars\", \"serverTime\"}`. With `?since=<iso>` only what changed after that instant: `{\"data\": [changed live items], \"deletedIds\": [...], \"serverTime\"}`, for a client reconciling after a reconnect. An Item is `{id, kind: text|link|file, text, title, file: {name, sizeBytes, fileType, mime, url} | null, source: {client, device, sid}, pinned, createdAt, updatedAt, expiresAt, deletedAt}`."},"delete":{"tags":["Clipboard"],"summary":"Clear the clipboard","operationId":"clear_items_v1_clip_delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"all","in":"query","required":false,"schema":{"type":"boolean","description":"Also remove pinned items","default":false,"title":"All"},"description":"Also remove pinned items"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Removes every unpinned item; `?all=true` removes pinned ones too. Returns `{\"removed\": n}`."}},"/v1/clip/text":{"post":{"tags":["Clipboard"],"summary":"Add text or a link","operationId":"add_text_v1_clip_text_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TextBody"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"400":{"description":"`clip_empty`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`clip_full`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"HTTPBearer":[]}],"description":"Body `{\"text\", \"device\"?, \"pinned\"?}`. A snippet that is exactly one URL becomes a `link` item with the host as `title`. `device` labels where it came from (\"iPhone 15\"); a web session leaves it out and gets its browser summary. Returns the Item (201)."}},"/v1/clip/file":{"post":{"tags":["Clipboard"],"summary":"Add a file","operationId":"add_file_v1_clip_file_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_add_file_v1_clip_file_post"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"400":{"description":"`clip_empty`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`clip_full`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"`file_too_large` / `storage_quota_exceeded`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"HTTPBearer":[]}],"description":"Multipart: `file` (one), `device`?, `pinned`?. Same size and quota rules as `/chats/send`; metadata is scrubbed. Returns the Item (201) with `file.url` on tvoia.link. A file dropped in from a browser also pushes `clip_file` to the phone (preference `clip_alert`)."}},"/v1/clip/{item_id}":{"patch":{"tags":["Clipboard"],"summary":"Edit or pin an item","operationId":"patch_item_v1_clip__item_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"item_id","in":"path","required":true,"schema":{"type":"string","title":"Item Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/api__routes__clipboard__PatchBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"400":{"description":"`clip_empty` / `clip_not_text`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`clip_not_found`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Body `{\"text\"?, \"pinned\"?}`. Editing re-detects text vs link. Pinning clears the expiry; unpinning starts a fresh retention window. Returns the Item."},"delete":{"tags":["Clipboard"],"summary":"Remove an item","operationId":"delete_item_v1_clip__item_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"item_id","in":"path","required":true,"schema":{"type":"string","title":"Item Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`clip_not_found`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"204. The stored file (if any) is deleted from storage right away; other devices get `clip.removed`."}},"/v1/notes":{"get":{"tags":["Notes"],"summary":"List notes","operationId":"list_notes_v1_notes_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"since","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Only what changed after this serverTime","title":"Since"},"description":"Only what changed after this serverTime"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Metadata of every live and trashed note (no bodies) plus folders: `{\"data\": [Meta], \"folders\": [Folder], \"deletedIds\", \"deletedFolderIds\", \"serverTime\", \"limits\"}`. With `?since=<serverTime>` only what changed; `deletedIds` are notes purged for good. A `since` older than the tombstone window answers `{\"resync\": true}`. The first call copies the account's clipboard into notes."},"post":{"tags":["Notes"],"summary":"Create a note","operationId":"create_note_v1_notes_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/api__routes__notes__CreateBody"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"400":{"description":"`bad_kind` / `bad_block*`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`notes_full`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"`note_too_large`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Body `{\"id\"?, \"kind\": page|board, \"title\"?, \"folderId\"?, \"pinned\"?, \"blocks\"?, \"board\"?, \"fromText\"?, \"capture\"?, \"device\"?}`. A client generated `id` makes retries safe (an existing id answers with the stored note). `fromText` is parsed into blocks; with several lines the first becomes the title. `capture` from a web session also writes the text as a clip for builds without Notes."}},"/v1/notes/bodies":{"post":{"tags":["Notes"],"summary":"Load full notes","description":"Body `{\"ids\": [...]}` (at most 50). Returns `{\"data\": [Note]}` with `blocks` and `board`.","operationId":"bodies_v1_notes_bodies_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BodiesBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/notes/search":{"get":{"tags":["Notes"],"summary":"Search notes","operationId":"search_v1_notes_search_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":200,"title":"Q"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"`?q=` matches title and text, case-insensitive substring. Returns `{\"data\": [Meta]}` (live notes only)."}},"/v1/notes/folders":{"get":{"tags":["Notes"],"summary":"List folders","operationId":"list_folders_v1_notes_folders_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"HTTPBearer":[]}],"description":"`{\"data\": [Folder]}`; a Folder is `{id, name, icon, pos, system, createdAt, updatedAt, deletedAt}`."},"post":{"tags":["Notes"],"summary":"Create a folder","operationId":"create_folder_v1_notes_folders_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FolderBody"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`folders_full`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"HTTPBearer":[]}],"description":"Body `{\"id\"?, \"name\", \"icon\"?, \"pos\"?}`."}},"/v1/notes/folders/{fid}":{"patch":{"tags":["Notes"],"summary":"Rename or reorder a folder","operationId":"patch_folder_v1_notes_folders__fid__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"fid","in":"path","required":true,"schema":{"type":"string","title":"Fid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FolderPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`folder_not_found`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Body `{\"name\"?, \"icon\"?, \"pos\"?}`."},"delete":{"tags":["Notes"],"summary":"Delete a folder","operationId":"delete_folder_v1_notes_folders__fid__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"fid","in":"path","required":true,"schema":{"type":"string","title":"Fid"}},{"name":"trashNotes","in":"query","required":false,"schema":{"type":"boolean","description":"Move its notes to the trash instead of out of the folder","default":false,"title":"Trashnotes"},"description":"Move its notes to the trash instead of out of the folder"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`folder_not_found`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Its notes move out of the folder, or to the trash with `?trashNotes=true`. Returns `{\"moved\": n}`."}},"/v1/notes/files/{file_id}":{"get":{"tags":["Notes"],"summary":"Download a note file","description":"The bytes, to the owner only. Supports `Range`.","operationId":"get_file_v1_notes_files__file_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"file_id","in":"path","required":true,"schema":{"type":"string","title":"File Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`file_not_found`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/notes/trash":{"delete":{"tags":["Notes"],"summary":"Empty the trash","operationId":"empty_trash_v1_notes_trash_delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"HTTPBearer":[]}],"description":"Deletes every trashed note and its files. Returns `{\"removed\": n}`."}},"/v1/notes/{nid}":{"get":{"tags":["Notes"],"summary":"A full note","operationId":"get_note_v1_notes__nid__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"nid","in":"path","required":true,"schema":{"type":"string","title":"Nid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`note_not_found`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"The note with `blocks` and `board`."},"delete":{"tags":["Notes"],"summary":"Trash or delete a note","operationId":"delete_note_v1_notes__nid__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"nid","in":"path","required":true,"schema":{"type":"string","title":"Nid"}},{"name":"purge","in":"query","required":false,"schema":{"type":"boolean","description":"Delete for good instead of moving to the trash","default":false,"title":"Purge"},"description":"Delete for good instead of moving to the trash"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`note_not_found`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Moves the note to the trash (purged after 30 days). `?purge=true` deletes it and its files for good."}},"/v1/notes/{nid}/ops":{"post":{"tags":["Notes"],"summary":"Apply an op batch","operationId":"apply_ops_v1_notes__nid__ops_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"nid","in":"path","required":true,"schema":{"type":"string","title":"Nid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpsBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"400":{"description":"`bad_*` / `unknown_op`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`note_not_found`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`note_busy` (retry).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"`note_too_large` / `note_too_many_blocks` / `note_too_many_elements`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Body `{\"batchId\", \"baseVersion\", \"ops\": [...]}` (see docs/notes-format.md). Returns `{\"version\", \"rejected\": [ids that lost], \"duplicate\"}` and, when `baseVersion` was behind or something was rejected, the merged `note` to rebase on. Other devices get `note.changed`."}},"/v1/notes/{nid}/restore":{"post":{"tags":["Notes"],"summary":"Restore from the trash","operationId":"restore_note_v1_notes__nid__restore_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"nid","in":"path","required":true,"schema":{"type":"string","title":"Nid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`note_not_found`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Returns the note's metadata."}},"/v1/notes/{nid}/duplicate":{"post":{"tags":["Notes"],"summary":"Duplicate a note","operationId":"duplicate_note_v1_notes__nid__duplicate_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"nid","in":"path","required":true,"schema":{"type":"string","title":"Nid"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/DuplicateBody"},{"type":"null"}],"title":"Body"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`note_not_found`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`notes_full`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Body `{\"id\"?, \"title\"?}`. Files are shared with the copy."}},"/v1/notes/{nid}/export":{"get":{"tags":["Notes"],"summary":"Export a note","operationId":"export_note_v1_notes__nid__export_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"nid","in":"path","required":true,"schema":{"type":"string","title":"Nid"}},{"name":"format","in":"query","required":false,"schema":{"type":"string","pattern":"^(md|excalidraw)$","default":"md","title":"Format"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`note_not_found`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"`?format=md` (markdown) or `?format=excalidraw` (the board as an .excalidraw file)."}},"/v1/notes/{nid}/share":{"post":{"tags":["Notes"],"summary":"Share a note by link","description":"Creates or refreshes the note's public page at `tvoia.link/n/<key>` and returns `{\"url\", \"key\"}`. The page is a frozen, read-only snapshot of the note as HTML (its images get public links too); sharing again overwrites it with the current note. Trashing or deleting the note revokes the link.","operationId":"share_note_v1_notes__nid__share_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"nid","in":"path","required":true,"schema":{"type":"string","title":"Nid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`note_not_found` (also for a trashed note).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["Notes"],"summary":"Share state","description":"`{\"shared\": bool, \"url\"?, \"key\"?}` — whether the note has a public link right now.","operationId":"share_status_v1_notes__nid__share_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"nid","in":"path","required":true,"schema":{"type":"string","title":"Nid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`note_not_found`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Notes"],"summary":"Stop sharing","description":"Revokes the public link and the file links it minted. Returns `{\"unshared\": bool}`; not an error if it was never shared.","operationId":"unshare_note_v1_notes__nid__share_delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"nid","in":"path","required":true,"schema":{"type":"string","title":"Nid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/notes/{nid}/files":{"post":{"tags":["Notes"],"summary":"Upload a file into a note","description":"Multipart `file`, optional `w`, `h` (image size) and `capture`. Returns `{id, name, mime, size, w, h}`; the client then references `id` from a block or a board element. Same size and quota rules as chat attachments. `capture` from a web session also writes the file as a clip and pushes `clip_file` (with `noteId`) to the phone.","operationId":"upload_file_v1_notes__nid__files_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"nid","in":"path","required":true,"schema":{"type":"string","title":"Nid"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_file_v1_notes__nid__files_post"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`note_not_found`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"`file_too_large` / `storage_quota_exceeded`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/calendar/feeds":{"get":{"tags":["Calendar"],"summary":"List calendar subscriptions","operationId":"list_feeds_v1_calendar_feeds_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"HTTPBearer":[]}],"description":"Returns `{\"feeds\": [Feed]}`, at most one per child for parents and one for students. Feed: `{id, childID, childName, url, webcalURL, webcalsURL, googleURL, options, createdAt, lastFetchedAt, lastClient, fetchCount}`; `lastClient` is `ios`, `macos`, `google`, `outlook` or `other` (the last calendar app that fetched it)."},"post":{"tags":["Calendar"],"summary":"Create a calendar subscription","operationId":"create_feed_v1_calendar_feeds_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/api__routes__calendar__CreateBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"400":{"description":"`unknown_child`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"HTTPBearer":[]}],"description":"Body `{\"childID\"?, \"options\"?}`. Returns the existing active feed for that child (applying `options` if sent) or creates one. Options (all optional): `lessons`, `lessonStyle` (`each` | `day`), `lessonNumbers`, `subjectEmoji`, `expectedLessons` (repeat the usual week where the school has not published one yet, marked tentative), `customLessons`, `homework`, `doneHomework`, `assessments`, `holidays`, `parentMeetings`, `birthdays`, `studyMode`, `lessonAlarmMinutes` (null, 0, 5, 10, 15, 30, 60), `homeworkAlarm`, `assessmentAlarm`."}},"/v1/calendar/feeds/{feed_id}":{"patch":{"tags":["Calendar"],"summary":"Change what a subscription contains","operationId":"update_feed_v1_calendar_feeds__feed_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"feed_id","in":"path","required":true,"schema":{"type":"string","title":"Feed Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/api__routes__calendar__PatchBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"400":{"description":"Invalid `lessonAlarmMinutes`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Body `{\"options\": {...}}` with only the keys to change; `lessonAlarmMinutes: null` turns lesson alerts off. Calendar apps pick the change up on their next refresh. Returns the Feed."},"delete":{"tags":["Calendar"],"summary":"Turn a subscription off","operationId":"delete_feed_v1_calendar_feeds__feed_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"feed_id","in":"path","required":true,"schema":{"type":"string","title":"Feed Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"204. The URL answers 404 from now on; the events disappear from subscribed calendars on their next refresh."}},"/v1/calendar/feeds/{feed_id}/rotate":{"post":{"tags":["Calendar"],"summary":"Issue a new subscription URL","operationId":"rotate_feed_v1_calendar_feeds__feed_id__rotate_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"feed_id","in":"path","required":true,"schema":{"type":"string","title":"Feed Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"The old URL stops working at once (404); calendars subscribed to it must subscribe again. Returns the Feed."}},"/v1/calendar/feeds/{feed_id}/preview":{"get":{"tags":["Calendar"],"summary":"Preview a subscription","description":"`{name, counts: {lesson, homework, assessment, holiday, meeting, birthday, study_day}, total, upcoming: [{kind, title, start, end, allDay, location, tentative}]}`, built by the same code as the `.ics`. `?limit=` (default 8, at most 30).","operationId":"preview_feed_v1_calendar_feeds__feed_id__preview_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"feed_id","in":"path","required":true,"schema":{"type":"string","title":"Feed Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":8,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/calendar/feed/{token}.ics":{"get":{"tags":["Calendar"],"summary":"The subscription (iCalendar)","description":"No bearer token: the URL is the credential. `text/calendar`, rendered at most every five minutes, with an `ETag` (`If-None-Match` gets 304). Timed events are UTC instants; all-day events use `VALUE=DATE`. Unknown, rotated or deleted tokens: 404.","operationId":"fetch_feed_v1_calendar_feed__token__ics_get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"head":{"tags":["Calendar"],"summary":"Fetch Feed","description":"The subscription itself. Unknown, revoked or malformed tokens get a\nplain 404, never a hint about which one it was.","operationId":"fetch_feed_v1_calendar_feed__token__ics_get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}}}}},"/v1/agent/models":{"get":{"tags":["Agent"],"summary":"List downloadable assistant models","operationId":"list_models_v1_agent_models_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"lang","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"uk | en | lt (defaults to uk)","title":"Lang"},"description":"uk | en | lt (defaults to uk)"},{"name":"appVersion","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Appversion"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentModelList"}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Active models this app build may download, in picker order. `?lang=` picks the description language (uk, en, lt; default uk) and `?appVersion=` hides models that need a newer app. Returns `{\"models\": [AgentModel]}`."}},"/v1/agent/config":{"get":{"tags":["Agent"],"summary":"Agent feature flag and settings","operationId":"get_config_v1_agent_config_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"HTTPBearer":[]}],"description":"`{enabled, modelName, modelURL, cloud: {enabled, id, displayName, thinking, webSearch, vision}}`. `enabled` is the feature flag for this account (on for everyone, or only for an allow-list); the app hides the agent when it is false. `cloud.enabled` says the online model can be used; `cloud.vision` that it reads photos."}},"/v1/agent/tools/web_search":{"post":{"tags":["Agent"],"summary":"Tool Web Search","description":"Web results (title, url, snippet) for the agent's web_search tool.","operationId":"tool_web_search_v1_agent_tools_web_search_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebSearchIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/agent/tools/read_webpage":{"post":{"tags":["Agent"],"summary":"Tool Read Webpage","description":"A page's readable text for the agent's read_webpage tool.","operationId":"tool_read_webpage_v1_agent_tools_read_webpage_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReadPageIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/agent/cloud/review":{"post":{"tags":["Agent"],"summary":"Cloud Review","description":"Prompt-injection review of one action the online agent wants to take\nafter reading untrusted content (services/agent_guard.py). Never fails\nopen: anything wrong answers \"confirm\".","operationId":"cloud_review_v1_agent_cloud_review_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/agent/cloud/usage":{"get":{"tags":["Agent"],"summary":"Cloud Usage","description":"This month's spending on the online model against the account's cap.","operationId":"cloud_usage_v1_agent_cloud_usage_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/agent/cloud/chat":{"post":{"tags":["Agent"],"summary":"One pass of the online model","description":"Body `{messages, tools, temperature, maxTokens, thinking}` in OpenAI chat format (roles system, user, assistant with `tool_calls`, tool). A user message's `content` may also be a list of `{type: text, text}` and `{type: image_url, image_url: {url}}` parts, the url a JPEG, PNG or WebP base64 data URL (at most 8 photos, 1.5 MB each); with `cloudVision` off each photo becomes a \"[photo]\" note. Proxied to the configured OpenAI-compatible provider (DeepSeek); the reply streams back as `text/plain` in Gemma 4's output format (text, `<|channel>thought…<channel|>`, `<|tool_call>call:name{…}<tool_call|>`, then `<|tool_response>` or `<turn|>`), so the app parses it like the local model. Tools run on the phone. Message content is not logged. `thinking: true` uses `cloudThinkingModel` (DeepSeek's reasoner), whose reasoning streams as the thought channel. Limited to 120 passes per 10 minutes and `cloudDailyLimit` per day per account.","operationId":"cloud_chat_v1_agent_cloud_chat_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloudChatIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"400":{"description":"`bad_messages`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`agent_cloud_disabled`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited, or the provider is.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"`agent_cloud_unreachable` / `agent_cloud_upstream_<status>`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"`agent_cloud_unconfigured`: no API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/wrapped":{"get":{"tags":["Wrapped"],"summary":"Get the semester recap deck","operationId":"get_wrapped_v1_wrapped_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"lang","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"uk | en | lt; falls back to X-Tvoia-Locale","title":"Lang"},"description":"uk | en | lt; falls back to X-Tvoia-Locale"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Always 200. `status` is `ready` (the deck is in `slides`), `not_enough_data`, `ended` (after `availableUntil`) or `unavailable` (switched off, before `availableFrom`, or a parent account); anything but `ready` carries `slides: []`. `lang` is `uk`, `en` or `lt` and falls back to `X-Tvoia-Locale`. `slides` is the whole ordered deck, including `intro`, `archetype`, `outro` and `summary`. Every slide has the same envelope (`id`, `type`, `theme`, `kicker`, `headline`, `caption`, `footnote`, `stat`, `sticker`, `shareable`, `autoAdvanceMs`, `data`) with finished, localised copy; an unknown `type` can be drawn from the envelope alone, and `data` keys are only ever added. A slide is sent only when it qualifies, so optional `data` keys are omitted rather than null. `deckVersion` changes when the deck does (for example once final grades are posted). Decks are computed once at the freeze and served from that store afterwards. The `streak` slide is a placeholder (`data.source: \"client\"`) that the app fills from its own streak data."}},"/v1/wrapped/share":{"get":{"tags":["Wrapped"],"summary":"List my Wrapped links","description":"`{\"shares\": [Share]}`: every live link of this account, newest first.","operationId":"list_shares_v1_wrapped_share_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`students_only`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["Wrapped"],"summary":"Share a slide, the summary or the whole deck","description":"Body `{\"scope\": \"<slide id>\" | \"summary\" | \"deck\", \"lang\"?: \"uk\"}`. The server takes the slides from the caller's own deck (nothing else is accepted from the client), freezes them and renders 1080×1920 posters. Returns a Share: `{\"key\", \"scope\", \"status\": \"pending|rendering|ready|failed\", \"url\": \"https://tvoia.link/w/<key>\", \"images\": [{\"slide\", \"url\", \"width\", \"height\", \"ready\"}], \"ogImageUrl\", \"expiresAt\", \"retryAfterMs\"}`. A single slide or the summary waits up to about six seconds for the poster, so the response is usually `ready`; `deck` returns at once and `images[].ready` flips as posters finish (poll `GET /v1/wrapped/share/{key}` every `retryAfterMs`). Sharing the same scope again returns the same key and re-renders only if the posters would differ. Links last 90 days from the last share. Under the sharer's privacy mode the posters carry no name, class or rank, and a rank slide cannot be shared. App and device tokens only; students only. **Rate limited:** 30 per 10 minutes.","operationId":"create_share_v1_wrapped_share_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShareRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`students_only`, or `web_token_not_allowed`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_shareable` (not in the deck, or not `shareable: \"server\"`), `wrapped_not_ready`, or `sharing_disabled`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"HTTPBearer":[]}]},"delete":{"tags":["Wrapped"],"summary":"Stop sharing everything","description":"204. Removes every Wrapped link of this account and the stored posters.","operationId":"delete_all_shares_v1_wrapped_share_delete","responses":{"204":{"description":"Successful Response"},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/wrapped/share/{key}":{"get":{"tags":["Wrapped"],"summary":"Poll a Wrapped link","description":"The Share, with the current `status` and `images[].ready`.","operationId":"get_share_v1_wrapped_share__key__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`share_not_found`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Wrapped"],"summary":"Stop sharing a link","description":"204. The link 404s (within a minute at the edge) and its posters are deleted. Copies already saved by others, or cached by a messenger's link preview, cannot be recalled. Not an error if it is already gone.","operationId":"delete_share_v1_wrapped_share__key__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Request validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Missing, malformed or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"ActiveChildRequest":{"properties":{"childID":{"type":"integer","title":"Childid"}},"type":"object","required":["childID"],"title":"ActiveChildRequest"},"AdEventIn":{"properties":{"type":{"type":"string","enum":["impression","click","dismiss"],"title":"Type"}},"type":"object","required":["type"],"title":"AdEventIn"},"AddBookRequest":{"properties":{"book_id":{"type":"string","title":"Book Id"}},"type":"object","required":["book_id"],"title":"AddBookRequest"},"ApproveBody":{"properties":{"expiryMode":{"type":"string","maxLength":16,"title":"Expirymode"},"customMinutes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Customminutes"},"label":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}],"title":"Label"},"childID":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Childid"},"approveTarget":{"anyOf":[{"type":"string","maxLength":16},{"type":"null"}],"title":"Approvetarget"}},"type":"object","required":["expiryMode"],"title":"ApproveBody"},"BodiesBody":{"properties":{"ids":{"items":{"type":"string"},"type":"array","maxItems":50,"title":"Ids"}},"type":"object","required":["ids"],"title":"BodiesBody"},"Body_add_file_v1_clip_file__post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"},"device":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Device"},"pinned":{"type":"boolean","title":"Pinned","default":false}},"type":"object","required":["file"],"title":"Body_add_file_v1_clip_file__post"},"Body_add_file_v1_clip_file_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"},"device":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Device"},"pinned":{"type":"boolean","title":"Pinned","default":false}},"type":"object","required":["file"],"title":"Body_add_file_v1_clip_file_post"},"Body_add_homework_files_v1_homework__homework_id__files__post":{"properties":{"files":{"items":{"type":"string","contentMediaType":"application/octet-stream"},"type":"array","title":"Files","default":[]}},"type":"object","title":"Body_add_homework_files_v1_homework__homework_id__files__post"},"Body_add_homework_files_v1_homework__homework_id__files_post":{"properties":{"files":{"items":{"type":"string","contentMediaType":"application/octet-stream"},"type":"array","title":"Files","default":[]}},"type":"object","title":"Body_add_homework_files_v1_homework__homework_id__files_post"},"Body_register_v1_auth_register__post":{"properties":{"pfp":{"anyOf":[{"type":"string","contentMediaType":"application/octet-stream"},{"type":"null"}],"title":"Pfp"},"username":{"type":"string","title":"Username","default":""}},"type":"object","title":"Body_register_v1_auth_register__post"},"Body_register_v1_auth_register_post":{"properties":{"pfp":{"anyOf":[{"type":"string","contentMediaType":"application/octet-stream"},{"type":"null"}],"title":"Pfp"},"username":{"type":"string","title":"Username","default":""}},"type":"object","title":"Body_register_v1_auth_register_post"},"Body_send_message_v1_chats_send__post":{"properties":{"receiverType":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Receivertype"},"recipientIds":{"type":"string","title":"Recipientids","default":""},"subject":{"type":"string","title":"Subject","default":""},"body":{"type":"string","title":"Body","default":""},"chatID":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Chatid"},"copyToPlatform":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Copytoplatform"},"replyToID":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Replytoid"},"files":{"items":{"type":"string","contentMediaType":"application/octet-stream"},"type":"array","title":"Files","default":[]}},"type":"object","title":"Body_send_message_v1_chats_send__post"},"Body_send_message_v1_chats_send_post":{"properties":{"receiverType":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Receivertype"},"recipientIds":{"type":"string","title":"Recipientids","default":""},"subject":{"type":"string","title":"Subject","default":""},"body":{"type":"string","title":"Body","default":""},"chatID":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Chatid"},"copyToPlatform":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Copytoplatform"},"replyToID":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Replytoid"},"files":{"items":{"type":"string","contentMediaType":"application/octet-stream"},"type":"array","title":"Files","default":[]}},"type":"object","title":"Body_send_message_v1_chats_send_post"},"Body_upload_file_v1_notes__nid__files__post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"},"w":{"type":"integer","title":"W","default":0},"h":{"type":"integer","title":"H","default":0},"capture":{"type":"boolean","title":"Capture","default":false}},"type":"object","required":["file"],"title":"Body_upload_file_v1_notes__nid__files__post"},"Body_upload_file_v1_notes__nid__files_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"},"w":{"type":"integer","title":"W","default":0},"h":{"type":"integer","title":"H","default":0},"capture":{"type":"boolean","title":"Capture","default":false}},"type":"object","required":["file"],"title":"Body_upload_file_v1_notes__nid__files_post"},"BookmarkRequest":{"properties":{"page_number":{"type":"integer","title":"Page Number"},"title":{"type":"string","title":"Title","default":""}},"type":"object","required":["page_number"],"title":"BookmarkRequest"},"ClaimBody":{"properties":{"code":{"type":"string","maxLength":16,"title":"Code"},"secret":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Secret"},"childID":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Childid"}},"type":"object","required":["code"],"title":"ClaimBody"},"ClientHint":{"properties":{"browser":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}],"title":"Browser"},"os":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}],"title":"Os"}},"type":"object","title":"ClientHint"},"CloudChatIn":{"properties":{"messages":{"items":{"additionalProperties":true,"type":"object"},"type":"array","maxItems":5000,"minItems":1,"title":"Messages"},"tools":{"items":{"additionalProperties":true,"type":"object"},"type":"array","maxItems":60,"title":"Tools"},"temperature":{"type":"number","maximum":2.0,"minimum":0.0,"title":"Temperature","default":0.3},"maxTokens":{"type":"integer","maximum":4096.0,"minimum":1.0,"title":"Maxtokens","default":1024},"thinking":{"type":"boolean","title":"Thinking","default":false}},"type":"object","required":["messages"],"title":"CloudChatIn"},"CustomLessonBody":{"properties":{"title":{"type":"string","title":"Title"},"subjectName":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subjectname"},"teacherName":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Teachername"},"location":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Location"},"startTime":{"type":"string","title":"Starttime"},"endTime":{"type":"string","title":"Endtime"},"weekdays":{"items":{"type":"integer"},"type":"array","title":"Weekdays","default":[]},"date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date"},"validFrom":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Validfrom"},"validUntil":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Validuntil"},"colorHex":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Colorhex"},"emoji":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Emoji"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"},"isOnline":{"type":"boolean","title":"Isonline","default":false}},"type":"object","required":["title","startTime","endTime"],"title":"CustomLessonBody"},"DeviceTokenRequest":{"properties":{"token":{"type":"string","title":"Token"},"deviceToken":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Devicetoken"},"platform":{"type":"string","enum":["ios","android"],"title":"Platform","default":"ios"}},"type":"object","required":["token"],"title":"DeviceTokenRequest"},"DuplicateBody":{"properties":{"id":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Id"},"title":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}],"title":"Title"}},"type":"object","title":"DuplicateBody"},"FolderBody":{"properties":{"id":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Id"},"name":{"type":"string","maxLength":80,"minLength":1,"title":"Name"},"icon":{"anyOf":[{"type":"string","maxLength":16},{"type":"null"}],"title":"Icon"},"pos":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Pos"}},"type":"object","required":["name"],"title":"FolderBody"},"FolderPatch":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":80,"minLength":1},{"type":"null"}],"title":"Name"},"icon":{"anyOf":[{"type":"string","maxLength":16},{"type":"null"}],"title":"Icon"},"pos":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Pos"}},"type":"object","title":"FolderPatch"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HomeworkCreateRequest":{"properties":{"description":{"type":"string","title":"Description"},"dueDate":{"type":"string","title":"Duedate"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject"}},"type":"object","required":["description","dueDate"],"title":"HomeworkCreateRequest"},"HomeworkDoneRequest":{"properties":{"isDone":{"type":"boolean","title":"Isdone"}},"type":"object","required":["isDone"],"title":"HomeworkDoneRequest"},"HomeworkUpdateRequest":{"properties":{"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"dueDate":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Duedate"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject"}},"type":"object","title":"HomeworkUpdateRequest"},"LayoutBody":{"properties":{"ifVersion":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Ifversion"},"layout":{"additionalProperties":true,"type":"object","title":"Layout"}},"type":"object","required":["layout"],"title":"LayoutBody"},"LessonLinkRequest":{"properties":{"lessonID":{"type":"string","title":"Lessonid"},"scope":{"type":"string","enum":["teacher","weekly","date"],"title":"Scope"},"url":{"type":"string","title":"Url"}},"type":"object","required":["lessonID","scope","url"],"title":"LessonLinkRequest"},"LocaleRequest":{"properties":{"locale":{"type":"string","enum":["uk","en","lt"],"title":"Locale"}},"type":"object","required":["locale"],"title":"LocaleRequest"},"LoginDevice":{"properties":{"model":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}],"title":"Model"},"name":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}],"title":"Name"},"platform":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}],"title":"Platform"},"appVersion":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}],"title":"Appversion"}},"type":"object","title":"LoginDevice","description":"Optional self-reported make of the device logging in, so the login can\nbe listed in the Devices list. Old apps omit it (the fields fall back to\nthe User-Agent). Display only, never trusted. `protected_namespaces=()`\nlets the field be literally named `model`."},"LoginRequest":{"properties":{"schoolCode":{"type":"string","title":"Schoolcode","default":""},"email":{"type":"string","title":"Email"},"password":{"type":"string","title":"Password"},"device":{"anyOf":[{"$ref":"#/components/schemas/LoginDevice"},{"type":"null"}]}},"type":"object","required":["email","password"],"title":"LoginRequest"},"LogoutRequest":{"properties":{"deviceToken":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Devicetoken"},"revokeWebSessions":{"type":"boolean","title":"Revokewebsessions","default":false}},"type":"object","title":"LogoutRequest"},"NotificationPreferences":{"properties":{"new_grade":{"type":"boolean","title":"New Grade","default":true},"grade_changed":{"type":"boolean","title":"Grade Changed","default":true},"grade_removed":{"type":"boolean","title":"Grade Removed","default":true},"new_homework":{"type":"boolean","title":"New Homework","default":true},"homework_edited":{"type":"boolean","title":"Homework Edited","default":true},"homework_removed":{"type":"boolean","title":"Homework Removed","default":true},"new_message":{"type":"boolean","title":"New Message","default":true},"new_remark":{"type":"boolean","title":"New Remark","default":true},"new_attendance":{"type":"boolean","title":"New Attendance","default":true},"new_survey":{"type":"boolean","title":"New Survey","default":true},"live_activity":{"type":"boolean","title":"Live Activity","default":true},"low_grade_alert":{"type":"boolean","title":"Low Grade Alert","default":false},"low_grade_threshold":{"type":"integer","title":"Low Grade Threshold","default":6},"unexcused_absence_alert":{"type":"boolean","title":"Unexcused Absence Alert","default":false},"homework_due_alert":{"type":"boolean","title":"Homework Due Alert","default":false},"weekly_digest":{"type":"boolean","title":"Weekly Digest","default":false},"homework_due_time":{"type":"string","title":"Homework Due Time","default":"17:00"},"weekly_digest_time":{"type":"string","title":"Weekly Digest Time","default":"17:00"},"parent_meeting_alert":{"type":"boolean","title":"Parent Meeting Alert","default":false},"web_login_alert":{"type":"boolean","title":"Web Login Alert","default":true},"clip_alert":{"type":"boolean","title":"Clip Alert","default":true},"wrapped_alert":{"type":"boolean","title":"Wrapped Alert","default":true}},"type":"object","title":"NotificationPreferences"},"OpsBody":{"properties":{"batchId":{"type":"string","maxLength":64,"title":"Batchid","default":""},"baseVersion":{"type":"integer","title":"Baseversion","default":0},"ops":{"items":{"additionalProperties":true,"type":"object"},"type":"array","maxItems":2000,"title":"Ops"}},"type":"object","required":["ops"],"title":"OpsBody"},"OptionsBody":{"properties":{"lessons":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Lessons"},"lessonStyle":{"anyOf":[{"type":"string","enum":["each","day"]},{"type":"null"}],"title":"Lessonstyle"},"lessonNumbers":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Lessonnumbers"},"subjectEmoji":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Subjectemoji"},"expectedLessons":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Expectedlessons"},"customLessons":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Customlessons"},"homework":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Homework"},"doneHomework":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Donehomework"},"assessments":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Assessments"},"holidays":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Holidays"},"parentMeetings":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Parentmeetings"},"birthdays":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Birthdays"},"studyMode":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Studymode"},"lessonAlarmMinutes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Lessonalarmminutes"},"homeworkAlarm":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Homeworkalarm"},"assessmentAlarm":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Assessmentalarm"}},"type":"object","title":"OptionsBody","description":"Every field optional: a PATCH changes only what it sends. Send\n`lessonAlarmMinutes: null` to turn lesson alerts off."},"PairCreateBody":{"properties":{"clientHint":{"anyOf":[{"$ref":"#/components/schemas/ClientHint"},{"type":"null"}]},"target":{"type":"string","enum":["web","app"],"title":"Target","default":"web"},"deviceType":{"anyOf":[{"type":"string","maxLength":16},{"type":"null"}],"title":"Devicetype"},"deviceModel":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}],"title":"Devicemodel"},"devicePlatform":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}],"title":"Deviceplatform"},"appVersion":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}],"title":"Appversion"},"deviceName":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}],"title":"Devicename"}},"type":"object","title":"PairCreateBody"},"PlatformCopyBody":{"properties":{"enabled":{"type":"boolean","title":"Enabled"}},"type":"object","required":["enabled"],"title":"PlatformCopyBody"},"PollBody":{"properties":{"pollSecret":{"type":"string","maxLength":128,"title":"Pollsecret"},"wait":{"type":"integer","maximum":10.0,"minimum":0.0,"title":"Wait","default":10}},"type":"object","required":["pollSecret"],"title":"PollBody"},"PrivacyRequest":{"properties":{"hideNameOnLeaderboard":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Hidenameonleaderboard"},"leaderboardVisibility":{"anyOf":[{"type":"string","enum":["everyone","school","class","off"]},{"type":"null"}],"title":"Leaderboardvisibility"},"globalLeaderboard":{"anyOf":[{"type":"string","enum":["everyone","school","off"]},{"type":"null"}],"title":"Globalleaderboard"},"classLeaderboardOptIn":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Classleaderboardoptin"}},"type":"object","title":"PrivacyRequest"},"ProgressRequest":{"properties":{"current_page":{"type":"integer","title":"Current Page"},"locator_json":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Locator Json"}},"type":"object","required":["current_page"],"title":"ProgressRequest"},"ReadPageIn":{"properties":{"url":{"type":"string","maxLength":2048,"minLength":3,"title":"Url"}},"type":"object","required":["url"],"title":"ReadPageIn"},"ReminderRequest":{"properties":{"reminderDate":{"type":"string","title":"Reminderdate"}},"type":"object","required":["reminderDate"],"title":"ReminderRequest"},"ResetPasswordRequest":{"properties":{"email":{"type":"string","title":"Email"}},"type":"object","required":["email"],"title":"ResetPasswordRequest"},"ReviewAction":{"properties":{"name":{"type":"string","maxLength":80,"minLength":1,"title":"Name"},"arguments":{"additionalProperties":true,"type":"object","title":"Arguments"}},"type":"object","required":["name"],"title":"ReviewAction"},"ReviewIn":{"properties":{"request":{"type":"string","maxLength":4000,"title":"Request","default":""},"action":{"$ref":"#/components/schemas/ReviewAction"},"risk":{"type":"string","maxLength":20,"title":"Risk","default":"reversible"},"untrusted":{"items":{"type":"string"},"type":"array","maxItems":8,"title":"Untrusted"},"language":{"type":"string","maxLength":5,"title":"Language","default":"uk"}},"type":"object","required":["action"],"title":"ReviewIn"},"RoomRuleRequest":{"properties":{"weekday":{"type":"integer","title":"Weekday"},"lessonNumber":{"type":"integer","title":"Lessonnumber"},"subjectMatter":{"type":"string","title":"Subjectmatter"},"room":{"type":"string","title":"Room"}},"type":"object","required":["weekday","lessonNumber","subjectMatter","room"],"title":"RoomRuleRequest"},"SeenIn":{"properties":{"until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Until"}},"type":"object","title":"SeenIn"},"ShareManyBody":{"properties":{"ids":{"items":{"type":"string"},"type":"array","title":"Ids"}},"type":"object","required":["ids"],"title":"ShareManyBody"},"ShareRequest":{"properties":{"scope":{"type":"string","title":"Scope"},"lang":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lang"}},"type":"object","required":["scope"],"title":"ShareRequest"},"SharingRequest":{"properties":{"shareWithParents":{"type":"boolean","title":"Sharewithparents"}},"type":"object","required":["shareWithParents"],"title":"SharingRequest"},"StudyModeOverrideBody":{"properties":{"date":{"type":"string","title":"Date"},"mode":{"type":"string","enum":["online","offline"],"title":"Mode"},"note":{"type":"string","title":"Note","default":""}},"type":"object","required":["date","mode"],"title":"StudyModeOverrideBody"},"StudyModeOverrideRequest":{"properties":{"date":{"type":"string","title":"Date"},"mode":{"anyOf":[{"type":"string","enum":["online","offline"]},{"type":"null"}],"title":"Mode"},"note":{"type":"string","title":"Note","default":""}},"type":"object","required":["date"],"title":"StudyModeOverrideRequest"},"StudyModeRuleBody":{"properties":{"kind":{"type":"string","enum":["weekdays","day_parity","week_parity","cycle"],"title":"Kind"},"mode":{"type":"string","enum":["online","offline"],"title":"Mode"},"weekdays":{"items":{"type":"integer"},"type":"array","title":"Weekdays","default":[]},"parity":{"anyOf":[{"type":"string","enum":["even","odd"]},{"type":"null"}],"title":"Parity"},"anchorDate":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Anchordate"},"label":{"type":"string","title":"Label","default":""},"offlineDays":{"type":"integer","title":"Offlinedays","default":0},"onlineDays":{"type":"integer","title":"Onlinedays","default":0},"carryOver":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Carryover"}},"type":"object","required":["kind","mode"],"title":"StudyModeRuleBody"},"StudyModeSettingsBody":{"properties":{"enabled":{"type":"boolean","title":"Enabled","default":false},"defaultMode":{"type":"string","enum":["online","offline"],"title":"Defaultmode","default":"offline"},"rules":{"items":{"$ref":"#/components/schemas/StudyModeRuleBody"},"type":"array","title":"Rules","default":[]},"overrides":{"items":{"$ref":"#/components/schemas/StudyModeOverrideBody"},"type":"array","title":"Overrides","default":[]},"schoolDays":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Schooldays"}},"type":"object","title":"StudyModeSettingsBody"},"SubjectLinksRequest":{"properties":{"subject_ids":{"items":{"type":"string"},"type":"array","title":"Subject Ids"}},"type":"object","required":["subject_ids"],"title":"SubjectLinksRequest"},"SurveyAnswer":{"properties":{"questionID":{"type":"string","title":"Questionid"},"optionIDs":{"items":{"type":"string"},"type":"array","title":"Optionids"},"text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text"}},"type":"object","required":["questionID"],"title":"SurveyAnswer"},"SurveyAnswersRequest":{"properties":{"answers":{"items":{"$ref":"#/components/schemas/SurveyAnswer"},"type":"array","title":"Answers"}},"type":"object","required":["answers"],"title":"SurveyAnswersRequest"},"TextBody":{"properties":{"text":{"type":"string","maxLength":100000,"minLength":1,"title":"Text"},"device":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Device"},"pinned":{"type":"boolean","title":"Pinned","default":false}},"type":"object","required":["text"],"title":"TextBody"},"TokenBody":{"properties":{"pollSecret":{"type":"string","maxLength":128,"title":"Pollsecret"}},"type":"object","required":["pollSecret"],"title":"TokenBody"},"TokenRequest":{"properties":{"token":{"type":"string","title":"Token"},"deviceToken":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Devicetoken"}},"type":"object","required":["token"],"title":"TokenRequest"},"UserEventBody":{"properties":{"kind":{"type":"string","title":"Kind"},"date":{"type":"string","title":"Date"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"emoji":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Emoji"},"subjectID":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subjectid"},"lessonNumber":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Lessonnumber"},"startTime":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Starttime"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"},"reminder":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reminder","default":"evening"}},"type":"object","required":["kind","date"],"title":"UserEventBody"},"ValidationError":{"type":"object","description":"Request validation failure.","properties":{"detail":{"type":"array","items":{"type":"object","properties":{"loc":{"type":"array","items":{"type":"string"}},"msg":{"type":"string"},"type":{"type":"string"}}}}},"example":{"detail":[{"loc":["query","limit"],"msg":"ensure this value is less than or equal to 200","type":"value_error.number.not_le"}]}},"WebSearchIn":{"properties":{"query":{"type":"string","maxLength":400,"minLength":1,"title":"Query"},"maxResults":{"type":"integer","maximum":8.0,"minimum":1.0,"title":"Maxresults","default":5}},"type":"object","required":["query"],"title":"WebSearchIn"},"WebSessionPatch":{"properties":{"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"expiryMode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expirymode"},"customMinutes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Customminutes"},"childID":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Childid"}},"type":"object","title":"WebSessionPatch"},"api__routes__calendar__CreateBody":{"properties":{"childID":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Childid"},"options":{"anyOf":[{"$ref":"#/components/schemas/OptionsBody"},{"type":"null"}]}},"type":"object","title":"CreateBody"},"api__routes__calendar__PatchBody":{"properties":{"options":{"$ref":"#/components/schemas/OptionsBody"}},"type":"object","required":["options"],"title":"PatchBody"},"api__routes__clipboard__PatchBody":{"properties":{"text":{"anyOf":[{"type":"string","maxLength":100000},{"type":"null"}],"title":"Text"},"pinned":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Pinned"}},"type":"object","title":"PatchBody"},"api__routes__notes__CreateBody":{"properties":{"id":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Id"},"kind":{"type":"string","title":"Kind","default":"page"},"title":{"type":"string","maxLength":300,"title":"Title","default":""},"icon":{"anyOf":[{"type":"string","maxLength":16},{"type":"null"}],"title":"Icon"},"folderId":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Folderid"},"pinned":{"type":"boolean","title":"Pinned","default":false},"color":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Color"},"blocks":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Blocks"},"board":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Board"},"fromText":{"anyOf":[{"type":"string","maxLength":200000},{"type":"null"}],"title":"Fromtext"},"capture":{"type":"boolean","title":"Capture","default":false},"device":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Device"}},"type":"object","title":"CreateBody"},"Error":{"type":"object","description":"FastAPI's standard error body.","properties":{"detail":{"type":"string","description":"Human-readable message, or a machine-readable slug where the client branches on it."}},"example":{"detail":"Chat not found"}},"Attachment":{"type":"object","properties":{"id":{"type":"string","description":"File id."},"name":{"type":"string","description":"Original filename as the platform had it."},"fileType":{"type":"string","description":"Coarse kind guessed from the extension.","enum":["image","video","audio","pdf","document","archive","other"]},"url":{"type":"string","description":"Short key URL — resolve through `/v1/files/resolve/{short_key}`."},"sizeBytes":{"type":["integer","null"]}}},"Paginated":{"type":"object","description":"Standard pagination envelope.","properties":{"data":{"type":"array","items":{"type":"object"},"description":"The page of results."},"total":{"type":"integer","description":"Total matching records, ignoring `skip`/`limit`."},"skip":{"type":"integer"},"limit":{"type":"integer"},"hasMore":{"type":"boolean","description":"True when `skip + limit < total`."}}},"Me":{"type":"object","description":"The signed-in student, merged from the platform's mobile and web accounts plus the Tvoia account.","properties":{"id":{"type":"string","description":"Tvoia user id."},"firstName":{"type":"string","description":"Given name."},"lastName":{"type":"string","description":"Surname."},"middleName":{"type":"string","description":"Patronymic; often empty."},"className":{"type":"string","description":"e.g. `9С`."},"schoolName":{"type":"string","description":"Establishment name from the current enrollment."},"schoolCode":{"type":"string","description":"Reserved; currently empty."},"studentID":{"type":"string","description":"Platform person id, as a string."},"avatarURL":{"type":["string","null"],"description":"Signed S3 URL, valid 24h. Null when no avatar is set."},"email":{"type":"string","description":"Email on the platform account."},"username":{"type":"string","description":"Tvoia handle («тег»), chosen by the user."},"averageGrade":{"type":"number","description":"Rounded to 2 decimals; 0 when unknown."},"attendanceRate":{"type":["number","null"]},"totalLessons":{"type":["integer","null"]},"lessonsTaken":{"type":["integer","null"]},"hideNameOnLeaderboard":{"type":"boolean","description":"Privacy mode. See *Privacy* in the overview."},"registeredAt":{"type":"string","description":"ISO-8601 UTC.","format":"date-time"},"accountType":{"type":"string","enum":["student","parent"],"description":"Parent mode: `parent` when the platform account has no own enrollment but `childEnrollments`. Legacy keys above keep describing the account holder."},"canEdit":{"type":"boolean","description":"False for parents: homework state, custom lessons, room rules, study mode and the library are the student's. Writes from a parent with the `X-Tvoia-Client` header get 403 `parent_read_only`; clients without the header behave as before."},"activeChildID":{"type":["integer","null"],"description":"Parents: the child currently shown (enrollment student id). Pass it as `childID` on reads to view another child."},"children":{"type":"array","items":{"$ref":"#/components/schemas/ChildProfile"},"description":"Parents: every child on the platform account. Empty for students."},"shareWithParents":{"type":"boolean","description":"Students: consent for a linked parent account to see homework done marks and study mode."},"hasLinkedParent":{"type":"boolean","description":"Students: a parent Tvoia account lists this student as a child."}},"example":{"id":"66e1f0a2c4b1a2d3e4f50001","firstName":"Іван","lastName":"Дем'янов","middleName":"","className":"9С","schoolName":"Науковий ліцей № 3","schoolCode":"","studentID":"277838","avatarURL":"https://s3.eu-central.example/tvoia/pfp/abc.jpg?X-Amz-Expires=86400","email":"ivan@example.com","username":"abc123","averageGrade":10.42,"attendanceRate":0.96,"totalLessons":812,"lessonsTaken":780,"hideNameOnLeaderboard":false,"registeredAt":"2026-01-14T09:12:03Z"}},"ChildProfile":{"type":"object","description":"A child of a parent account. `studentID` is the enrollment student id the API expects as `childID`.","properties":{"studentID":{"type":"integer"},"personID":{"type":["integer","null"]},"firstName":{"type":"string","description":""},"lastName":{"type":"string","description":""},"className":{"type":"string","description":"Empty until the class letter is known for the child's role."},"schoolName":{"type":"string","description":""},"isActive":{"type":"boolean","description":"The child currently shown by default."},"hasTvoiaAccount":{"type":"boolean","description":"The child uses Tvoia themselves."},"sharesWithParents":{"type":"boolean","description":"The child opted in to sharing done marks and study mode."}},"example":{"studentID":392792,"personID":563200,"firstName":"Марія","lastName":"Грешко","className":"","schoolName":"Мукачівський ліцей №10","isActive":true,"hasTvoiaAccount":false,"sharesWithParents":false}},"Person":{"type":"object","description":"A person reachable through the platform.\n\n**When `isPrivate` is true only the first six fields are present** — everything after it is withheld. Treat every field but `id` and `name` as optional.","required":["id","name","isPrivate","isCurrentUser","isTvoiaUser"],"properties":{"id":{"type":"string","description":"`p<platformID>_<receiverType>`, e.g. `p277838_9`."},"name":{"type":"string","description":"Full name. The platform list shows «Прізвище Ім'я»; a matched Tvoia profile may add the patronymic."},"avatarURL":{"type":["string","null"],"description":"Signed S3 URL, valid 24h. Only Tvoia users have one."},"isPrivate":{"type":"boolean","description":"True when this person hides their profile and you are not them."},"isCurrentUser":{"type":"boolean","description":"True when this person is the caller."},"isTvoiaUser":{"type":"boolean","description":"True when they were matched to a Tvoia account."},"username":{"type":["string","null"],"description":"Tvoia handle. Withheld when private."},"role":{"type":["string","null"],"description":"Derived from the platform receiver type. Unknown types give `other`.","enum":["teacher","admin","student","parent","librarian","other"]},"roleName":{"type":["string","null"],"description":"The platform's own label («Вчителі школи»), else a Ukrainian fallback for `role`."},"className":{"type":["string","null"],"description":"Only known for matched Tvoia users."},"school":{"type":["string","null"],"description":"Establishment name."},"platformID":{"type":["integer","null"],"description":"Numeric id in the school platform."},"receiverType":{"type":["integer","null"],"description":"Platform receiver type: 2/11 teacher, 8/13 admin, 9 classmate, 12 parent, 15 librarian."},"registeredAt":{"type":["string","null"],"description":"When they joined Tvoia.","format":"date-time"}},"example":{"id":"p277838_9","name":"Дем'янов Іван Петрович","avatarURL":"https://s3.eu-central.example/tvoia/pfp/abc.jpg?X-Amz-Expires=86400","isPrivate":false,"isCurrentUser":false,"isTvoiaUser":true,"username":"abc123","role":"student","roleName":"Учні свого класу","className":"9С","school":"Науковий ліцей № 3","platformID":277838,"receiverType":9,"registeredAt":"2026-01-14T09:12:03Z"}},"PersonPrivate":{"type":"object","description":"What a person with privacy mode on looks like — the remaining fields are absent, not null.","example":{"id":"p290114_9","name":"Лоза Максим","avatarURL":"https://s3.eu-central.example/tvoia/pfp/def.jpg?X-Amz-Expires=86400","isPrivate":true,"isCurrentUser":false,"isTvoiaUser":true}},"Recipient":{"type":"object","description":"A possible message recipient.\n\nThe first five fields are the **legacy** contract and keep their types forever — `school` is blanked to `\"\"` rather than nulled for a private person. The rest were added with the people index and are absent on older servers.","properties":{"id":{"type":"integer","description":"Platform id — what `POST /v1/chats/send` expects in `recipientIds`."},"name":{"type":"string","description":"Full name."},"receiverType":{"type":"integer","description":"Platform receiver type."},"school":{"type":"string","description":"Establishment name; `\"\"` when unknown or withheld."},"tvoiaUser":{"type":["object","null"],"description":"Present when matched to a Tvoia account and not private.","properties":{"id":{"type":"string"},"username":{"type":["string","null"]}}},"canDeliverInTvoia":{"type":["boolean","null"],"description":"Whether a message to this recipient can be delivered inside Tvoia, i.e. whether «Копіювати в МШ» may be switched off. Unlike `tvoiaUser` this is NOT withheld for a private person, who would otherwise be reported as not using Tvoia and have the toggle locked. Absent on older servers — treat a missing value as false."},"personID":{"type":["string","null"],"description":"Feed to `/v1/people/{person_id}` for the full profile."},"role":{"type":["string","null"],"description":"See `Person.role`. Withheld when private."},"className":{"type":["string","null"],"description":"Withheld when private."},"avatarURL":{"type":["string","null"],"description":"Signed S3 URL, valid 24h."},"isPrivate":{"type":["boolean","null"]}},"example":{"id":277838,"name":"Дем'янов Іван","receiverType":9,"school":"Науковий ліцей № 3","tvoiaUser":{"id":"66e1f0a2c4b1a2d3e4f50001","username":"abc123"},"canDeliverInTvoia":true,"personID":"p277838_9","role":"student","className":"9С","avatarURL":"https://s3.eu-central.example/tvoia/pfp/abc.jpg?X-Amz-Expires=86400","isPrivate":false}},"ChatParticipant":{"type":"object","description":"Someone who has sent or received a message in this chat. `name`/`username`/`avatarURL`/`isCurrentUser` are the legacy contract; the rest was added with the people index.","properties":{"name":{"type":["string","null"],"description":"Full name as the platform stores it."},"username":{"type":["string","null"],"description":"Tvoia handle. Null when not a Tvoia user, or when private."},"avatarURL":{"type":["string","null"],"description":"Signed S3 URL, valid 24h."},"isCurrentUser":{"type":"boolean"},"personID":{"type":["string","null"],"description":"Null when the people index cannot resolve them; the client should then not link to a profile."},"role":{"type":["string","null"],"description":"See `Person.role`. Withheld when private."},"school":{"type":["string","null"],"description":"Withheld when private."},"className":{"type":["string","null"],"description":"Withheld when private."},"isPrivate":{"type":["boolean","null"]}}},"Chat":{"type":"object","description":"A conversation. Pinned chats sort first, then by last message date.","properties":{"id":{"type":"string","description":"Chat id."},"title":{"type":"string","description":"Subject line, with Tvoia's `[TC…]` tag and «Відп:» prefixes stripped."},"type":{"type":"string","enum":["direct"],"description":"Only direct chats exist today."},"participantNames":{"type":"array","items":{"type":"string"},"description":"Counterparts, excluding the caller."},"lastMessage":{"$ref":"#/components/schemas/ChatLastMessage"},"unreadCount":{"type":"integer"},"isPinned":{"type":"boolean"},"isMuted":{"type":"boolean"},"isArchived":{"type":"boolean","description":"Always false; reserved."},"createdAt":{"type":"string","description":"Last message date, despite the name.","format":"date-time"},"avatarURL":{"type":["string","null"],"description":"Avatar of the first counterpart that has one."},"tag":{"type":["string","null"],"description":"Tvoia's `[TC…]` correlation tag, used to match a sent message back to its chat."},"copyToPlatform":{"type":"boolean","description":"«Копіювати в МШ» — whether messages sent here are also pushed through Moia Shkola. Kept in step with the other participant."},"canDisablePlatformCopy":{"type":"boolean","description":"False when a counterpart has no Tvoia account; the upstream copy is then mandatory and `copyToPlatform` reads true regardless of what is stored. Resolved from the chat's own participants, so it works for chats discovered by a scrape and not only for ones started from the app."}}},"ChatLastMessage":{"type":["object","null"],"properties":{"id":{"type":"string"},"content":{"type":"string"},"senderName":{"type":"string","description":"Recipient's name for a sent message, sender's name for a received one."},"senderAvatar":{"type":["string","null"],"description":"Always null in the list; use `avatarURL` on the chat."},"isSentByUser":{"type":"boolean"},"isRead":{"type":"boolean","description":"Only meaningful on a sent message, where it drives the second tick. True once the recipient has opened it — either in Tvoia or on the school platform."},"syncState":{"type":"string","enum":["pending","synced"]},"sentAt":{"type":"string","format":"date-time"},"attachments":{"type":"array","items":{"$ref":"#/components/schemas/Attachment"}}}},"ChatMessage":{"type":"object","properties":{"id":{"type":"string"},"chatID":{"type":"string"},"senderID":{"type":"string","description":"The sender's *name*, not an id — the platform does not expose stable sender ids."},"senderAvatarURL":{"type":["string","null"],"description":"Only for received messages."},"text":{"type":"string"},"attachments":{"type":"array","items":{"$ref":"#/components/schemas/Attachment"}},"replyToID":{"type":["string","null"],"description":"Id of the message this one answers, in the caller's own store. Null for anything that is not a reply."},"replyTo":{"anyOf":[{"$ref":"#/components/schemas/ReplyPreview"},{"type":"null"}],"description":"Snapshot of the replied-to message, so the quote can be drawn even when that message is not on the loaded page. Null when `replyToID` is null."},"reactions":{"type":"array","items":{"type":"object"},"description":"Reserved; always empty."},"isRead":{"type":"boolean","description":"Only meaningful on a sent message, where it drives the second tick. True once the recipient has opened it — either in Tvoia or on the school platform."},"sentAt":{"type":"string","format":"date-time"},"isSentByUser":{"type":"boolean"},"syncState":{"type":"string","enum":["pending","synced","failed"],"description":"`pending` until a scraper confirms the message reached the platform."}}},"UnreadMessage":{"allOf":[{"$ref":"#/components/schemas/ChatMessage"},{"type":"object","properties":{"chatTitle":{"type":"string","description":"The chat's topic, as `GET /v1/chats` shows it."},"chatTag":{"type":"string","description":"The chat's routing tag (`TCX7Q9`)."}}}],"description":"A `ChatMessage` with its chat attached, from `GET /v1/chats/messages/unread`."},"TodayBriefing":{"type":"object","description":"The day in one payload, from `GET /v1/students/me/today`. Lesson objects are the ones `GET /v1/schedule` returns, plus `isCurrent`.","properties":{"date":{"type":"string","description":"Today, Kyiv calendar day.","format":"date"},"childName":{"type":["string","null"],"description":"Parents: the child's first name. Null for students."},"lessonCount":{"type":"integer"},"firstStart":{"type":["string","null"],"description":"Start of the first lesson; null when there are none.","format":"date-time"},"lastEnd":{"type":["string","null"],"description":"End of the last lesson; null when there are none.","format":"date-time"},"lessons":{"type":"array","items":{"type":"object"},"description":"School and user-created lessons merged, in time order, each with `isCurrent`."},"currentLesson":{"type":["object","null"],"description":"The lesson running now (or starting within a minute), as `/schedule/current-lesson` picks it."},"nextLesson":{"type":["object","null"],"description":"The lesson after that, or the first one still ahead."},"homeworkNext":{"type":"object","description":"What is due on `date`: today until 15:00 Kyiv, then the next school day.","properties":{"date":{"type":"string","format":"date"},"total":{"type":"integer"},"pending":{"type":"integer","description":"Not yet done. Equals `total` when `doneKnown` is false."},"subjects":{"type":"array","items":{"type":"string"},"description":"Subjects with pending tasks."},"doneKnown":{"type":"boolean","description":"False for a parent whose child does not share done marks."}}},"studyMode":{"type":["object","null"],"description":"`{mode: \"online\"|\"offline\"|null, source}` for today; null when study mode is not set up (or, for parents, not shared)."},"text":{"type":"string","description":"One sentence in `lang`, ready to be spoken."}},"example":{"date":"2026-09-21","childName":null,"lessonCount":5,"firstStart":"2026-09-21T05:30:00Z","lastEnd":"2026-09-21T10:45:00Z","lessons":[],"currentLesson":null,"nextLesson":null,"homeworkNext":{"date":"2026-09-22","total":2,"pending":2,"subjects":["Геометрія","Історія"],"doneKnown":true},"studyMode":{"mode":"offline","source":"default"},"text":"Сьогодні 5 уроків, з 08:30 до 13:45 · далі Алгебра о 09:30 · на завтра 2 завдання: Геометрія, Історія"}},"ReplyPreview":{"type":"object","description":"The message a reply refers to. Set by `replyToID` on send for Tvoia-sent replies, and recovered by fuzzy-matching the «<<<<< Вам писав: >>>>>» quote that Moia Shkola's reply form inserts for replies written on the platform.","properties":{"id":{"type":"string"},"senderID":{"type":"string","description":"The sender's name (same convention as `ChatMessage.senderID`)."},"text":{"type":"string","description":"First 300 characters."},"isSentByUser":{"type":"boolean"},"attachmentCount":{"type":"integer"},"attachmentName":{"type":["string","null"],"description":"Name of the first attachment, for a text-less parent."}}},"SendResult":{"type":"object","description":"The message is queued, not yet delivered — poll the chat or wait for the push.","properties":{"status":{"type":"string"},"chatID":{"type":["string","null"]},"chatTag":{"type":["string","null"],"description":"The `[TC…]` tag written into the subject so the reply can be matched back."},"messageID":{"type":["string","null"],"description":"Local message id, already visible in the chat."},"syncState":{"type":"string","enum":["pending","synced"],"description":"`pending` while the platform copy is unconfirmed; `synced` immediately when this chat has the platform copy turned off, since there is nothing to confirm."},"tvoiaMessageID":{"type":["string","null"],"description":"Shared by every per-user copy of this send. Use it to reconcile an optimistic row."},"mirroredTo":{"type":"integer","description":"How many recipients got the message delivered directly, without waiting for their scrape."},"copiedToPlatform":{"type":"boolean","description":"Whether a copy was also sent through Moia Shkola."},"replyToID":{"type":["string","null"],"description":"Echo of the accepted `replyToID`; null if none was sent or it did not belong to this chat."}},"example":{"status":"ok","chatID":"66e1f0a2c4b1a2d3e4f5aaaa","chatTag":"TC7K2Q9","messageID":"66e1f0a2c4b1a2d3e4f5bbbb","syncState":"pending","tvoiaMessageID":"9f2c…","mirroredTo":1,"copiedToPlatform":true}},"PlatformCopyState":{"type":"object","description":"Whether a conversation is also copied through Moia Shkola.","properties":{"chatID":{"type":"string"},"copyToPlatform":{"type":"boolean"},"canDisable":{"type":"boolean","description":"False when a counterpart has no Tvoia account."},"reason":{"type":["string","null"],"description":"Why it cannot be disabled, e.g. `counterpart_not_on_tvoia`."},"syncedToCounterpart":{"type":"integer","description":"PATCH only: how many counterpart copies were updated to match."}},"example":{"chatID":"66e1f0a2c4b1a2d3e4f5aaaa","copyToPlatform":false,"canDisable":true,"reason":null,"syncedToCounterpart":1}},"Grade":{"type":"object","properties":{"id":{"type":"string"},"studentID":{"type":"string"},"subjectID":{"type":"string","description":"Tvoia subject id; `\"\"` when the subject could not be resolved."},"teacherID":{"type":"string","description":"Reserved; currently empty."},"value":{"type":["integer","null"],"description":"Parsed 1–12 grade. Null for non-numeric marks — read `gradeRaw`."},"type":{"type":"string","description":"Platform grade type (systemic or non-systemic)."},"date":{"type":"string","format":"date-time"},"comment":{"type":"string","description":"Reserved; currently empty."},"topic":{"type":"string","description":"Reserved; currently empty."},"lessonID":{"type":["string","null"],"description":"Reserved; always null."},"semester":{"type":"integer","description":"1 or 2, derived from the date."},"gradeColor":{"type":["string","null"],"description":"Colour the platform showed the mark in."},"attendance":{"type":["string","null"],"description":"Attendance mark on the same lesson, e.g. `н`."},"gradeRaw":{"type":["string","null"],"description":"Exactly what the platform displayed, including non-numeric marks."}}},"Homework":{"type":"object","description":"Homework plus Tvoia's task-tracker layer. Platform text is never overwritten — an edit is stored alongside it.","properties":{"id":{"type":"string","description":"Composite `<platformID>_<studentID>`."},"subjectID":{"type":"string"},"teacherID":{"type":"string"},"lessonID":{"type":["string","null"],"description":"Reserved; always null."},"title":{"type":"string","description":"Subject name, which is what the platform titles homework by."},"description":{"type":"string","description":"The user's edit if there is one, else the platform's text with links extracted."},"dueDate":{"type":"string","description":"Effective due date — the user's override when set.","format":"date-time"},"assignedDate":{"type":"string","format":"date-time"},"attachments":{"type":"array","items":{"$ref":"#/components/schemas/Attachment"}},"isDone":{"type":"boolean","description":"Tvoia-only; the platform has no such concept."},"hyperlinks":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"url":{"type":"string"}}}},"reminderDate":{"type":["string","null"],"description":"Local reminder the scheduler pushes.","format":"date-time"},"teacherName":{"type":"string"},"lessonDate":{"type":"string","format":"date-time"},"taskDescription":{"type":"string","description":"The platform's raw text, always unmodified."},"isCustom":{"type":"boolean","description":"Created in Tvoia; has no platform counterpart."},"isEdited":{"type":"boolean"},"originalDescription":{"type":["string","null"],"description":"Platform text, present only when `isEdited`."},"originalDueDate":{"type":["string","null"],"description":"Platform due date, present only when the user moved it.","format":"date-time"},"subjectName":{"type":"string"}}},"Survey":{"type":"object","description":"A platform poll. `questions` and the other detail-only fields appear on the detail endpoint.","properties":{"id":{"type":"string"},"platformID":{"type":"string"},"ordinal":{"type":["integer","null"],"description":"Position in the platform's own list."},"title":{"type":"string"},"author":{"type":["string","null"],"description":"Usually the administration."},"status":{"type":"string","enum":["open","answered","closed","unknown"]},"statusText":{"type":["string","null"],"description":"The platform's own status wording."},"isAnswered":{"type":"boolean"},"canAnswer":{"type":"boolean","description":"Drives the pending badge."},"formCaptured":{"type":"boolean","description":"Whether the HTML form was parsed into `questions`. Answering requires this."},"questionCount":{"type":"integer"},"hasResults":{"type":"boolean"},"firstSeenAt":{"type":["string","null"],"format":"date-time"},"updatedAt":{"type":["string","null"],"format":"date-time"},"answeredAt":{"type":["string","null"],"format":"date-time"},"description":{"type":["string","null"],"description":"Detail only."},"questions":{"type":["array","null"],"description":"Detail only.","items":{"type":"object","properties":{"id":{"type":"string"},"text":{"type":"string"},"kind":{"type":"string","enum":["single","multiple","text"]},"required":{"type":"boolean"},"options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"text":{"type":"string"}}}}}}},"captureError":{"type":["string","null"],"description":"Detail only. Why form capture failed, truncated to 200 chars."},"submittedAnswers":{"type":["object","null"],"description":"Detail only. What this user sent."}}},"SurveyList":{"type":"object","description":"All of the user's surveys, open ones first. Empty while the feature gate is closed.","properties":{"surveys":{"type":"array","items":{"$ref":"#/components/schemas/Survey"}},"pendingCount":{"type":"integer","description":"How many are answerable — the app's badge count."},"lastScrapedAt":{"type":["string","null"],"description":"When the survey list was last pulled from the platform.","format":"date-time"}},"example":{"surveys":[],"pendingCount":0,"lastScrapedAt":null}},"AgentModel":{"type":"object","description":"One downloadable on-device model. RAM is not filtered server-side: the app greys out what it cannot run.","properties":{"id":{"type":"string","description":"Stable model id, e.g. `dykan-e4b`."},"version":{"type":"string","description":"Immutable build of the weights; new weights mean a new version."},"displayName":{"type":"string","description":"Name for the model picker."},"description":{"type":"string","description":"One line in the requested language."},"capabilities":{"type":"array","items":{"type":"string"},"description":"Extra inputs besides text, e.g. `vision`."},"minRamGB":{"type":"number","description":"Smallest physical RAM the model runs on."},"minOSVersion":{"type":"string","description":"Lowest iOS version, e.g. `17.0`."},"totalSize":{"type":"integer","description":"Sum of all file sizes in bytes."},"files":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","description":"File name inside the model directory."},"size":{"type":"integer"},"sha256":{"type":"string","description":"Hex digest of the whole file."},"url":{"type":"string","description":"Presigned download URL; supports `Range`."}}}},"urlsExpireAt":{"type":"string","description":"When the file URLs stop working.","format":"date-time"}},"example":{"id":"dykan-e4b","version":"2026.11.15","displayName":"Dykan 4B","description":"Найрозумніша модель, для iPhone з 8 ГБ пам'яті","capabilities":["vision"],"minRamGB":7.5,"minOSVersion":"17.0","totalSize":4500000000,"files":[{"path":"config.json","size":6208,"sha256":"0000000000000000000000000000000000000000000000000000000000000000","url":"https://s3.eu-central-003.backblazeb2.com/..."}],"urlsExpireAt":"2026-11-22T12:00:00Z"}},"AgentModelList":{"type":"object","description":"Models this app build may download.","properties":{"models":{"type":"array","items":{"$ref":"#/components/schemas/AgentModel"}},"modelName":{"type":"string","description":"Name of the model family for the app's copy (\"runs on Dykan\"); renamable without an app release."},"modelURL":{"type":"string","description":"Where the app's \"model on GitHub\" link points."}},"example":{"models":[],"modelName":"Dykan","modelURL":"https://github.com/rntdev1/dykan"}}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}},"tags":[{"name":"Auth","description":"Registration, login, logout and account deletion.\n\n`POST /register` and `POST /login` both take the user's *school platform*\ncredentials: Tvoia stores them encrypted and replays them from the scrapers,\nwhich is why a password reset has to go through here rather than the school\nsite. Login returns the bearer token every other endpoint needs."},{"name":"Students","description":"The signed-in student's own profile, privacy switch, and classmates.\n\n`GET /me` is the canonical profile call the app makes on launch — it merges\nthe mobile and web platform accounts with the Tvoia account (avatar,\nusername, locale) into one object."},{"name":"People","description":"Public profiles for anyone reachable through the platform — teachers,\nadministration, classmates, parents, the librarian — merged with the Tvoia\naccounts that could be matched to them.\n\nPerson ids are `p<platformID>_<receiverType>` (e.g. `p277838_9`); you get\nthem from chat participants and recipient search, never by constructing them.\nBacked by a Meilisearch index that the scheduler rebuilds hourly, with a\nMongoDB fallback while the index is cold.\n\n**Privacy applies here**: a person with privacy mode on is reduced to avatar\nand name."},{"name":"Chats","description":"The platform's messaging module: conversations, messages, and picking who to\nwrite to.\n\nSending is genuinely asynchronous. `POST /send` writes a local message with\n`syncState: \"pending\"` and hands the real submission to a scraper; the\nmessage flips to `synced` once the platform confirms it, or `failed` if it\ndoes not. Clients should render pending messages optimistically.\n\n`GET /recipients/search` is typo-tolerant (Meilisearch) and returns both the\nlegacy fields and the newer person fields — see the endpoint for the full\nlist."},{"name":"Surveys","description":"Platform polls («Опитування») published by the school administration, such as\nthe school-president vote.\n\nThe scraper captures each survey's HTML form so answers can be replayed as a\nform POST; `formCaptured` tells you whether that succeeded, and detail\nrequests capture on demand if it has not. **Currently gated** — see *Feature\ngates* in the overview."},{"name":"Schedule","description":"Timetable, the current/next lesson, per-room overrides, user-created lessons,\nand study mode.\n\n`GET /current-lesson` is what drives the app's Live Activity, so it is\ntime-sensitive and computed rather than cached. Study mode lets a student\nmark which days they attend in person versus remotely."},{"name":"Grades","description":"Diary grades, filters for the grade list, and yearly/final grades.\n\nUkrainian grades are 1–12 integers but the platform also stores\nnon-numeric marks (`н` for absent, `зв` for excused). `value` is the parsed\ninteger where one exists and `gradeRaw` preserves exactly what the platform\nshowed."},{"name":"Homework","description":"Homework from the platform plus Tvoia's own task-tracker layer on top.\n\nA student can tick items done, rewrite a description, move a due date, attach\na reminder, or add homework the platform never had (`isCustom`). Edits never\ndestroy the original: `isEdited`, `originalDescription` and `originalDueDate`\nexpose the platform's version, and `DELETE /{id}/edits` reverts to it."},{"name":"Attendance","description":"Attendance records and an aggregate rate, derived from the diary's attendance marks."},{"name":"Analytics","description":"Aggregations over the signed-in student's own grades — summary, trend over\ntime, breakdown by subject and by grade type, and a calendar heatmap.\n\nAll computed from the cached diary; nothing here leaves the student's own\ndata."},{"name":"Leaderboard","description":"Class and school rankings by average grade, with the periods and subjects\navailable as filters.\n\nRespects `hideNameOnLeaderboard`: an opted-out student still appears with\ntheir position and average but without their name or avatar."},{"name":"Subjects","description":"The student's subjects, with Tvoia's translated names and assigned colours."},{"name":"Teachers","description":"Teachers seen across the student's lessons, grades and homework."},{"name":"Remarks","description":"Teacher remarks and commendations («Зауваження») from the platform."},{"name":"Events","description":"School calendar events, plus the next upcoming one."},{"name":"Library","description":"Tvoia's own e-book library: a catalogue of Ukrainian textbooks and reading-list\ntitles, the student's shelf, reading progress, and bookmarks.\n\nBooks are stored as PDF and EPUB in S3 and served through short-lived signed\ndownload URLs; the catalogue is searched through Meilisearch."},{"name":"Notifications","description":"The in-app notification feed and read receipts. Delivery itself goes through APNs — see *Push*."},{"name":"Push","description":"Device registration (APNs on iOS, FCM on Android) and notification preferences.\n\nThree token kinds are tracked per iOS device: the ordinary device token, a\nLive Activity *push-to-start* token, and a per-activity update token. A\ndevice may legitimately re-register the same token, so all of these are\nidempotent upserts.\n\nAndroid registers its FCM token on the same `POST /push/apns/device` with\n`\"platform\": \"android\"`; preferences, locale and logout are shared. Android\nreceives data-only messages: alerts carry `title`, `body` and the same keys as\nthe iOS payload, and the lesson Live Activity arrives as `type: live_activity`\nmessages (`event` start/update/end, `lessonId`, JSON `attributes` and\n`contentState`) for an ongoing notification. No Live Activity tokens are\nneeded on Android."},{"name":"Status","description":"A user-set status («що зараз робиш»), and the app-release block the client\nchecks on launch for update prompts.\n\n`GET /release` is what drives the in-app \"please update\" sheet."},{"name":"Search","description":"One cross-cutting search over the student's homework, grades, chats and events."},{"name":"Weather","description":"Local weather for the school's city, used by the app's home screen."},{"name":"Web","description":"Tvoia Web: pairing a browser with the phone, and the workspace's own\nhelpers (`/bootstrap`, `/layout`).\n\nThe pairing is a device-authorisation flow. The browser creates a pairing\n(`POST /pair`) and shows the code and QR, then long-polls\n(`POST /pair/{id}/poll`) with its private `pollSecret`. The phone claims the\ncode (`POST /pair/claim`, typed code or the QR's `approveSecret`), sees where\nthe request came from and the duration options, and approves\n(`POST /pair/{id}/approve`) or denies. The browser then exchanges its\nsecret for the web token (`POST /pair/{id}/token`), once. The phone-side\ncalls need an **app** token; a web token gets `403 web_token_not_allowed`.\nThe whole flow can be switched off with `WEB_PAIRING_ENABLED`\n(`503 web_pairing_disabled`)."},{"name":"Clipboard","description":"One pasteboard for every device signed in to the account: the phone app and\neach Tvoia Web session read and write the same list of items (text, links,\nfiles), and every change is pushed to the others over the event stream.\n\nFiles go through the same storage and per-account quota as chat\nattachments (`/chats/upload-limits`) and are served from `tvoia.link`.\nUnpinned items expire after `retentionDays` (demo accounts: two hours);\npinned ones stay. The list is capped at `maxItems`; past that the oldest\nunpinned item gives way, and when everything is pinned a write gets\n`409 clip_full`. Deleting leaves a tombstone for a week so a client coming\nback can sync with `?since=`."},{"name":"Notes","description":"Твої Нотатки: Apple Notes style pages (Notion like blocks with inline\nmarkdown, checklists, tables, images, live Tvoia blocks) and Excalidraw\nboards, synced between the phone and every Tvoia Web session. The format,\nmerge rules and order keys are in `docs/notes-format.md`.\n\nWrites are op batches (`POST /notes/{id}/ops`) merged per block by\n`(rev, revNonce)` and per board element by `(version, versionNonce)`, so\noffline edits from several devices converge. A retried batch is recognised\nby its `batchId`. Lists sync with `?since=` like the clipboard.\n\nNotes replaced the clipboard in new builds. The first `GET /notes` copies\nthe account's clips into notes (folder `system: \"clipboard\"`); after that a\nclip written by an older build is also copied into a note, and a web quick\ncapture (`capture: true`) is also written as a clip, so builds without\nNotes keep a working Буфер. Note files are private by default (no public\nlink); a note the owner shares (`POST /notes/{id}/share`) is frozen as a\nread-only page at `tvoia.link/n/<key>`, and its images get their own public\nlinks for as long as the share lives."},{"name":"Calendar","description":"Calendar subscriptions: a secret `.ics` URL that Apple Calendar, Google\nCalendar or Outlook subscribe to, with lessons (official and the user's own),\nhomework due dates, tests (placed at their lesson when the timetable has\none), holidays, parent meetings, study mode days and, opt-in, classmates'\nbirthdays. Parents get one feed per child.\n\nThe feed reads stored data only and never reaches the school platform. Its\nURL carries the only credential (no bearer token): rotating the feed issues\na new URL and the old one answers 404, as does a deleted feed. Feed text is\nin the account's language at fetch time."},{"name":"Agent","description":"Models for Твій Агент, the assistant that runs on the phone.\n\nThe app downloads a model once and runs it locally, so the assistant works\noffline and nothing the student asks leaves the device. This tag only hands\nout the weights: each file is a presigned download URL valid for 7 days\n(`urlsExpireAt`). A version's files never change, so a client whose URLs\nexpired mid-download fetches the list again and resumes where it stopped,\nchecking each file against its `sha256`."},{"name":"Wrapped","description":"Tvoia Wrapped: a student's semester as a deck of slides.\n\nThe server decides what is shown and writes every word of it: a slide is\neither in the deck, already localised, or it is absent. Nothing unflattering\nis ever sent, so a client renders what it gets and never filters. Students\nonly; parent accounts get `status: \"unavailable\"`."},{"name":"Files","description":"Public, unauthenticated resolution of short file keys to signed download\nURLs.\n\nThese are the only endpoints with no bearer token, so that an attachment link\ncan be opened outside the app. Keys are unguessable and the URLs they return\nare short-lived."}],"servers":[{"url":"https://api.tvoia.app","description":"Production"}]}