{"openapi":"3.1.0","info":{"title":"Spar","description":"Production HTTP API for the Spar thinking-partner orchestrator.","version":"0.1.0"},"paths":{"/health":{"get":{"tags":["meta"],"summary":"Health","description":"Liveness, plus whether safeguarding is actually configured.\n\n`status` stays \"ok\" whenever the service can serve traffic — Render's\nhealth check reads it, and taking the deployment down because safeguarding\nis misconfigured would strand every student to protect one. The\nsafeguarding block is reported separately so the answer to \"is detection\nrecording anything?\" is one request away instead of a log search.\n\nKeys only, never values.","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Health Health Get"}}}}}}},"/students/me":{"get":{"tags":["students"],"summary":"Get Me","description":"The signed-in student's own profile, resolved from the X-Spar-Student\ncapability token alone.\n\nThis exists so a refresh doesn't sign a student out. Everything else\nunder /students is admin-gated, which meant the app's rehydration\neffect had no endpoint it could actually call — see\nmigrations/versions/0058_student_public_token.py.\n\nReturns StudentRead, which omits both the login `code` and the\ncapability token itself; the token is handed out once, at login.\n\nThat first clause was false when written and is true now. StudentRead\ncarried `code` — a working credential — and this docstring asserted the\nopposite, which is the most likely reason nobody checked the routes that\nreturned the model. A comment is not a control.","operationId":"get_me_students_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StudentRead"}}}}}}},"/students/me/hold":{"get":{"tags":["students"],"summary":"Get My Hold","description":"Whether the signed-in student's work is paused, and whether their school\nis open right now.\n\nThe paused panel asks this so it can tell a student the truth about the\nhour: during the school day, that their counselor has been told; outside\nit, that school is closed, who to reach now, and which day somebody will\nfollow up.\n\nThe school is the one stamped on the incident at detection, falling back\nto the student's own, and the clock is THAT SCHOOL'S and nobody else's.\nA school with no timezone saved answers `after_hours: null`: the hour is\nunknown, and the panel then shows wording that is true at any hour. There\nis no `tz` parameter. There was one, carrying the student's browser zone\nas a fallback, and it told a student on a laptop set to Tokyo that school\nwas closed on Tokyo's clock. A `tz` sent by an older page is ignored.\n\nIt also carries what the school's counselor has set for that hour: a lead\nsentence and the people to reach (spar/safeguarding/messaging.py). With the\nhour unknown that is no lead of the school's and every one of its\ncontacts. Still nothing about the incident — no tier, category, rationale\nor time.","operationId":"get_my_hold_students_me_hold_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StudentHoldRead"}}}}}}},"/students/{student_id}/assignments":{"get":{"tags":["students"],"summary":"List My Assignments","description":"The assignments this student should see — their lobby's source list.\n\nThe student surfaces used to read `GET /assignments?student_id=N`, on the\nteacher-gated assignments router, which a real student's browser gets a\n403 from. Worse, the callers that only needed titles for their own\nsessions passed no student_id at all and asked for EVERY assignment in\nthe system — a teacher-scoped read the student portal has no business\nmaking. This is the scoped replacement: same filtering as that endpoint\n(see spar/api/assignments.py), reachable by the student it describes.","operationId":"list_my_assignments_students__student_id__assignments_get","parameters":[{"name":"student_id","in":"path","required":true,"schema":{"type":"integer","title":"Student Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AssignmentRead"},"title":"Response List My Assignments Students  Student Id  Assignments Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/students/{student_id}/assignments/{assignment_id}":{"get":{"tags":["students"],"summary":"Get My Assignment","description":"One assignment, if this student is allowed to see it.\n\nBacks a cold load of `/student/assignment/:id` — a refresh or a shared\nlink, where the Lobby card that would have carried the row in memory\nnever existed. The obvious call, `GET /assignments/{id}`, is on the\nteacher-gated router, so a rostered student's browser gets a 403 and the\nintro page renders an error instead of the assignment.\n\nScoped through the same visibility filter as the list endpoint, and\n404s (not 403s) when the assignment exists but isn't this student's —\na 403 would confirm the id is real, which is a free enumeration oracle\nover every assignment in the deployment.","operationId":"get_my_assignment_students__student_id__assignments__assignment_id__get","parameters":[{"name":"student_id","in":"path","required":true,"schema":{"type":"integer","title":"Student Id"}},{"name":"assignment_id","in":"path","required":true,"schema":{"type":"integer","title":"Assignment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignmentRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/students/{student_id}/preferences":{"patch":{"tags":["students"],"summary":"Update Preferences","operationId":"update_preferences_students__student_id__preferences_patch","parameters":[{"name":"student_id","in":"path","required":true,"schema":{"type":"integer","title":"Student Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StudentPreferencesUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StudentRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/students/{student_id}/intro-seen":{"post":{"tags":["students"],"summary":"Mark Intro Seen","description":"Record that the introduction has been shown, so it is shown once.\n\nA stamp is never moved once set: this is called again by \"show me around\nagain\", and the first time is the one worth keeping.","operationId":"mark_intro_seen_students__student_id__intro_seen_post","parameters":[{"name":"student_id","in":"path","required":true,"schema":{"type":"integer","title":"Student Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntroSeen"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StudentRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/students/{student_id}/sessions":{"get":{"tags":["students"],"summary":"List Student Sessions","operationId":"list_student_sessions_students__student_id__sessions_get","parameters":[{"name":"student_id","in":"path","required":true,"schema":{"type":"integer","title":"Student Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/StudentSessionListItem"},"title":"Response List Student Sessions Students  Student Id  Sessions Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/students/{student_id}/essays":{"get":{"tags":["students"],"summary":"List Student Essays","description":"My Essays page (PR 5).\n\nSorted by due_date ascending (nulls last), then by updated_at desc.\nEach row includes carry-forward \"Spar's recommendations\" from the\nin-composition observations and completed editorial dialogue moves.","operationId":"list_student_essays_students__student_id__essays_get","parameters":[{"name":"student_id","in":"path","required":true,"schema":{"type":"integer","title":"Student Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/StudentEssayListItem"},"title":"Response List Student Essays Students  Student Id  Essays Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/students":{"get":{"tags":["students"],"summary":"List Students","description":"All students — the registrar's cross-school list, with identity keys\n(sis_id/email) that StudentRead hides. Admin-gated (router dependency).","operationId":"list_students_students_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/StudentAdminRead"},"type":"array","title":"Response List Students Students Get"}}}}}},"post":{"tags":["students"],"summary":"Create Student","operationId":"create_student_students_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StudentCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StudentRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/students/by-code/{code}":{"get":{"tags":["students"],"summary":"Get Student By Code","operationId":"get_student_by_code_students_by_code__code__get","parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string","title":"Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StudentRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/students/{student_id}":{"get":{"tags":["students"],"summary":"Get Student","operationId":"get_student_students__student_id__get","parameters":[{"name":"student_id","in":"path","required":true,"schema":{"type":"integer","title":"Student Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StudentRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["students"],"summary":"Update Student","description":"Registrar edit of a student's identity fields (name, code, sis_id,\nemail, grade, age). Only provided fields change. Rejects a value that\nwould collide with another student's unique code/sis_id/email (409).","operationId":"update_student_students__student_id__patch","parameters":[{"name":"student_id","in":"path","required":true,"schema":{"type":"integer","title":"Student Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StudentPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StudentAdminRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/students/{student_id}/work-summary":{"get":{"tags":["students"],"summary":"Get Student Work Summary","description":"Per-mode counts of a student's cached work (admin Clear panel).","operationId":"get_student_work_summary_students__student_id__work_summary_get","parameters":[{"name":"student_id","in":"path","required":true,"schema":{"type":"integer","title":"Student Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/StudentWorkSummaryItem"},"title":"Response Get Student Work Summary Students  Student Id  Work Summary Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/students/{student_id}/work":{"delete":{"tags":["students"],"summary":"Clear Student Work","description":"Wipe a student's sessions + essays. `mode` omitted => clear everything.\nReal admin only; assignment rows are never deleted.","operationId":"clear_student_work_students__student_id__work_delete","parameters":[{"name":"student_id","in":"path","required":true,"schema":{"type":"integer","title":"Student Id"}},{"name":"mode","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mode"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StudentWorkClearResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/students/{student_id}/disclosure/acknowledge":{"post":{"tags":["disclosure"],"summary":"Acknowledge Disclosure","description":"The student confirms they have read the disclosure, on their home\nscreen. Recorded once per account; refused without `acknowledged`.","operationId":"acknowledge_disclosure_students__student_id__disclosure_acknowledge_post","parameters":[{"name":"student_id","in":"path","required":true,"schema":{"type":"integer","title":"Student Id"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DisclosureAcknowledgement","default":{"acknowledged":false}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StudentRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/assignments":{"get":{"tags":["assignments"],"summary":"List Assignments","description":"The caller's assignments, or -- when `student_id` is given -- the ones\nthat student should see in their lobby: assignments in their enrolled\nclassrooms plus legacy globals (classroom_id IS NULL). See spar/roster.py.\n\nBoth halves were unscoped. With no `student_id` this returned EVERY\nassignment in the deployment; with one, any named student's lobby, and\nstudent ids are sequential integers. Now:\n\n  * `student_id` given -- `authorize_student_access`, the same subject\n    check the other per-student reads take.\n  * omitted -- narrowed to the acting teacher, with the same parameters\n    `list_teacher_assignments` uses, off the same deployment policy. The\n    width of that narrowing is one question for both routes rather than\n    two, which matters because the policy flag is about to change.","operationId":"list_assignments_assignments_get","parameters":[{"name":"student_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Student Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AssignmentRead"},"title":"Response List Assignments Assignments Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["assignments"],"summary":"Create Assignment","operationId":"create_assignment_assignments_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignmentCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignmentRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/assignments/{assignment_id}/targets":{"get":{"tags":["assignments"],"summary":"Get Assignment Targets","description":"The resolved per-student targets for an assignment, each with the\nstudent's effective due date. Empty for a whole-class assignment.\n\nEvery row carries `student_name`, so unscoped this answered \"name the\nchildren in another school's class\" for any assignment id. The PUT\ndirectly below was given a write check; this GET was left on the\nrouter-level gate.","operationId":"get_assignment_targets_assignments__assignment_id__targets_get","parameters":[{"name":"assignment_id","in":"path","required":true,"schema":{"type":"integer","title":"Assignment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AssignmentTargetRead"},"title":"Response Get Assignment Targets Assignments  Assignment Id  Targets Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["assignments"],"summary":"Set Assignment Targets","description":"Replace-all targeting: 'class_all' clears per-student rows (whole-class\nvisibility via classroom_id); 'subset'/'cross_class' name the students;\n'school_all' reaches every student in the school and is an admin act.","operationId":"set_assignment_targets_assignments__assignment_id__targets_put","parameters":[{"name":"assignment_id","in":"path","required":true,"schema":{"type":"integer","title":"Assignment Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignmentTargetsWrite"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AssignmentTargetRead"},"title":"Response Set Assignment Targets Assignments  Assignment Id  Targets Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/assignments/{assignment_id}":{"get":{"tags":["assignments"],"summary":"Get Assignment","description":"One assignment in full -- its prompt, its framing, its configuration.\n\nA teacher's instructional design, readable by any signed-in teacher at any\nschool by walking the integers. 404 rather than 403, so the walk learns\nnothing about which ids exist.","operationId":"get_assignment_assignments__assignment_id__get","parameters":[{"name":"assignment_id","in":"path","required":true,"schema":{"type":"integer","title":"Assignment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignmentRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["assignments"],"summary":"Delete Assignment","description":"Delete an assignment. Real-admin or teacher only (the gate excludes the\ndemo-portal presenter token).\n\nA genuine DB delete that PERSISTS, for either auth. Blocks, targets,\nprogress, summaries, groups and CKL documents cascade away; the student's\nown work (sessions, essays) is DETACHED, not destroyed.\n\nThe three detach/clear statements below are deliberate rather than left to\nthe database. The ORM models declare ondelete on these FKs, but tables\ncreated before those clauses were added still carry NO ACTION, and SQLite\ncannot ALTER a constraint — so on any pre-existing database the delete hit\n`FOREIGN KEY constraint failed` and returned a 500. Doing it here behaves\nidentically on SQLite and Postgres, and on old databases and new.\n\nA teacher delete used to be a process-memory hide that reappeared on the\nnext restart, on the theory that the teacher token is a shared demo login.\nNow that assignments survive restarts, a \"delete\" that un-deletes is worse\nthan none at all — for someone authoring real work it has to mean deleted.","operationId":"delete_assignment_assignments__assignment_id__delete","parameters":[{"name":"assignment_id","in":"path","required":true,"schema":{"type":"integer","title":"Assignment Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["assignments"],"summary":"Update Assignment","description":"Edit an assignment. Real-admin or teacher only (presenter gets 403).\n\nA persisted DB write for either auth. Only fields present in the request\nbody change. Edits apply to NEW sessions; in-flight sessions keep their\nfrozen config.\n\nA teacher edit used to be an in-memory overlay that was re-applied on read\nwith the row detached so it could never flush — the edit looked saved and\nwas gone on the next restart. Teacher authoring is real work now, so it\nwrites to the DB like any other.","operationId":"update_assignment_assignments__assignment_id__patch","parameters":[{"name":"assignment_id","in":"path","required":true,"schema":{"type":"integer","title":"Assignment Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignmentUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignmentRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/assignments/{assignment_id}/archive":{"post":{"tags":["assignments"],"summary":"Archive Assignment","description":"Put it away. Visible to the teacher, gone from the students' pages.\n\nARCHIVE AND CLOSE ARE ORTHOGONAL, which is why this is its own route and\nnot a flag on the other. Closing stops the intake and leaves the work on\nthe student's page; archiving takes it off their page entirely and leaves\nthe teacher's copy intact. Closing is what a teacher does on Friday;\narchiving is what they do in January.\n\nARCHIVE AND DELETE ARE ALSO DIFFERENT, and both are kept. Archive is the\npressure valve for a list that only grows -- without it teachers delete to\ntidy up, which is the behaviour the status column was added to prevent.\nDelete stays for the other case, a row created by mistake, and even that\ndetaches student work rather than destroying it.\n\nNothing is recomputed: `scope_assignments_for_student` already shows an\narchived assignment to nobody, so this is the whole of the student-side\neffect.","operationId":"archive_assignment_assignments__assignment_id__archive_post","parameters":[{"name":"assignment_id","in":"path","required":true,"schema":{"type":"integer","title":"Assignment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignmentRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/assignments/{assignment_id}/restore":{"post":{"tags":["assignments"],"summary":"Restore Assignment","description":"Back onto the students' pages.\n\nRestores to `active`, never to `draft`: a draft is work whose author has\nnot decided to publish it, and something that has already been sent cannot\nreturn to never having been sent. Whether it is taking submissions is a\nseparate question that `closed_at` and the deadline answer, untouched here.","operationId":"restore_assignment_assignments__assignment_id__restore_post","parameters":[{"name":"assignment_id","in":"path","required":true,"schema":{"type":"integer","title":"Assignment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignmentRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/assignments/{assignment_id}/close":{"post":{"tags":["assignments"],"summary":"Close Assignment","description":"Pencils down, before the deadline.\n\nStops the intake and nothing else. The assignment stays on the student's\npage, their submitted work stays readable, and the teacher still marks it\n-- which is what separates this from archiving, where the work comes off\ntheir page entirely.\n\nIdempotent: closing something already closed keeps the first timestamp,\nbecause the question a teacher is asking is \"is it shut\", not \"shut it\nagain\", and moving the time on a second press would silently rewrite when\nthe class was actually stopped.","operationId":"close_assignment_assignments__assignment_id__close_post","parameters":[{"name":"assignment_id","in":"path","required":true,"schema":{"type":"integer","title":"Assignment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignmentRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/assignments/{assignment_id}/reopen":{"post":{"tags":["assignments"],"summary":"Reopen Assignment","description":"Let students hand in again.\n\nClearing `closed_at` is not enough on its own. If the deadline has also\npassed, the assignment would still be closed by derivation the moment it\nreopened -- and worse, a student looking at it would see a due date in the\npast on something they are being told is open. So reopening past a dead\ndeadline REQUIRES a new one, and says so rather than silently doing\nnothing.","operationId":"reopen_assignment_assignments__assignment_id__reopen_post","parameters":[{"name":"assignment_id","in":"path","required":true,"schema":{"type":"integer","title":"Assignment Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloseAssignment"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignmentRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/assignments/{assignment_id}/ckl":{"post":{"tags":["assignments"],"summary":"Upload Ckl Document","description":"Attach a source document to an assignment and kick off the async tree build.\n\nMultipart upload (not JSON) so page structure survives to the backend. Parsing\nand the ~95s PageIndex build run in the worker; this returns 202 with a\n`pending` document the teacher UI polls via GET. `assignment_id` is the\nsource↔assignment link and the source-presence gate.\n\nPDF, Word, PowerPoint, ODT, EPUB and plain text are all accepted — the Material\nstep has always said \"a poem, a chapter, your slides\" and used to take PDF\nonly, so most teachers had to go and convert their own handout first. What a\nfile's format decides is not whether it is allowed but how Spar may CITE it:\nanything whose pagination is its own earns page citations, and anything we had\nto lay out ourselves degrades to section anchors. That call is made in\nspar/ckl/extract.normalize, in the worker — the raw bytes are stored as\nuploaded, because converting in the web process is exactly the work that\nOOM-killed this instance before.","operationId":"upload_ckl_document_assignments__assignment_id__ckl_post","parameters":[{"name":"assignment_id","in":"path","required":true,"schema":{"type":"integer","title":"Assignment Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_ckl_document_assignments__assignment_id__ckl_post"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CKLDocumentRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["assignments"],"summary":"Get Ckl Document","description":"Latest CKL document for the assignment, or null if none attached.\n\nThe teacher UI polls this to watch the build status (pending → ready/failed).\n\nScoped like `/ckl/documents` below, which was hardened with a docstring\nexplaining why and left this neighbour on the router gate. Same payload:\nanother school's course material, its filenames, authors, central claims\nand the teacher's own framing.","operationId":"get_ckl_document_assignments__assignment_id__ckl_get","parameters":[{"name":"assignment_id","in":"path","required":true,"schema":{"type":"integer","title":"Assignment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/CKLDocumentRead"},{"type":"null"}],"title":"Response Get Ckl Document Assignments  Assignment Id  Ckl Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/assignments/{assignment_id}/ckl/{document_id}/confirm":{"post":{"tags":["assignments"],"summary":"Confirm Ckl Document","description":"The teacher says a held source is curriculum: it goes into the build\nqueue as an ordinary `pending` upload. Who said so and when is kept on the\nrow and in the audit log. The outbound guard still redacts any known\nidentifier in it on the way to the build's model calls.\n\nReplacing a held source is deleting it (the DELETE above) and uploading\nagain, which is screened again.","operationId":"confirm_ckl_document_assignments__assignment_id__ckl__document_id__confirm_post","parameters":[{"name":"assignment_id","in":"path","required":true,"schema":{"type":"integer","title":"Assignment Id"}},{"name":"document_id","in":"path","required":true,"schema":{"type":"integer","title":"Document Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CKLDocumentRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/assignments/{assignment_id}/ckl/documents":{"get":{"tags":["assignments"],"summary":"List Ckl Documents","description":"Every source this assignment uses, oldest-first (matching the \"Source 1/2…\"\norder used in retrieval).\n\nScoped with `authorize_assignment_read`, the subject check introduced for the\ncross-student reads: the router-level gate proves the caller is *a* teacher and\nnothing more, and assignment ids are sequential integers. What this returns is\nanother school's course material — filenames, authors, central claims, and the\nteacher's own instructional framing — and this change widened it to include\ntheir reusable Course Library sources too, so an unscoped read got broader at\nexactly the wrong moment.\n\nINHERITED Course Library sources are included, flagged `is_inherited`, and\nreported with THIS assignment's role and framing. They used to be filtered out\nby the `assignment_id` match, which left them invisible in the panel's source\nlist while still being injected into every session — so the one kind of source\nwhose role and framing were most likely to be wrong was also the only kind a\nteacher could not see or correct.\n\nPending/failed uploads are still shown (the teacher needs to clear them), but\nan inherited document only reaches a session when `ready`, which is what\n`documents_for_assignment` enforces.","operationId":"list_ckl_documents_assignments__assignment_id__ckl_documents_get","parameters":[{"name":"assignment_id","in":"path","required":true,"schema":{"type":"integer","title":"Assignment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CKLDocumentRead"},"title":"Response List Ckl Documents Assignments  Assignment Id  Ckl Documents Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/assignments/{assignment_id}/ckl/{document_id}":{"patch":{"tags":["assignments"],"summary":"Update Ckl Document","description":"Edit one attached source: its role, the teacher's framing, and a\ncorrection to the extracted author / central claim. Owning teacher or admin.\n\nOnly fields PRESENT in the body are written — `model_fields_set`, not\n`exclude_unset` on a dump, because an explicit null has to stay\ndistinguishable from an absent key or clearing a note would be\nindistinguishable from leaving it alone.\n\nA teacher writing author or central_claim stamps `intel_origin='teacher'`,\nwhich is what makes the correction survive: the extractor refuses to\noverwrite teacher-owned intel on a rebuild. Editing only the note or the role\nleaves the stamp alone, so correcting a typo in the framing does not quietly\nfreeze the extractor out of fields it still owns.","operationId":"update_ckl_document_assignments__assignment_id__ckl__document_id__patch","parameters":[{"name":"assignment_id","in":"path","required":true,"schema":{"type":"integer","title":"Assignment Id"}},{"name":"document_id","in":"path","required":true,"schema":{"type":"integer","title":"Document Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CKLDocumentUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CKLDocumentRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["assignments"],"summary":"Delete Ckl Document","description":"Remove one source from this assignment. The OWNING teacher or a real admin;\nthe demo-portal presenter token is excluded by the gate.\n\nAn assignment's OWN upload is deleted and its tree nodes cascade. An INHERITED\nCourse Library source is only DETACHED — see below. Safe for in-flight sessions\neither way: a session's frozen document id list simply skips a document it can\nno longer resolve at render time.\n\nThis was real-admin-only, on the reasoning that a source is a real asset and\neach add costs a ~90s build, so removal deserved the stricter gate. That got\nit backwards in the case that actually happens: the upload a teacher most\nneeds to remove is the one that FAILED, or the wrong file they just dropped,\nand needing an admin to clear it left the panel showing a dead row the\nteacher could not act on. Ownership, not elevation, is the right gate — same\n`require_assignment_write` + `authorize_assignment_write` pairing as\n`delete_assignment`, so another school's teacher still cannot reach it.","operationId":"delete_ckl_document_assignments__assignment_id__ckl__document_id__delete","parameters":[{"name":"assignment_id","in":"path","required":true,"schema":{"type":"integer","title":"Assignment Id"}},{"name":"document_id","in":"path","required":true,"schema":{"type":"integer","title":"Document Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/assignments/{assignment_id}/summaries":{"get":{"tags":["assignments"],"summary":"List Assignment Summaries","description":"Every student's thinking summary for this assignment.\n\nThe same payload class as `/insights` below, and more exposing: the insight\nis an aggregate, these are the individual summaries in the students' own\nterms. `/insights` was given `authorize_assignment_read`; this route, a few\nlines above it, was not -- so the narrowing that protected the aggregate\nleft the source material open to any signed-in teacher, by sequential\ninteger id, across schools.\n\n`tests/test_student_evidence_scoping.py` enumerates the five routes fixed\nin that pass. This was not one of them, which is how it stayed open.","operationId":"list_assignment_summaries_assignments__assignment_id__summaries_get","parameters":[{"name":"assignment_id","in":"path","required":true,"schema":{"type":"integer","title":"Assignment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SummaryRead"},"title":"Response List Assignment Summaries Assignments  Assignment Id  Summaries Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/assignments/{assignment_id}/insights":{"get":{"tags":["assignments"],"summary":"Assignment Class Insights","description":"LLM-aggregated cross-student patterns for a single assignment.\n\nCached: the result is keyed on the set of closed-session ids that\ncontributed to the aggregation. A new closed session changes the set,\ninvalidates the cache, and triggers regeneration on next read. Pass\n`?refresh=true` to force regeneration (used by the teacher dashboard's\n\"regenerate\" affordance).\n\nThe subject check is the assignment's own, not the router's: being *a*\nteacher was never enough to read what a whole class thought.","operationId":"assignment_class_insights_assignments__assignment_id__insights_get","parameters":[{"name":"assignment_id","in":"path","required":true,"schema":{"type":"integer","title":"Assignment Id"}},{"name":"refresh","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Refresh"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignmentClassInsights"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/assignments/{assignment_id}/overrides":{"get":{"tags":["assignments"],"summary":"List Overrides","description":"Every student on this assignment who has been given something extra.","operationId":"list_overrides_assignments__assignment_id__overrides_get","parameters":[{"name":"assignment_id","in":"path","required":true,"schema":{"type":"integer","title":"Assignment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/assignments/{assignment_id}/overrides/{student_id}":{"put":{"tags":["assignments"],"summary":"Set Override","description":"Give one student a later due date and/or extra Braindump time.\n\nThe teacher's own assignment, and a student it actually reaches. Extra\ntime applies to any Braindump the student has not started yet, including\none in a session already open (services.hydrate_state_machine). Sending\nnothing to keep clears the override.","operationId":"set_override_assignments__assignment_id__overrides__student_id__put","parameters":[{"name":"assignment_id","in":"path","required":true,"schema":{"type":"integer","title":"Assignment Id"}},{"name":"student_id","in":"path","required":true,"schema":{"type":"integer","title":"Student Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["assignments"],"summary":"Clear Override","operationId":"clear_override_assignments__assignment_id__overrides__student_id__delete","parameters":[{"name":"assignment_id","in":"path","required":true,"schema":{"type":"integer","title":"Assignment Id"}},{"name":"student_id","in":"path","required":true,"schema":{"type":"integer","title":"Student Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/teachers/{teacher_id}/shapes":{"get":{"tags":["blocks"],"summary":"List Teacher Shapes","operationId":"list_teacher_shapes_teachers__teacher_id__shapes_get","parameters":[{"name":"teacher_id","in":"path","required":true,"schema":{"type":"integer","title":"Teacher Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["blocks"],"summary":"Create Teacher Shape","description":"Save a composition as a reusable shape. Content references are stripped so\nthe shape is a pattern, not a filled-in template.\n\nTHE STEP NAMES ARE KEPT. They were dropped with the content, on the theory\nthat a name is content -- but \"Meet the poem\" is the teacher's word for a\nstep in their own lesson pattern, which is the pattern. Without it, loading\na shape asked a model to name each step from its block type alone, and a\nteacher got back their own sequence relabelled with something generic.","operationId":"create_teacher_shape_teachers__teacher_id__shapes_post","parameters":[{"name":"teacher_id","in":"path","required":true,"schema":{"type":"integer","title":"Teacher Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Payload"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/teachers/{teacher_id}/shapes/{shape_id}":{"delete":{"tags":["blocks"],"summary":"Delete Teacher Shape","operationId":"delete_teacher_shape_teachers__teacher_id__shapes__shape_id__delete","parameters":[{"name":"teacher_id","in":"path","required":true,"schema":{"type":"integer","title":"Teacher Id"}},{"name":"shape_id","in":"path","required":true,"schema":{"type":"integer","title":"Shape Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/teachers/{teacher_id}/library":{"get":{"tags":["blocks"],"summary":"List Course Library","description":"The teacher's reusable CKL library — documents promoted from any of their\nassignments, available to pull into a new one.","operationId":"list_course_library_teachers__teacher_id__library_get","parameters":[{"name":"teacher_id","in":"path","required":true,"schema":{"type":"integer","title":"Teacher Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/assignments/{assignment_id}/ckl/{doc_id}/promote":{"post":{"tags":["blocks"],"summary":"Promote Ckl To Library","description":"Promote a per-assignment document into the teacher's library (no re-ingest\n— the built tree is reused). The document keeps its origin assignment.","operationId":"promote_ckl_to_library_assignments__assignment_id__ckl__doc_id__promote_post","parameters":[{"name":"assignment_id","in":"path","required":true,"schema":{"type":"integer","title":"Assignment Id"}},{"name":"doc_id","in":"path","required":true,"schema":{"type":"integer","title":"Doc Id"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/assignments/{assignment_id}/ckl/inherit":{"put":{"tags":["blocks"],"summary":"Set Inherited Ckl","description":"Set which library documents this assignment pulls in.","operationId":"set_inherited_ckl_assignments__assignment_id__ckl_inherit_put","parameters":[{"name":"assignment_id","in":"path","required":true,"schema":{"type":"integer","title":"Assignment Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/builder/instruct":{"post":{"tags":["blocks"],"summary":"Builder Instruct","description":"Translate a teacher's plain-English instruction into canvas ops + a reply.\nReturns {ops, reply}; on LLM failure returns empty ops so the Builder can\nfall back to its local handling.","operationId":"builder_instruct_builder_instruct_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Payload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/builder/sort-text":{"post":{"tags":["blocks"],"summary":"Builder Sort Text","description":"A pasted assignment sheet, sorted into instructions, questions to steer\ntoward, background only Spar sees, and left out → {note, pieces, ok}.\nProposes only: the builder applies nothing until the teacher says so.","operationId":"builder_sort_text_builder_sort_text_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Payload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/builder/generate-titles":{"post":{"tags":["blocks"],"summary":"Builder Generate Titles","description":"Humanized, student-facing titles per block → {titles: [{index, title}]}.","operationId":"builder_generate_titles_builder_generate_titles_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Payload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/builder/match-shapes":{"post":{"tags":["blocks"],"summary":"Builder Match Shapes","description":"Rank candidate shapes by fit → {ranked, recommended, reply}. None on failure.","operationId":"builder_match_shapes_builder_match_shapes_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Payload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/assignments/{assignment_id}/blocks":{"get":{"tags":["blocks"],"summary":"List Blocks","description":"Real block rows, or the synthesized legacy view for un-composed assignments.\n\nWith `student_id`, the sequence that student is on, which after a\nstructural edit that kept their work can be an older version than the\nbuilder's. Held to the same self-or-staff rule as the student's progress.","operationId":"list_blocks_assignments__assignment_id__blocks_get","parameters":[{"name":"assignment_id","in":"path","required":true,"schema":{"type":"integer","title":"Assignment Id"}},{"name":"student_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Student Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AssignmentBlockRead"},"title":"Response List Blocks Assignments  Assignment Id  Blocks Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["blocks"],"summary":"Replace Blocks","description":"Replace the assignment's block sequence (Builder save / live edit).\n\nValidator gate (422 on blocking errors). A save that changes only settings\nis written onto the existing rows and never touches progress. Live-edit\nsafety for the rest: structural edits\ndelete the old blocks, which would cascade away in-progress students' block\ninstances — so if any students have STARTED, the call is refused (409 with\nstarted_count) unless `reset=true`. Not-yet-started students are unaffected\neither way (their progress is recreated cleanly on next open).\n\nOWNED, like every other assignment write. require_teacher_or_admin above\nasks only whether the caller is a teacher at all; without the line below\nany signed-in teacher could replace any other teacher's sequence, at any\nschool, by its id.","operationId":"replace_blocks_assignments__assignment_id__blocks_put","parameters":[{"name":"assignment_id","in":"path","required":true,"schema":{"type":"integer","title":"Assignment Id"}},{"name":"reset","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Reset"}},{"name":"structural_choice","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Structural Choice"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AssignmentBlockCreate"},"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AssignmentBlockRead"},"title":"Response Replace Blocks Assignments  Assignment Id  Blocks Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/assignments/{assignment_id}/blocks/validate":{"post":{"tags":["blocks"],"summary":"Validate Blocks","description":"Validate a proposed sequence without persisting. Returns validator results.","operationId":"validate_blocks_assignments__assignment_id__blocks_validate_post","parameters":[{"name":"assignment_id","in":"path","required":true,"schema":{"type":"integer","title":"Assignment Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AssignmentBlockCreate"},"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/assignments/{assignment_id}/student-progress-summary":{"get":{"tags":["blocks"],"summary":"Student Progress Summary","description":"Counts for the Builder's live-edit warning: how many students have started\n(and so would lose progress if the teacher resets to apply structural edits).","operationId":"student_progress_summary_assignments__assignment_id__student_progress_summary_get","parameters":[{"name":"assignment_id","in":"path","required":true,"schema":{"type":"integer","title":"Assignment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/assignments/{assignment_id}/blocks/classify":{"post":{"tags":["blocks"],"summary":"Classify Blocks","description":"Dry run of a builder save: is it settings only, or structural, and if\nstructural, what changes and whose work it touches. The builder asks this\nBEFORE writing anything, so a structural save that the teacher has not\nyet decided about leaves the assignment exactly as it was (the title and\ndue date used to be committed by the PATCH before the blocks were\nrefused).","operationId":"classify_blocks_assignments__assignment_id__blocks_classify_post","parameters":[{"name":"assignment_id","in":"path","required":true,"schema":{"type":"integer","title":"Assignment Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AssignmentBlockCreate"},"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/assignments/{assignment_id}/version-switch":{"post":{"tags":["blocks"],"summary":"Answer Version Switch","description":"The student's answer to \"your teacher updated this assignment\".\n\nAccepting moves them onto the current sequence from its first step. Their\nwork on the old version is not carried over and not deleted: it stays on\nthe retired steps, readable. Declining keeps them where they are and\nstops asking.","operationId":"answer_version_switch_assignments__assignment_id__version_switch_post","parameters":[{"name":"assignment_id","in":"path","required":true,"schema":{"type":"integer","title":"Assignment Id"}},{"name":"student_id","in":"query","required":true,"schema":{"type":"integer","title":"Student Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body_answer_version_switch_assignments__assignment_id__version_switch_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/assignments/{assignment_id}/progress":{"get":{"tags":["blocks"],"summary":"Get Progress","description":"Where one student has got to in one assignment.\n\nHAD NO AUTHORIZATION AT ALL — `student_id` is a query parameter on a router\nwith no dependencies, so any caller read any student's progress by\nincrementing ids. Two things made that worse than it sounds:\n\n  * the response carries each instance's `essay_id`, and those are the\n    uuid4s `resolve_essay_token` relies on being unguessable. This route\n    published them, which is what made the ungated essay sub-resources\n    reachable.\n  * it carries `safeguarding_hold` {held, since} — so an anonymous caller\n    could learn WHICH CHILD is under a live safeguarding hold, and when it\n    started, by walking ids.\n\nA comment a few hundred lines below already described this route and its\nsibling as unauthorized. Describing a hole is not closing one.","operationId":"get_progress_assignments__assignment_id__progress_get","parameters":[{"name":"assignment_id","in":"path","required":true,"schema":{"type":"integer","title":"Assignment Id"}},{"name":"student_id","in":"query","required":true,"schema":{"type":"integer","title":"Student Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignmentProgressRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/assignments/{assignment_id}/blocks/{block_id}/start":{"post":{"tags":["blocks"],"summary":"Start Block","description":"Start (or resume) one block. Returns a kind-specific payload.\n\nThis is the composed-assignment counterpart to POST /sessions, and it\ncarried NO authorization at all: `student_id` is a query parameter, so\nany unauthenticated caller could start — or resume, and thereby read the\ntranscript of — any block for any student by incrementing ids. Held to\nthe same self-or-staff rule as every other student action.","operationId":"start_block_assignments__assignment_id__blocks__block_id__start_post","parameters":[{"name":"assignment_id","in":"path","required":true,"schema":{"type":"integer","title":"Assignment Id"}},{"name":"block_id","in":"path","required":true,"schema":{"type":"integer","title":"Block Id"}},{"name":"student_id","in":"query","required":true,"schema":{"type":"integer","title":"Student Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/blocks/instances/{instance_id}/complete-offline":{"post":{"tags":["blocks"],"summary":"Complete Offline","description":"Mark an Offline block complete (OFF-PLATFORM · YOU VERIFY / student done).\nAn optional `reflection` (the mini-Braindump) is stored and feeds the next\nSpar Session's cross-block opener.\n\nThe instance names its own student, so authorization resolves from the\nrow rather than from a caller-supplied id — there is nothing to spoof.","operationId":"complete_offline_blocks_instances__instance_id__complete_offline_post","parameters":[{"name":"instance_id","in":"path","required":true,"schema":{"type":"integer","title":"Instance Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"type":"object","additionalProperties":true},{"type":"null"}],"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/blocks/instances/{instance_id}/look-back":{"get":{"tags":["blocks"],"summary":"Look Back","description":"What a student did in a step they have finished. A read; it writes nothing.\n\nThe assignment page shows every step, and the finished ones were dead ends:\na title and the word \"done\". This is what opens when one is pressed.\n\nBUILT FROM AN ALLOW-LIST, NOT FROM THE ROWS. A finished step sits on top of\na session and sometimes an essay, and both carry things written ABOUT the\nstudent for their teacher (the essay's engagement analysis, a wellbeing\nobservation, the session summary's teacher narration, the analyzer's\noutput). So this names the handful of things that are the student's own and\nreturns only those:\n\n  a reflection   the question they were asked and what they wrote\n  a session      their own takeaway (the summary's student-facing part)\n  an essay       its title and length; the essay itself opens the usual way\n\nIt must not be built on `start_block`, which is the obvious thing to reach\nfor: on a finished Spar step that starts a NEW session and moves the\nstudent's place in the assignment backwards.\n\nThe instance names its own student, so authorization resolves from the row.","operationId":"look_back_blocks_instances__instance_id__look_back_get","parameters":[{"name":"instance_id","in":"path","required":true,"schema":{"type":"integer","title":"Instance Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/assignments/{assignment_id}/roster":{"get":{"tags":["blocks"],"summary":"Get Roster","description":"The director's view of a Log: one row per student.\n\nA submissions queue is the wrong shape here. 160 students at eight visits\neach is ~1,300 sessions and nobody reads those; what a director does weekly\nis find the students who have stopped. So this is a roster keyed on pace,\nand the capstone is the thing she actually reads.\n\nSummaries only. Nothing on this surface can reach a braindump, and the\nper-student rows carry counts and dates rather than prose.","operationId":"get_roster_assignments__assignment_id__roster_get","parameters":[{"name":"assignment_id","in":"path","required":true,"schema":{"type":"integer","title":"Assignment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignmentRosterRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/assignments/{assignment_id}/roster.csv":{"get":{"tags":["blocks"],"summary":"Get Roster Csv","description":"The same roster as a download.\n\nThe first real CSV export in the codebase — every other CSV path is an\nimport, and the only existing export is client-side print-to-PDF, which is\nnot a spreadsheet. A Service Learning Office already tracks hours their own\nway; this is the file that reconciles against theirs.","operationId":"get_roster_csv_assignments__assignment_id__roster_csv_get","parameters":[{"name":"assignment_id","in":"path","required":true,"schema":{"type":"integer","title":"Assignment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/assignments/{assignment_id}/log":{"get":{"tags":["blocks"],"summary":"Get Log","description":"The student's log for a recurring assignment: every visit, and where\nthey are against the goal.\n\nAuthorized on the same self-or-staff rule as block start: this carries a\nstudent's service record and their reflection history.\n\nThis comment used to end by observing that the two neighbouring endpoints —\n`/progress` and `/summary` — had no authorization and could be read for any\nstudent by incrementing ids. That was true for a long time and is no longer:\nboth are gated now. Noting it because an accurate description of a hole sat\nhere for months without closing it, which is the failure mode worth\nremembering, not the hole.","operationId":"get_log_assignments__assignment_id__log_get","parameters":[{"name":"assignment_id","in":"path","required":true,"schema":{"type":"integer","title":"Assignment Id"}},{"name":"student_id","in":"query","required":true,"schema":{"type":"integer","title":"Student Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignmentLogRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["blocks"],"summary":"Open Log Entry","description":"Open a visit — the \"log a visit\" form.\n\nIdempotent: a student with an entry already open gets that entry back with\nthe new fields merged in, not a second one. Hours recorded here do NOT\nbank; they bank when the pass completes at the end of the reflection.","operationId":"open_log_entry_assignments__assignment_id__log_post","parameters":[{"name":"assignment_id","in":"path","required":true,"schema":{"type":"integer","title":"Assignment Id"}},{"name":"student_id","in":"query","required":true,"schema":{"type":"integer","title":"Student Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogEntryCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignmentLogRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/assignments/{assignment_id}/summary":{"get":{"tags":["blocks"],"summary":"Get Assignment Summary","description":"One student's across-the-blocks summary.\n\nHAD NO AUTHORIZATION AT ALL, on the same shape as `get_progress` above —\nand this one WRITES: it generates the summary and commits. So an\nunauthenticated caller could not only read another student's prose and\n`spar_analysis`, they could make the server produce it.\n\n`AssignmentSummaryRead.content` is an open dict carrying the per-block\ndigest: the session summary's student_artifact and the essay analysis. That\nis a child's writing.","operationId":"get_assignment_summary_assignments__assignment_id__summary_get","parameters":[{"name":"assignment_id","in":"path","required":true,"schema":{"type":"integer","title":"Assignment Id"}},{"name":"student_id","in":"query","required":true,"schema":{"type":"integer","title":"Student Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/AssignmentSummaryRead"},{"type":"null"}],"title":"Response Get Assignment Summary Assignments  Assignment Id  Summary Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sessions/open-chat":{"post":{"tags":["sessions"],"summary":"Start Open Chat For Student","description":"Create a free-form open-chat session for a logged-in student.\n\nUsed by the Lobby's 'Chat with Spar' affordance. No demo gating\n(the student is authenticated). Phase 1 dialogue only — not\nassignment-bound, so transitions to Phase 2/3/4 are unreachable.","operationId":"start_open_chat_for_student_sessions_open_chat_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenChatStart"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnonymousSessionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sessions":{"post":{"tags":["sessions"],"summary":"Start Session","description":"Start an assignment session.\n\nAuthorization is the self-or-staff rule, checked here rather than as a\nrouter dependency because `student_id` arrives in the body. It previously\nrequired the ADMIN token — which meant a rostered student clicking \"start\"\non their own lobby card got a 403, since no student holds that token.\n\nThis does NOT reopen the demo cap-bypass that the admin gate was there to\nclose (see spar/demo_gating.py): a student capability token is minted only\nat roster login, for a student a teacher enrolled. The public still cannot\nmint a non-guest session — an anonymous caller has no token to present and\nis refused exactly as before.","operationId":"start_session_sessions_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionStart"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionStartResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sessions/{session_id}/message":{"post":{"tags":["sessions"],"summary":"Send Message","description":"Send a student message; stream Spar's reply as Server-Sent Events.\n\nStream format: each event is `data: {\"text\": \"<chunk>\"}\\n\\n`.\nA terminal `data: {\"done\": true}` event signals completion.","operationId":"send_message_sessions__session_id__message_post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"integer","title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionMessage"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sessions/{session_id}/safety-prompt":{"post":{"tags":["sessions"],"summary":"Answer Safety Prompt","description":"The student's answer to \"do you want to take a moment?\".\n\nIt governs HER SESSION and nothing else. The alert was dispatched from the\nIncident before this could be called, so declining does not, and must not,\nsuppress it -- otherwise this is a consent dialog for a child's own\nsafeguarding.","operationId":"answer_safety_prompt_sessions__session_id__safety_prompt_post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"integer","title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SafetyPromptAnswer"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sessions/{session_id}/stuck":{"post":{"tags":["sessions"],"summary":"Guide Help","description":"The student says they are stuck on the teacher's question.\n\nThe first call buys ONE attempt — Spar decomposes the question and, where\nthe source has anything to say, sends them back to read it. The call is\nrecorded, so the next braindump request passes.\n\nDeliberately a route of its own rather than a flag on the braindump body:\n`skip_min_exchanges` was a plain bool there once and defeated the volley\nfloor with a single request field. The way out has to be a thing that\nHAPPENED on the server, not a thing a client can claim.","operationId":"guide_help_sessions__session_id__stuck_post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"integer","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sessions/{session_id}/braindump":{"post":{"tags":["sessions"],"summary":"Start Braindump","operationId":"start_braindump_sessions__session_id__braindump_post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"integer","title":"Session Id"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BraindumpStart","default":{"resume":false,"skip_bridge":false}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BraindumpStartResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sessions/{session_id}/braindump/complete":{"post":{"tags":["sessions"],"summary":"Complete Braindump","description":"Phase 2 → Phase 3 boundary, streamed as Server-Sent Events.\n\nStream protocol (same `data: ...\\n\\n` framing as /message):\n  data: {\"event\": \"analyzed\", \"analyzer_output\": {...}}     once\n        the analyzer pass (or cache hit) is done; lets the UI\n        flip from \"Spar is reading your work\" to \"Spar is\n        responding\".\n  data: {\"text\": \"<chunk>\"}                                  one or\n        more synthesis text chunks as they arrive from the LLM.\n  data: {\"event\": \"done\", \"phase1_recap\": \"...\",\n         \"is_terminal_cycle\": true, \"session_state\": \"...\"}  final.\n\nErrors are sent as a single `data: {\"error\": ..., \"status\": ...}`\nframe and the stream ends. This matches the format /message uses\nso the frontend's SSE consumer can branch on the same shape\n(code=demo_cap_reached, code=empty_completion, etc.).","operationId":"complete_braindump_sessions__session_id__braindump_complete_post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"integer","title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BraindumpComplete"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sessions/{session_id}/calibration":{"post":{"tags":["sessions"],"summary":"Submit Calibration","description":"Phase 3 pre-synthesis calibration → synthesis, streamed as SSE (Brief 2).\n\nAfter ``/braindump/complete`` returns a ``calibration_ready`` event, the\nstudent submits which claim they'd defend hardest + justification + confidence.\nPersists the calibration, then streams the synthesis field-by-field.","operationId":"submit_calibration_sessions__session_id__calibration_post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"integer","title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalibrationSubmission"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sessions/{session_id}/dialogue":{"post":{"tags":["sessions"],"summary":"Submit Dialogue","description":"Phase 3 post-synthesis dialogue turn (Brief 3), streamed as SSE.\n\nAnchored affordance (explain a Correct / push back on a Probe / tell-me-more\nabout the Mirror); streams token-by-token prose, then a final done frame.","operationId":"submit_dialogue_sessions__session_id__dialogue_post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"integer","title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DialogueTurnRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sessions/{session_id}/phase3":{"get":{"tags":["sessions"],"summary":"Read Phase3","description":"Latest cycle's structured synthesis + dialogue turns (Brief 4).\n\nFeeds the post-synthesis affordances and the Composition notes panel. The\nsynthesis is the student-facing object they already saw; dialogue is theirs.","operationId":"read_phase3_sessions__session_id__phase3_get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"integer","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Phase3Read"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sessions/{session_id}/threads":{"post":{"tags":["sessions"],"summary":"Save Thread","description":"Save a New Thread (Spar-initiated capture-accept, or student-initiated).","operationId":"save_thread_sessions__session_id__threads_post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"integer","title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveThreadRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Thread"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["sessions"],"summary":"List Threads","description":"Active threads captured in this session, newest first.","operationId":"list_threads_sessions__session_id__threads_get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"integer","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Thread"},"title":"Response List Threads Sessions  Session Id  Threads Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sessions/{session_id}/threads/{thread_id}/dismiss":{"post":{"tags":["sessions"],"summary":"Dismiss Thread","description":"Soft-dismiss a thread (idempotent).","operationId":"dismiss_thread_sessions__session_id__threads__thread_id__dismiss_post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"integer","title":"Session Id"}},{"name":"thread_id","in":"path","required":true,"schema":{"type":"integer","title":"Thread Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Thread"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sessions/{session_id}/threads/upcoming":{"get":{"tags":["sessions"],"summary":"List Upcoming Threads","description":"Active threads from the student's prior sessions in the same assignment,\nsurfaced beside the next session's Volley.","operationId":"list_upcoming_threads_sessions__session_id__threads_upcoming_get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"integer","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Thread"},"title":"Response List Upcoming Threads Sessions  Session Id  Threads Upcoming Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sessions/{session_id}/nudge":{"post":{"tags":["sessions"],"summary":"Request Nudge","description":"Generate a single Phase 2 nudge at the requested escalation level.\n\nSpec: spar_nudge_calibration.md. The frontend resolves L1/L2/L3 locally\nvia the escalation state machine; the backend orchestrates source-rule\nselection, fallback detection, and the second-fire route-to-Phase-1\nshort-circuit.","operationId":"request_nudge_sessions__session_id__nudge_post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"integer","title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NudgeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NudgeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sessions/{session_id}/nudge/idle-stuck":{"post":{"tags":["sessions"],"summary":"Record Idle Stuck","description":"Behavioral idle-and-stuck signal — telemetry only, no generator call.","operationId":"record_idle_stuck_sessions__session_id__nudge_idle_stuck_post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"integer","title":"Session Id"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdleStuckSignal","default":{}}}}},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sessions/{session_id}/return-to-phase1":{"post":{"tags":["sessions"],"summary":"Return To Phase1","description":"Send the student back from the Braindump to Phase 1 dialogue.\n\nUsed by the second-fallback nudge escalation; reusable by the\nminimum-text-threshold flow described in the Phase 2 layer file.\n\n``payload.draft_text`` is the live textarea content — when provided and\nnon-empty it is preserved in the session so the student can resume\nexactly where they left off.","operationId":"return_to_phase1_sessions__session_id__return_to_phase1_post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"integer","title":"Session Id"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReturnToPhase1Request","default":{"silent":false}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReturnToPhase1Response"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sessions/{session_id}/continue-cycle":{"post":{"tags":["sessions"],"summary":"Continue Cycle","description":"Drive the post-synthesis decision: keep talking, write again, or close.","operationId":"continue_cycle_sessions__session_id__continue_cycle_post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"integer","title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContinueCycleRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContinueCycleResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sessions/{session_id}/close":{"post":{"tags":["sessions"],"summary":"Close Session","operationId":"close_session_sessions__session_id__close_post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"integer","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionCloseResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sessions/{session_id}/reflection":{"post":{"tags":["sessions"],"summary":"Submit Reflection","description":"End a discussion-shaped session with the student's short reflection.\n\nThe only way such a session completes: it has no Braindump or Synthesis to\nreach, and the plain close above is refused until this has been taken.","operationId":"submit_reflection_sessions__session_id__reflection_post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"integer","title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReflectionSubmit"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionCloseResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sessions/{session_id}/braindump-signal":{"get":{"tags":["sessions"],"summary":"Get Braindump Signal","description":"Signal-driven Volley→Braindump offer (SHP pilot pacing).\n\nPast the Volley floor, reports whether the student has surfaced something\nsubstantive enough to offer the move to Braindump — a single extraction\npass over the Phase 1 transcript, never an analyzer/synthesis call. The\nfrontend throttles how often it asks and lets the student decline without\npenalty. Returns ready=False (no LLM call) below the floor and for\nfree-form sessions with no Braindump phase.","operationId":"get_braindump_signal_sessions__session_id__braindump_signal_get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"integer","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BraindumpOfferSignalResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sessions/{session_id}/state":{"get":{"tags":["sessions"],"summary":"Get Session State","operationId":"get_session_state_sessions__session_id__state_get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"integer","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionStateRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sessions/{session_id}/summary":{"get":{"tags":["sessions"],"summary":"Get Session Summary","operationId":"get_session_summary_sessions__session_id__summary_get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"integer","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SummaryRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sessions/{session_id}/detail":{"get":{"tags":["sessions"],"summary":"Get Session Detail","description":"Bundle summary + assignment metadata + block progress.\n\nUsed by the history view to render a designed reading experience without\nchaining multiple requests. The student's own history page and the\nteacher's dashboard both call this; the student gets only their own part\nof the summary (see _summary_for_reader).","operationId":"get_session_detail_sessions__session_id__detail_get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"integer","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionDetailRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sessions/{session_id}/my-record":{"get":{"tags":["sessions"],"summary":"My Record","description":"The student's own Volley and Braindump for one session, read-only.\n\nOnce the Braindump is behind them, never while one is open, and until the\nend of the school year (spar/own_record.py). The student's only: staff are\nrefused here, not handed an empty record, so nothing on a staff surface\ncan come to depend on it.","operationId":"my_record_sessions__session_id__my_record_get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"integer","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sessions/{session_id}/braindump/draft":{"post":{"tags":["sessions"],"summary":"Save Draft","description":"Persist the in-progress braindump so losing the tab doesn't lose it.\n\nCalled on a short debounce while the student types, and once more when\nthe page is hidden. No LLM call — this is a plain write, deliberately\nseparate from analyze_partial (which analyzes but never stores).","operationId":"save_draft_sessions__session_id__braindump_draft_post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"integer","title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BraindumpDraftSaveRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BraindumpDraftSaveResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sessions/{session_id}/braindump/analyze_partial":{"post":{"tags":["sessions"],"summary":"Analyze Partial","operationId":"analyze_partial_sessions__session_id__braindump_analyze_partial_post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"integer","title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BraindumpAnalyzePartialRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BraindumpAnalyzePartialResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sessions/{session_id}/braindump/analyze_safety":{"post":{"tags":["sessions"],"summary":"Analyze Safety","description":"Braindump safety sibling — runs the safeguarding classifier on the\nin-progress text and records the verdict. Independent of the pedagogical\n`analyze_partial`: its own tighter cadence (3s pause / boundary /\nabandonment, no word floor, no cache-hit-return), fired silently by the\nclient. Returns only an ack — never the tier — and never raises into the\nsession (the pipeline is fail-safe).","operationId":"analyze_safety_sessions__session_id__braindump_analyze_safety_post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"integer","title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BraindumpAnalyzeSafetyRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BraindumpAnalyzeSafetyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/platform/overview":{"get":{"tags":["platform"],"summary":"Overview","description":"Every school side by side, plus where students stop across all of them.","operationId":"overview_platform_overview_get","parameters":[{"name":"window","in":"query","required":false,"schema":{"type":"string","pattern":"^(7d|30d|all)$","default":"30d","title":"Window"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformOverview"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/platform/spend":{"get":{"tags":["platform"],"summary":"Spend Breakdown","description":"The window's bill by phase, model and actor, and day by day.","operationId":"spend_breakdown_platform_spend_get","parameters":[{"name":"window","in":"query","required":false,"schema":{"type":"string","pattern":"^(7d|30d|all)$","default":"30d","title":"Window"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformSpend"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/platform/health":{"get":{"tags":["platform"],"summary":"Health","description":"Is the machinery working: model calls, queues, mail, and safeguarding.","operationId":"health_platform_health_get","parameters":[{"name":"window","in":"query","required":false,"schema":{"type":"string","pattern":"^(7d|30d|all)$","default":"30d","title":"Window"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformHealth"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/platform/markers":{"get":{"tags":["platform"],"summary":"Markers","description":"The cognitive markers: how each is wired, and what they say.","operationId":"markers_platform_markers_get","parameters":[{"name":"window","in":"query","required":false,"schema":{"type":"string","pattern":"^(7d|30d|all)$","default":"30d","title":"Window"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformMarkers"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/platform/markers/recompute":{"post":{"tags":["platform"],"summary":"Recompute Markers","description":"Run the marker batches now, rather than waiting for the worker's timer.\n\nThe same three calls the scoring worker makes every ten minutes. Here so a\nmarker that shows as never run, or stale, can be told apart from one whose\nworker is down: if this fills it in, the worker is the problem.","operationId":"recompute_markers_platform_markers_recompute_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Recompute Markers Platform Markers Recompute Post"}}}}}}},"/platform/markers/reading":{"get":{"tags":["platform"],"summary":"Read Marker Reading","description":"The stored reading of what the markers add up to. Never writes one —\nopening the page must not cost a model call.","operationId":"read_marker_reading_platform_markers_reading_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarkerReadingEnvelope"}}}}}},"post":{"tags":["platform"],"summary":"Write Marker Reading","description":"Write a fresh reading from the current aggregates, and store it.\n\nOne model call, shown only pooled figures — see spar/marker_reading.py.","operationId":"write_marker_reading_platform_markers_reading_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarkerReadingEnvelope"}}}}}}},"/platform/queues":{"get":{"tags":["platform"],"summary":"Queue Health","description":"Depth and staleness of both background queues.\n\nThe missing signal in the CKL OOM incident. Builds were failing and\nrestarting for hours and the only thing that reported it was a Render memory\nalert; from inside the product a stuck build is indistinguishable from a slow\none. `stuck > 0` means a worker took a job and died holding it.","operationId":"queue_health_platform_queues_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformQueues"}}}}}}},"/platform/schools":{"get":{"tags":["platform"],"summary":"List Schools","description":"Every school, pilots and fixtures alike. `kind` is what separates them —\nthey obey identical rules and differ only in whether they count.","operationId":"list_schools_platform_schools_get","parameters":[{"name":"window","in":"query","required":false,"schema":{"type":"string","pattern":"^(7d|30d|all)$","default":"30d","title":"Window"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PlatformSchoolRow"},"title":"Response List Schools Platform Schools Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["platform"],"summary":"Create School","description":"Create a school and its first admin together.\n\nTogether, because a school with nobody in it is not a thing anyone wants,\nand because the admin is what makes the school self-serving from here: they\nadd their own teachers, who build their own classes.\n\nThe access code is returned exactly once. Nothing reads it back.","operationId":"create_school_platform_schools_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformSchoolCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformSchoolCreated"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/platform/schools/{school_id}/kind":{"patch":{"tags":["platform"],"summary":"Change School Kind","description":"Say whether a school counts as a pilot.\n\n`kind` is the only thing that separates a pilot from a fixture, and it\ndefaults to pilot — so a school made to try something out is counted in the\npilot totals, the funnel and the markers until someone says otherwise. This\nis how to say otherwise. It changes what is COUNTED; the school, its people\nand its work are untouched.","operationId":"change_school_kind_platform_schools__school_id__kind_patch","parameters":[{"name":"school_id","in":"path","required":true,"schema":{"type":"integer","title":"School Id"}},{"name":"window","in":"query","required":false,"schema":{"type":"string","pattern":"^(7d|30d|all)$","default":"30d","title":"Window"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformSchoolKind"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformSchoolRow"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/platform/schools/{school_id}/mobile":{"patch":{"tags":["platform"],"summary":"Change School Mobile","description":"Let one school use Spar on a phone, or stop letting it.\n\nOn a phone the app shows \"Spar is better on a computer for now\" to\nstudents and teachers. This turns that screen off for one school, so phone\naccess can be tried in production there before any other school has it.\n\nIt takes effect the next time each person's app loads its profile: on\ntheir next sign-in or reload, not mid-session. Nothing on the server is\ngated by it; it changes which screen the app shows.","operationId":"change_school_mobile_platform_schools__school_id__mobile_patch","parameters":[{"name":"school_id","in":"path","required":true,"schema":{"type":"integer","title":"School Id"}},{"name":"window","in":"query","required":false,"schema":{"type":"string","pattern":"^(7d|30d|all)$","default":"30d","title":"Window"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformSchoolMobile"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformSchoolRow"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/platform/schools/{school_id}/access":{"put":{"tags":["platform"],"summary":"Change School Access","description":"Turn a whole school off, or back on (spar/school_access.py).\n\nOff: nobody at the school can use Spar, staff or student, from their next\nrequest. Nothing is deleted, and turning it back on restores every account\nas it was. It is recorded, with who did it.\n\nTurning one OFF asks for the platform admin's own password, in the\n`X-Spar-Confirm` header: it locks out a whole school, and the way that\ngoes wrong is a session left open on a laptop. Turning one on does not.\nThe deployment's admin token has no password and is not asked for one.","operationId":"change_school_access_platform_schools__school_id__access_put","parameters":[{"name":"school_id","in":"path","required":true,"schema":{"type":"integer","title":"School Id"}},{"name":"window","in":"query","required":false,"schema":{"type":"string","pattern":"^(7d|30d|all)$","default":"30d","title":"Window"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformSchoolAccess"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformSchoolRow"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/platform/schools/{school_id}/email-reset-request":{"post":{"tags":["platform"],"summary":"Request School Email Reset","description":"Step one of resetting a school's emails (spar/school_reset.py): the\nplatform admin's password, then a code to their own inbox. Changes\nnothing. Returns what a reset would touch, as counts.","operationId":"request_school_email_reset_platform_schools__school_id__email_reset_request_post","parameters":[{"name":"school_id","in":"path","required":true,"schema":{"type":"integer","title":"School Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/platform/schools/{school_id}/email-reset-confirm":{"post":{"tags":["platform"],"summary":"Confirm School Email Reset","description":"Spend the code and free every address at the school. There is no undo.","operationId":"confirm_school_email_reset_platform_schools__school_id__email_reset_confirm_post","parameters":[{"name":"school_id","in":"path","required":true,"schema":{"type":"integer","title":"School Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SchoolEmailResetConfirm"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/platform/schools/{school_id}":{"patch":{"tags":["platform"],"summary":"Edit School Details","description":"Record what a pilot agreement says about a school.\n\nWhere it is in its life, when it runs, who to ring, how many students it\nwas agreed for, what it was agreed to cost. These are FACTS TO BE SHOWN:\nnothing here stops a school working. A school past its seat limit or its\nbudget is flagged on this surface and carries on exactly as before — the\ndecision about what to do is a conversation, not a lockout.\n\nPartial. Only the fields present change; an explicit null clears one.","operationId":"edit_school_details_platform_schools__school_id__patch","parameters":[{"name":"school_id","in":"path","required":true,"schema":{"type":"integer","title":"School Id"}},{"name":"window","in":"query","required":false,"schema":{"type":"string","pattern":"^(7d|30d|all)$","default":"30d","title":"Window"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformSchoolDetails"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformSchoolRow"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/platform/audit":{"get":{"tags":["platform"],"summary":"Audit Log","description":"Who changed what, newest first. Acts of administration only — it never\nholds a student's name or anything a student wrote.","operationId":"audit_log_platform_audit_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"school_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"School Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AdminAuditEventRead"},"title":"Response Audit Log Platform Audit Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/platform/schools/{school_id}/deletion-request":{"post":{"tags":["platform"],"summary":"Request School Deletion","description":"Ask to delete a school. Sends a code to the requester's own email.\n\nDestroys nothing. Returns the preview — counts, never anyone's writing —\nso the decision is made against numbers rather than against the word\n\"permanently\".","operationId":"request_school_deletion_platform_schools__school_id__deletion_request_post","parameters":[{"name":"school_id","in":"path","required":true,"schema":{"type":"integer","title":"School Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/platform/schools/{school_id}/deletion-confirm":{"post":{"tags":["platform"],"summary":"Confirm School Deletion","description":"Spend the code and destroy the school. There is no undo.\n\nA POST rather than a DELETE because it carries a body — and because what it\ndoes is spend a one-time credential, which is a thing that happens once\nrather than a state being asserted.","operationId":"confirm_school_deletion_platform_schools__school_id__deletion_confirm_post","parameters":[{"name":"school_id","in":"path","required":true,"schema":{"type":"integer","title":"School Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SchoolDeletionConfirm"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/platform/teachers/{teacher_id}/removal-request":{"post":{"tags":["platform"],"summary":"Request Staff Removal","description":"Ask to remove a teacher. Sends a code to the asker's own email.\n\nRemoves nobody. Returns the preview — classes, students and pieces of\nwriting — so the decision is made against numbers rather than a name.","operationId":"request_staff_removal_platform_teachers__teacher_id__removal_request_post","parameters":[{"name":"teacher_id","in":"path","required":true,"schema":{"type":"integer","title":"Teacher Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StaffRemovalRequestCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/platform/teachers/{teacher_id}/removal-confirm":{"post":{"tags":["platform"],"summary":"Confirm Staff Removal","description":"Spend the code and carry out the act the request committed to.\n\nA POST rather than a DELETE because it carries a body — and because what it\ndoes is spend a one-time credential, which happens once rather than being\na state asserted.","operationId":"confirm_staff_removal_platform_teachers__teacher_id__removal_confirm_post","parameters":[{"name":"teacher_id","in":"path","required":true,"schema":{"type":"integer","title":"Teacher Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StaffRemovalConfirm"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/status":{"get":{"tags":["auth"],"summary":"Auth Status","description":"What this signed-in account still has to do before it is a real account.","operationId":"auth_status_auth_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthStatusResponse"}}}}}}},"/auth/claim/email":{"post":{"tags":["auth"],"summary":"Claim Email","description":"Step one: the school address this account will belong to.","operationId":"claim_email_auth_claim_email_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthClaimEmailRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/claim/verify":{"post":{"tags":["auth"],"summary":"Claim Verify","description":"Step two. Verifying the code is what SETS the address — which is why\nthere is no separate email_verified_at: an address on the row is a verified\none.","operationId":"claim_verify_auth_claim_verify_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthCodeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/invite/accept":{"post":{"tags":["auth"],"summary":"Invite Accept","description":"An invite link, opened. Replaces claim/email AND claim/verify.\n\nPUBLIC, and it has to be: the person holding the link has no account they\ncan sign in to yet. The token IS the credential, and it is the strongest\none in this module — 256 bits, single-use, and sent to one address.\n\nWHY THE TWO CLAIM STEPS COLLAPSE. Those steps exist to prove somebody\nholds a school mailbox: type the address, then type what we mailed to it.\nAn invite went to that mailbox already, so opening it proves the same\nthing by the same evidence. Asking again would be asking somebody to\nconfirm the address they just received mail at.\n\n`claim/password` is NOT skipped. It is the step that makes this an account\nrather than a link, and it is where the access code is spent.","operationId":"invite_accept_auth_invite_accept_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthInviteAcceptRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthInviteAccepted"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/claim/password":{"post":{"tags":["auth"],"summary":"Claim Password","description":"Step three, and the access code is spent.\n\nLeaving it alive would mean a second, weaker, never-expiring credential\nsitting behind the one just created.","operationId":"claim_password_auth_claim_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthClaimPasswordRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthSessionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/claim/finish":{"post":{"tags":["auth"],"summary":"Claim Finish","description":"Step three without a password: the access code is spent all the same.\n\nThe address was proved a moment ago, by the emailed code or by the invite\nlink, and from here it is how this person signs in. What must not survive\nis the access code — the reason `claim/password` exists is to kill it, and\nskipping the password must not skip that.\n\nRefused for the platform admin, who needs the password as a first factor.","operationId":"claim_finish_auth_claim_finish_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthSessionResponse"}}}}}}},"/auth/login":{"post":{"tags":["auth"],"summary":"Login","description":"Email + password. A second factor follows for the platform admin.","operationId":"login_auth_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthLoginRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/login/mfa":{"post":{"tags":["auth"],"summary":"Login Mfa","operationId":"login_mfa_auth_login_mfa_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthCodeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthSessionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/email/start":{"post":{"tags":["auth"],"summary":"Email Start","description":"Ask for a sign-in code and link. Always answers the same way.\n\nSame reason as reset/request: \"no such account\" here is a way to find out\nwho works at, or attends, a school.\n\nEVERY request is recorded against the limit, not only failed ones. What is\nbeing rationed is mail to somebody else's inbox.","operationId":"email_start_auth_email_start_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthEmailStartRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/email/code":{"post":{"tags":["auth"],"summary":"Email Code","description":"The six digits. An unknown address fails exactly as a known one with\nnothing pending does.\n\nTHE PLATFORM ADMIN'S CODE IS FOLLOWED BY THEIR PASSWORD. That account\nreaches every school's student writing and signs in with two things. By\nthe password door those are the password and then an emailed code; by this\none they are the same two in the other order. So a right code from them\nanswers `password_required` and signs nobody in, and the same code sent\nagain with the password does.\n\nUntil this, their address was quietly refused here: the screen promised a\ncode to everyone and theirs never came.\n\nNothing is told to someone who does not hold the code. Whether an address\nis that account is only ever said in reply to a RIGHT code, which takes\nits mailbox.","operationId":"email_code_auth_email_code_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthEmailCodeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthEmailSession"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/email/link":{"post":{"tags":["auth"],"summary":"Email Link","description":"The link, spent by the button on the page it opens — never by a GET.\n\nPUBLIC for the reason invite/accept is: the token is the credential.\n\nThe account is looked up again AFTER the link is spent, through the same\ngate as asking for one. Fifteen minutes is long enough for a teacher to be\nremoved, and a link that outlived that must not open their account.","operationId":"email_link_auth_email_link_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthInviteAcceptRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthEmailSession"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/reset/request":{"post":{"tags":["auth"],"summary":"Reset Request","description":"Always answers the same way.\n\nSaying \"no such account\" here would turn this into a way to find out who\nworks at a school, which is the same reason login has one error message.","operationId":"reset_request_auth_reset_request_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthClaimEmailRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/reset/confirm":{"post":{"tags":["auth"],"summary":"Reset Confirm","operationId":"reset_confirm_auth_reset_confirm_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthClaimPasswordRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthSessionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/teachers/sign-in":{"post":{"tags":["teachers"],"summary":"Teacher Sign In","description":"Sign a teacher in with their own access code and mint their token.\n\nFails closed with 404 on a bad code — a 401 would confirm that some codes\nare real, which is the same reason the student login fails this way.","operationId":"teacher_sign_in_teachers_sign_in_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeacherSignInRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeacherSignInResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workshop/join":{"post":{"tags":["workshop"],"summary":"Join","operationId":"join_workshop_join_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkshopJoinRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkshopJoinResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workshop/student-view":{"post":{"tags":["workshop"],"summary":"Student View","operationId":"student_view_workshop_student_view_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkshopStudentView"}}}}}}},"/workshop/{code}":{"get":{"tags":["workshop"],"summary":"Check","operationId":"check_workshop__code__get","parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string","title":"Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkshopCheck"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/teachers":{"get":{"tags":["teachers"],"summary":"List Teachers","description":"The staff register, as wide as this caller's standing. See\n`_may_see_teacher` -- the rows carry sign-in credentials.","operationId":"list_teachers_teachers_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/TeacherRead"},"type":"array","title":"Response List Teachers Teachers Get"}}}}}},"post":{"tags":["teachers"],"summary":"Create Teacher","operationId":"create_teacher_teachers_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeacherCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeacherRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/teachers/by-code/{code}":{"get":{"tags":["teachers"],"summary":"Get Teacher By Code","description":"Look an account up by its access code.\n\nHeld to the same rule as the listing, and it needs it more: `code` is\nderived from the name, so it is guessable, and the answer is the account\nthe code belongs to. Unscoped, this turned a guessed name into a confirmed\nlogin at any school.\n\n404 for \"exists but not yours\", identical to \"does not exist\", so the\nguessing learns nothing.","operationId":"get_teacher_by_code_teachers_by_code__code__get","parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string","title":"Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeacherRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/teachers/{teacher_id}/access-code":{"post":{"tags":["teachers"],"summary":"Issue Teacher Access Code","description":"Mint (or rotate) a teacher's personal access code. ADMIN ONLY.\n\nWithout this the credential could not exist — the same trap ui_mode fell\ninto, where a flag shipped with nothing able to set it. A migration was the\nwrong place to mint them: it would have created secrets nobody was told\nabout, for teachers who may never sign in.\n\nRotating INVALIDATES the teacher's capability token, so a rotated code\nsigns out every session opened with the old one. That is the point of\nrotating.\n\nReturned exactly once, here. Nothing reads it back.","operationId":"issue_teacher_access_code_teachers__teacher_id__access_code_post","parameters":[{"name":"teacher_id","in":"path","required":true,"schema":{"type":"integer","title":"Teacher Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeacherAccessCodeIssued"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/teachers/me/timezone":{"post":{"tags":["teachers"],"summary":"Note My Timezone","description":"Tell Spar where this person's browser is, so their school has a\ntimezone without anybody being asked for one.\n\nThe school's zone decides what a paused student is told about the hour\nand whether a run of late-night sessions is late at all, and both stay\nsilent for a school with none. It used to be learned only when a teacher\nfirst saved an assignment, so a school could run for weeks without one.\nNow every staff sign-in offers it.\n\nFIRST ANSWER WINS (roster.remember_school_timezone). A teacher marking\nfrom an airport must not move the school, and an admin who needs to\ncorrect it does so on purpose, under \"set school hours\".\n\nThe school is the caller's own, never a parameter. The platform admin is\nskipped: they are seated at a school they do not work at, and their\nbrowser says nothing about where it is.\n\nDeclared before /{teacher_id} for the reason /me is.","operationId":"note_my_timezone_teachers_me_timezone_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Payload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/teachers/me":{"get":{"tags":["teachers"],"summary":"Get Me","description":"The signed-in teacher, resolved from their own capability token.\n\nMirrors GET /students/me, and exists for the same reason: a refresh must\nnot sign you out. It also closes the identity bug PR #58 fixed on sign-in\nbut left live on RELOAD — the app's rehydration effect called /teachers/demo,\nwhich looks up SPAR_DEMO_TEACHER_CODE and does not care who is asking. So\nSalma signed in as Salma, pressed F5, and came back as the demo teacher.\n\nOrdering matters in the router as well as the client: this must be declared\nBEFORE /{teacher_id}, or FastAPI matches \"me\" as a teacher id.\n\n403 rather than 404 when the token resolves to nobody — the caller has a\ncredential, it is simply not one we recognise, and the client's rehydration\ntreats both as \"sign in again\" anyway.","operationId":"get_me_teachers_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeacherRead"}}}}}}},"/teachers/me/intro-seen":{"post":{"tags":["teachers"],"summary":"Mark Intro Seen","description":"Record that the welcome has been shown or skipped, so it is shown once.\n\nOn /me, like the read above, so an account can only ever stamp itself. The\nstamp is not moved once set: \"show me around again\" calls nothing.","operationId":"mark_intro_seen_teachers_me_intro_seen_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeacherRead"}}}}}}},"/teachers/demo":{"get":{"tags":["teachers"],"summary":"Get Demo Teacher","description":"Return the configured demo teacher — the row TeacherEntry signs into\nafter validating the admin or teacher token (decoupled from any specific\nteacher.code value the visitor types).\n\nLookup: the teacher whose `code` equals SPAR_DEMO_TEACHER_CODE (default\n'demo'). 404 if that account does not exist.\n\nThere used to be a second step -- `select(Teacher).limit(1)` -- so that an\nunseeded deployment still had something to return. On a deployment serving\nreal schools that step hands out an arbitrary REAL teacher's row, `code`\nincluded, to anyone holding the demo or teacher token. A demo endpoint that\nsilently substitutes a real person is worse than a demo endpoint that 404s,\nso it now 404s and says what to configure.","operationId":"get_demo_teacher_teachers_demo_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeacherRead"}}}}}}},"/teachers/{teacher_id}/students":{"get":{"tags":["teachers"],"summary":"List Class","description":"Class overview — every student with their engagement signals.\n\nScoped to the teacher's classrooms via the enrollment roster (guests\nstripped). A teacher with no classrooms yet sees the unscoped roster —\ntoday's behavior — until classrooms exist. See spar/roster.py.","operationId":"list_class_teachers__teacher_id__students_get","parameters":[{"name":"teacher_id","in":"path","required":true,"schema":{"type":"integer","title":"Teacher Id"}},{"name":"scope","in":"query","required":false,"schema":{"enum":["mine","school"],"type":"string","default":"school","title":"Scope"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/StudentEngagement"},"title":"Response List Class Teachers  Teacher Id  Students Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/teachers/{teacher_id}/assignments":{"get":{"tags":["teachers"],"summary":"List Teacher Assignments","description":"The assignments this teacher should see — their dashboard's source list.\n\nScoped through spar/roster.py, the same module that answers the question\nfor the student lobby. A teacher who owns classrooms sees their\nclassrooms' assignments; one who owns none is a legacy/demo teacher and\nsees everything, exactly as roster_students treats the roster.\n\nThis used to claim it filtered \"by teacher_id where set\" and then return\n`list(rows)` — every assignment in the deployment, unconditionally. With\none teacher that reads as correct; with two schools in one database it\nputs every other teacher's work on the dashboard. Note that filtering on\nAssignment.teacher_id would not have worked either: it's a free-text\nString(128) that the builder never populates. Ownership runs through the\nclassroom (Classroom.teacher_id), which is why this scopes on classrooms.","operationId":"list_teacher_assignments_teachers__teacher_id__assignments_get","parameters":[{"name":"teacher_id","in":"path","required":true,"schema":{"type":"integer","title":"Teacher Id"}},{"name":"scope","in":"query","required":false,"schema":{"enum":["mine","school"],"type":"string","default":"school","title":"Scope"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AssignmentRead"},"title":"Response List Teacher Assignments Teachers  Teacher Id  Assignments Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/teachers/assignments/{assignment_id}/thinking-summaries":{"get":{"tags":["teachers"],"summary":"Assignment Thinking Summaries","description":"Every student's Thinking Summary for this assignment, in one response.\n\nSo a teacher can save the whole class as ONE document instead of opening\neach student and printing them one at a time.\n\nOne row per student — their most recent closed session that HAS a summary.\nAn earlier session is not more informative than a later one here, and\nreturning several per student would put the same name on three pages of the\nsame PDF.\n\nPRIVACY: carries the same SessionDetailRead the single-session view does —\nprivacy-filtered summary prose only, never analyzer output.","operationId":"assignment_thinking_summaries_teachers_assignments__assignment_id__thinking_summaries_get","parameters":[{"name":"assignment_id","in":"path","required":true,"schema":{"type":"integer","title":"Assignment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignmentThinkingSummaries"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/teachers/assignments/{assignment_id}/insights":{"get":{"tags":["teachers"],"summary":"Assignment Insights","description":"Per-student summaries for this assignment.\n\nPRIVACY: every field returned is parsed from `summary.content.text`,\nwhich is the privacy-filtered prose generated by the session summary\nprompt. Analyzer outputs are not consulted.","operationId":"assignment_insights_teachers_assignments__assignment_id__insights_get","parameters":[{"name":"assignment_id","in":"path","required":true,"schema":{"type":"integer","title":"Assignment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignmentInsights"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/teachers/students/{student_id}/development":{"get":{"tags":["teachers"],"summary":"Student Development","operationId":"student_development_teachers_students__student_id__development_get","parameters":[{"name":"student_id","in":"path","required":true,"schema":{"type":"integer","title":"Student Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StudentDevelopmentArc"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/teachers/{teacher_id}/insights":{"get":{"tags":["teachers"],"summary":"Teacher Insights","description":"Aggregated analytics for the teacher's class — engagement rows,\nassignment coverage, behavioral insight cards, and common misconceptions\nclustered across the class.\n\nPRIVACY: every text field returned here is derived from privacy-filtered\nsummary content (or from session metadata like dates and counts). The\nanalyzer JSON is never read.","operationId":"teacher_insights_teachers__teacher_id__insights_get","parameters":[{"name":"teacher_id","in":"path","required":true,"schema":{"type":"integer","title":"Teacher Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeacherInsightsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/teachers/students/{student_id}/timeline":{"get":{"tags":["teachers"],"summary":"Student Timeline","operationId":"student_timeline_teachers_students__student_id__timeline_get","parameters":[{"name":"student_id","in":"path","required":true,"schema":{"type":"integer","title":"Student Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StudentTimelineResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/teachers/{teacher_id}/dashboard/headlines":{"get":{"tags":["teacher-dashboard"],"summary":"Get Dashboard Headlines","operationId":"get_dashboard_headlines_teachers__teacher_id__dashboard_headlines_get","parameters":[{"name":"teacher_id","in":"path","required":true,"schema":{"type":"integer","title":"Teacher Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardHeadlines"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/teachers/{teacher_id}/dashboard/today":{"get":{"tags":["teacher-dashboard"],"summary":"Get Today","description":"What the home page says when a teacher arrives.\n\nThree sentences and the counts behind the three doors. It composes\nsurfaces that already exist and are already scoped, rather than writing a\nfourth query over the same rows:\n\n  * `list_essays_for_teacher_review` for what is waiting — the review\n    queue's own query, so the number on the door and the length of the\n    queue behind it cannot disagree.\n  * `check_in_with` for who has gone quiet.\n  * `teacher_classroom_ids(own_only=True)` for the deadlines, matching\n    both of the above.\n\n`own_only` throughout. An admin who also teaches lands on THEIR morning,\nnot the school's — the school has its own surfaces, and a home page that\nsilently widens for one role is a home page that means something different\ndepending on who you are.","operationId":"get_today_teachers__teacher_id__dashboard_today_get","parameters":[{"name":"teacher_id","in":"path","required":true,"schema":{"type":"integer","title":"Teacher Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeacherToday"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/teachers/{teacher_id}/submissions/out":{"get":{"tags":["teacher-dashboard"],"summary":"Get Submissions Out","description":"What is out right now, per assignment, with both directions of waiting.\n\nThe Submissions page needs three numbers an assignment it is listing: how\nmany students it WENT TO, how many are IN, and how many are waiting on the\nteacher. None of those existed. The review queue is per-essay and returns\nno totals; `student-progress-summary` returns `started_count` and was built\nfor the builder's live-edit warning. So a progress bar on that page would\nhave been a fraction with no denominator, which is the kind of half-truth\nthat makes a teacher stop believing a page.\n\nTHE DEFINITIONS, and they are deliberately the ones already in the\ncodebase rather than new ones:\n\n  handed_in       `submitted_at IS NOT NULL`. State-independent on\n                  purpose: an accepted essay and one pushed back for\n                  revision have both been handed in, and a count that\n                  dropped them when the teacher acted would fall as the\n                  teacher worked.\n\n  waiting_on_you  handed in AND `teacher_review_status` in\n                  (not_yet_reviewed, re_submitted) -- the action-needed\n                  tiers, which is exactly what the home page's\n                  `waiting_on_you` counts and what roster.py's staff\n                  directory counts. A teacher who reads one number on the\n                  home page and a different one here stops trusting both.\n\n  sent_back       handed in, sent back by the teacher, and not returned\n                  yet (`state == submitted_revising`). Still inside\n                  `handed_in`, whose meaning does not change.\n\n  waiting_on_them everyone who has not handed in, PLUS everyone holding a\n                  sent-back essay. It was only the first half, so a class\n                  where six essays had gone back for revision read as\n                  waiting on nobody.\n\n  students_total  the per-student TARGETS when the assignment has any,\n                  else the roster of its classroom. An assignment with\n                  targets went to those students; reporting \"4 of 24 in\"\n                  for a make-up sent to four people is a progress bar that\n                  is wrong by design.\n\nScope is `own_only`: this is a page about the teacher's own week. A school\nadmin acting as a teacher gets that teacher's classes, which is what\nrequire_teacher_identity already decided.","operationId":"get_submissions_out_teachers__teacher_id__submissions_out_get","parameters":[{"name":"teacher_id","in":"path","required":true,"schema":{"type":"integer","title":"Teacher Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmissionsOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/teachers/{teacher_id}/dashboard/insights":{"get":{"tags":["teacher-dashboard"],"summary":"Get Insights","description":"Combined insights payload — all six sections in one request.\n\nperiod ∈ {30d, term, year}. Defaults to term (90 days). Cache layer\nnot implemented yet — compute runs on every call. For a single\nteacher this is fast enough.","operationId":"get_insights_teachers__teacher_id__dashboard_insights_get","parameters":[{"name":"teacher_id","in":"path","required":true,"schema":{"type":"integer","title":"Teacher Id"}},{"name":"period","in":"query","required":false,"schema":{"type":"string","default":"term","title":"Period"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsightsPayload"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/teachers/{teacher_id}/dashboard/observations/{pattern_key}/responses":{"post":{"tags":["teacher-dashboard"],"summary":"Post Observation Response","description":"Record a teacher's response on a Dive Deeper observation.\n\nIdempotent for `response_type=handled` — at most one Handled record\nper (teacher, pattern_key); a second POST returns the existing row\nrather than creating a duplicate. `response_type=long_form` appends a\nnew row each time.\n\nThe pattern_key path segment uses :path so the colon-separated\n`{pattern_type}:{cluster_id}:teacher_{id}` identifier survives URL\nparsing without needing to be encoded.","operationId":"post_observation_response_teachers__teacher_id__dashboard_observations__pattern_key__responses_post","parameters":[{"name":"teacher_id","in":"path","required":true,"schema":{"type":"integer","title":"Teacher Id"}},{"name":"pattern_key","in":"path","required":true,"schema":{"type":"string","title":"Pattern Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeacherResponseCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeacherResponseRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/teachers/{teacher_id}/dashboard/responses/{response_id}":{"patch":{"tags":["teacher-dashboard"],"summary":"Patch Observation Response","description":"Edit a long_form teacher response in place.\n\nHandled rows are not editable — they have no text. Revoke + re-post\nif a teacher needs to change the timestamp on a Handled mark.","operationId":"patch_observation_response_teachers__teacher_id__dashboard_responses__response_id__patch","parameters":[{"name":"teacher_id","in":"path","required":true,"schema":{"type":"integer","title":"Teacher Id"}},{"name":"response_id","in":"path","required":true,"schema":{"type":"integer","title":"Response Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeacherResponsePatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeacherResponseRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["teacher-dashboard"],"summary":"Delete Observation Response","description":"Delete a teacher response.\n\nWorks for both handled (revokes the acknowledgement) and long_form\n(removes the note). 204 on success; 404 if the row doesn't exist or\nbelongs to a different teacher.","operationId":"delete_observation_response_teachers__teacher_id__dashboard_responses__response_id__delete","parameters":[{"name":"teacher_id","in":"path","required":true,"schema":{"type":"integer","title":"Teacher Id"}},{"name":"response_id","in":"path","required":true,"schema":{"type":"integer","title":"Response Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/teachers/{teacher_id}/ask":{"post":{"tags":["teacher-ask"],"summary":"Ask","operationId":"ask_teachers__teacher_id__ask_post","parameters":[{"name":"teacher_id","in":"path","required":true,"schema":{"type":"integer","title":"Teacher Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AskRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AskAnswer"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/teachers/{teacher_id}/ask/stream":{"post":{"tags":["teacher-ask"],"summary":"Ask Stream","description":"The same answer as POST /ask, with the sentences sent ahead of the actions.\n\nServer-sent events: `{\"delta\": \"…\"}` for each stretch of the answer, then\none `{\"done\": true, \"answer\": …, \"actions\": […]}`. A failure after the\nstream has opened is an `{\"error\", \"status\"}` frame, because the status\nline has already gone out as 200 by then.","operationId":"ask_stream_teachers__teacher_id__ask_stream_post","parameters":[{"name":"teacher_id","in":"path","required":true,"schema":{"type":"integer","title":"Teacher Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AskRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/teachers/{teacher_id}/ask/preview":{"post":{"tags":["teacher-ask"],"summary":"Preview Write","description":"Count the cost. Writes nothing, and is safe to call repeatedly.","operationId":"preview_write_teachers__teacher_id__ask_preview_post","parameters":[{"name":"teacher_id","in":"path","required":true,"schema":{"type":"integer","title":"Teacher Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WriteAction"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WritePreview"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/teachers/{teacher_id}/ask/do":{"post":{"tags":["teacher-ask"],"summary":"Do Write","description":"Do it — if nothing has moved since the teacher was shown the cost.\n\nA 409 here is not a failure; it means a fifth student started while the\nteacher was deciding, and somebody who agreed to shut out four has not\nagreed to shut out five. The surface re-previews and asks again.","operationId":"do_write_teachers__teacher_id__ask_do_post","parameters":[{"name":"teacher_id","in":"path","required":true,"schema":{"type":"integer","title":"Teacher Id"}},{"name":"confirm_token","in":"query","required":true,"schema":{"type":"string","title":"Confirm Token"}},{"name":"typed","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Typed"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WriteAction"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WriteResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/schools":{"get":{"tags":["roster"],"summary":"List Schools","operationId":"list_schools_schools_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/SchoolRead"},"type":"array","title":"Response List Schools Schools Get"}}}}}},"post":{"tags":["roster"],"summary":"Create School","operationId":"create_school_schools_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SchoolCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SchoolRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/schools/{school_id}/teachers":{"get":{"tags":["roster"],"summary":"List School Teachers","description":"Teachers in a school — the second step of the student login picker.\nschool_admin accounts are excluded (they're not class-owning teachers a\nstudent would pick).","operationId":"list_school_teachers_schools__school_id__teachers_get","parameters":[{"name":"school_id","in":"path","required":true,"schema":{"type":"integer","title":"School Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TeacherPublic"},"title":"Response List School Teachers Schools  School Id  Teachers Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["roster"],"summary":"Create School Teacher","description":"Add a teacher to this school, and issue their access code.\n\nThey start with nothing — no classes, no students, no assignments — and\nbuild their own. That is the model, so this deliberately seeds none of it.\n\nThe code is returned exactly once. Nothing reads it back.","operationId":"create_school_teacher_schools__school_id__teachers_post","parameters":[{"name":"school_id","in":"path","required":true,"schema":{"type":"integer","title":"School Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SchoolTeacherCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SchoolTeacherCreated"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/roster/login":{"post":{"tags":["roster"],"summary":"Roster Login","description":"Resolve (chosen teacher, typed access code) → the Student + Classroom.\nFails closed with 404 so a wrong code can't be told from a wrong teacher.","operationId":"roster_login_roster_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RosterLoginRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RosterLoginResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/roster/login-by-code":{"post":{"tags":["roster"],"summary":"Roster Login By Code","description":"Resolve a student from their access code alone (codes are globally\nunique) — the lowest-friction student sign-in. Fails closed with 404.\n\nRate limited, and this is the endpoint the limit was written for. A\nstudent's code is 6 characters from a 31-character alphabet, but an\nattacker is not after one student: EVERY enrolled student is a winning\nticket, so the expected work is the keyspace divided by the roll. At a\nthousand students that was roughly 75 minutes of unthrottled guessing for\nsomebody's essays and braindumps.","operationId":"roster_login_by_code_roster_login_by_code_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CodeLoginRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RosterLoginResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/teachers/{teacher_id}/classrooms":{"get":{"tags":["roster"],"summary":"List Classrooms","operationId":"list_classrooms_teachers__teacher_id__classrooms_get","parameters":[{"name":"teacher_id","in":"path","required":true,"schema":{"type":"integer","title":"Teacher Id"}},{"name":"scope","in":"query","required":false,"schema":{"enum":["mine","school"],"type":"string","default":"school","title":"Scope"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ClassroomRead"},"title":"Response List Classrooms Teachers  Teacher Id  Classrooms Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["roster"],"summary":"Create Classroom","description":"Create a class. Under a school that requires approval, ASK to create it.\n\nThe 202 is the whole shape of roster governance on the wire: the teacher\ndoes the same thing in every mode, and the school's policy decides whether\nit happened or was asked for. A separate \"request\" endpoint would have made\nthe teacher's client pick which verb to use, i.e. enforce the policy\nclient-side, which is not enforcement.","operationId":"create_classroom_teachers__teacher_id__classrooms_post","parameters":[{"name":"teacher_id","in":"path","required":true,"schema":{"type":"integer","title":"Teacher Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClassroomCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClassroomRead"}}}},"202":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RosterRequestRead"}}},"description":"Accepted"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/classrooms/{classroom_id}":{"patch":{"tags":["roster"],"summary":"Update Classroom","description":"Registrar edit of class metadata (name / description / period / term).","operationId":"update_classroom_classrooms__classroom_id__patch","parameters":[{"name":"classroom_id","in":"path","required":true,"schema":{"type":"integer","title":"Classroom Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClassroomUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClassroomRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["roster"],"summary":"Delete Classroom","description":"Delete a class AND the students seeded in it.\n\n(That is the original description. What it does now is ARCHIVE: the class\nand its enrolments go, students and their work stay with the school, and\nthe class can be restored at any time.) Three things guard it:\n\n  1. The caller must BE the owning teacher, proven by their per-teacher\n     capability token. This is the real gate, and it replaces a weaker one.\n     The original required the owning teacher's `code` on the reasoning\n     that \"a valid teacher token is not enough\" — but the /teachers router\n     is open to the shared token, and GET /teachers returns `code` for\n     every teacher. Anyone holding the shared token could read the code and\n     then delete the class. The gate was one GET from theatre.\n  2. `confirm_code` must still match — the teacher's ACCESS CODE now, which\n     is random and returned by no endpoint, falling back to the readable\n     handle only for a teacher not yet issued one. Deliberate friction on\n     an irreversible action, not the security boundary; (1) is.\n  3. Students enrolled in another class are unenrolled, never deleted.\n\nAn admin may delete without being the owning teacher: the admin token is\nthe deployment's root authority, and gating it behind a teacher's personal\ncredential would leave a class nobody could remove if that teacher left.\n\nReturns what actually went, so the caller can report it rather than guess.","operationId":"delete_classroom_classrooms__classroom_id__delete","parameters":[{"name":"classroom_id","in":"path","required":true,"schema":{"type":"integer","title":"Classroom Id"}},{"name":"confirm_code","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"the owning teacher's access code (older clients)","title":"Confirm Code"},"description":"the owning teacher's access code (older clients)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClassroomDeletionPreview"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/classrooms/{classroom_id}/documents":{"post":{"tags":["roster"],"summary":"Add Class Documents","description":"Add one or more documents to a class: a syllabus, a class policy, a\nunit's own syllabus. ADDED, never replacing: a teacher who uploads Unit 3's\nsyllabus in November keeps the policy they uploaded in August. Returns the\nclass's whole list, in order.\n\nEvery file passes the upload gate before it is filed. A spreadsheet is\nrefused (422, use the roster import) and none of the batch is added; a\nfile that may be a roster, grades or student work is filed HELD, listed\nwith its reasons, and read by nothing until the teacher confirms it.","operationId":"add_class_documents_classrooms__classroom_id__documents_post","parameters":[{"name":"classroom_id","in":"path","required":true,"schema":{"type":"integer","title":"Classroom Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_add_class_documents_classrooms__classroom_id__documents_post"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ClassDocumentRead"},"title":"Response Add Class Documents Classrooms  Classroom Id  Documents Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["roster"],"summary":"List Class Documents","operationId":"list_class_documents_classrooms__classroom_id__documents_get","parameters":[{"name":"classroom_id","in":"path","required":true,"schema":{"type":"integer","title":"Classroom Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ClassDocumentRead"},"title":"Response List Class Documents Classrooms  Classroom Id  Documents Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/classrooms/{classroom_id}/documents/{document_id}":{"get":{"tags":["roster"],"summary":"Download Class Document","operationId":"download_class_document_classrooms__classroom_id__documents__document_id__get","parameters":[{"name":"classroom_id","in":"path","required":true,"schema":{"type":"integer","title":"Classroom Id"}},{"name":"document_id","in":"path","required":true,"schema":{"type":"integer","title":"Document Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["roster"],"summary":"Remove Class Document","description":"Take a document off the class. The units and outcomes already read out\nof it stay: they are the teacher's plan now, and the plan is only ever\nadded to by a reading, never taken from.","operationId":"remove_class_document_classrooms__classroom_id__documents__document_id__delete","parameters":[{"name":"classroom_id","in":"path","required":true,"schema":{"type":"integer","title":"Classroom Id"}},{"name":"document_id","in":"path","required":true,"schema":{"type":"integer","title":"Document Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ClassDocumentRead"},"title":"Response Remove Class Document Classrooms  Classroom Id  Documents  Document Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/classrooms/{classroom_id}/documents/{document_id}/confirm":{"post":{"tags":["roster"],"summary":"Confirm Class Document","description":"The teacher says a held document is curriculum. From now on it is read\nlike any other: into the cache, the course plan and each unit's drafts.\nWho said so and when is kept on the row and in the audit log. The\noutbound guard still redacts any known identifier in it on the way out.","operationId":"confirm_class_document_classrooms__classroom_id__documents__document_id__confirm_post","parameters":[{"name":"classroom_id","in":"path","required":true,"schema":{"type":"integer","title":"Classroom Id"}},{"name":"document_id","in":"path","required":true,"schema":{"type":"integer","title":"Document Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ClassDocumentRead"},"title":"Response Confirm Class Document Classrooms  Classroom Id  Documents  Document Id  Confirm Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/classrooms/{classroom_id}/syllabus":{"post":{"tags":["roster"],"summary":"Upload Syllabus","description":"Attach a class's syllabus, REPLACING every document it has.\n\nThe one-file route, kept for the registrar console, whose button means\n\"this is the syllabus\". Teachers add documents through\n`POST /classrooms/{id}/documents`, which keeps what is there.\n\nScreened by the upload gate like every class document: a spreadsheet is\nrefused before anything is replaced, and a held syllabus is filed but read\nby nothing (`syllabus_screen_status` on the class says so) until\n`POST /classrooms/{id}/syllabus/confirm`. Replacing it is uploading again.","operationId":"upload_syllabus_classrooms__classroom_id__syllabus_post","parameters":[{"name":"classroom_id","in":"path","required":true,"schema":{"type":"integer","title":"Classroom Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_syllabus_classrooms__classroom_id__syllabus_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClassroomRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["roster"],"summary":"Download Syllabus","description":"Download a class's first document.","operationId":"download_syllabus_classrooms__classroom_id__syllabus_get","parameters":[{"name":"classroom_id","in":"path","required":true,"schema":{"type":"integer","title":"Classroom Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/classrooms/{classroom_id}/syllabus/confirm":{"post":{"tags":["roster"],"summary":"Confirm Syllabus","description":"The registrar console's confirm: every held document on the class is\ncurriculum. The console attaches one file and shows the class row, so it\nconfirms by class rather than by document id.","operationId":"confirm_syllabus_classrooms__classroom_id__syllabus_confirm_post","parameters":[{"name":"classroom_id","in":"path","required":true,"schema":{"type":"integer","title":"Classroom Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClassroomRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/schools/{school_id}/staff":{"get":{"tags":["roster"],"summary":"School Staff","description":"This school's teachers, with what each has actually built.\n\nAdoption is what a pilot dies of first, so the numbers here are all about\nwhether a teacher has started, not how well they are doing.","operationId":"school_staff_schools__school_id__staff_get","parameters":[{"name":"school_id","in":"path","required":true,"schema":{"type":"integer","title":"School Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SchoolStaffRow"},"title":"Response School Staff Schools  School Id  Staff Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/schools/{school_id}/teachers/{teacher_id}/invite":{"post":{"tags":["roster"],"summary":"Invite School Teacher","description":"Email a teacher their invite — the first one, or a fresh one.\n\nDeliberately NOT like reissuing a code, in the one way that matters: this\ndoes not touch `public_token`. Reissuing signs the teacher out everywhere,\nbecause a reissued code means the old one is compromised or the person has\nleft. A resent invite means an email went to spam. Signing somebody out of\na session they are mid-sentence in, because an admin pressed \"resend\",\nwould be a punishment for the admin's helpfulness.\n\nREFUSED ON A CLAIMED ACCOUNT. An invite sets the address on arrival, so\nsending one to somebody who already has a password would be a way to\nre-point a working account at a new mailbox — an admin-initiated account\ntakeover, reachable from the staff page by a button labelled \"invite\".\nSomebody who has a password and has lost it uses the reset flow, which\nproves they hold the address rather than asserting it.","operationId":"invite_school_teacher_schools__school_id__teachers__teacher_id__invite_post","parameters":[{"name":"school_id","in":"path","required":true,"schema":{"type":"integer","title":"School Id"}},{"name":"teacher_id","in":"path","required":true,"schema":{"type":"integer","title":"Teacher Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SchoolTeacherInvite"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StaffInviteSent"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/schools/{school_id}/teachers/{teacher_id}/access-code":{"post":{"tags":["roster"],"summary":"Reissue School Teacher Code","description":"Issue a fresh access code for one of this school's teachers.\n\nThe path a teacher who lost their code takes, and the one that gets a\nnever-issued teacher started. Reissuing INVALIDATES the old token, so\nanyone signed in with it is signed out — that is what reissuing is for.\n\nIt is a management action on SOMEBODY ELSE, and it refuses to be turned on\nthe person asking. Two reasons, and the second is the real one:\n\n  * It is a footgun. Reissuing clears public_token, so a school admin who\n    pressed it on their own row signed themselves out mid-session and had\n    to find the new code before they could get back in.\n\n  * It is not the same feature. \"Rotate my credential, knowing it signs me\n    out\" is a deliberate self-service action with its own confirmation;\n    this is the roster screen, where every other row is someone you\n    administer. Letting one button mean both makes the destructive one\n    reachable by muscle memory.\n\nBlocked for everyone, including a platform admin on their own row. Recovery\nfor a lost platform-admin code is scripts/bootstrap_platform.py, which is\nthe only path that does not require already being signed in.","operationId":"reissue_school_teacher_code_schools__school_id__teachers__teacher_id__access_code_post","parameters":[{"name":"school_id","in":"path","required":true,"schema":{"type":"integer","title":"School Id"}},{"name":"teacher_id","in":"path","required":true,"schema":{"type":"integer","title":"Teacher Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SchoolTeacherCreated"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/schools/{school_id}/teachers/{teacher_id}/role":{"patch":{"tags":["roster"],"summary":"Change School Teacher Role","description":"Change what one member of staff can see: teacher, school admin, or\nsafeguarding and wellbeing.\n\nThe role was fixed at the moment somebody was added. A teacher who became\nthe school's counsellor, or an admin picked by mistake, could only be put\nright by removing them and adding them again, which loses their classes.\n\nIt is a management action on SOMEBODY ELSE, like reissuing a code, and it\nrefuses the cases that would leave the school worse off than before:\n\n  * your own role          an admin who demotes themselves has locked the\n                           door behind them; another admin does it\n  * the last school admin  a school with none cannot add staff, hand over a\n                           class or change this back\n  * a platform admin       not a role a school hands out or takes away\n  * someone who has left   there is nothing for the role to apply to\n  * a teacher with classes becoming safeguarding-and-wellbeing: that\n                           account has no classes page, so the classes\n                           would be running with nobody able to open them.\n                           Hand them over first.\n\nThe person is signed out, so they come back in to the right pages rather\nthan carrying on in the old ones. Their code, password and email are kept:\nthis changes what they see, not how they sign in.","operationId":"change_school_teacher_role_schools__school_id__teachers__teacher_id__role_patch","parameters":[{"name":"school_id","in":"path","required":true,"schema":{"type":"integer","title":"School Id"}},{"name":"teacher_id","in":"path","required":true,"schema":{"type":"integer","title":"Teacher Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SchoolTeacherRoleChange"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SchoolTeacherRoleChanged"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/teachers/{teacher_id}/restorable-classrooms":{"get":{"tags":["roster"],"summary":"Restorable Classrooms","description":"Classes this teacher archived, newest first.\n\nEvery one that has not already been restored, however long ago: an entry\nin this list is a promise that restoring it will work.","operationId":"restorable_classrooms_teachers__teacher_id__restorable_classrooms_get","parameters":[{"name":"teacher_id","in":"path","required":true,"schema":{"type":"integer","title":"Teacher Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RestorableClassroom"},"title":"Response Restorable Classrooms Teachers  Teacher Id  Restorable Classrooms Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/classrooms/restore/{archive_id}":{"post":{"tags":["roster"],"summary":"Restore Classroom","description":"Bring back a deleted class, its students, and all their work.\n\nGated the same way the deletion was — the OWNING teacher's access code, not\nmerely a valid teacher token. Restoring re-creates student accounts and\ntheir writing; it should not be reachable by anyone who could not have\ndeleted the class in the first place.","operationId":"restore_classroom_classrooms_restore__archive_id__post","parameters":[{"name":"archive_id","in":"path","required":true,"schema":{"type":"integer","title":"Archive Id"}},{"name":"confirm_code","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"the owning teacher's access code (older clients)","title":"Confirm Code"},"description":"the owning teacher's access code (older clients)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClassroomRestoreResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/classrooms/archives/{archive_id}/deletion-code":{"post":{"tags":["roster"],"summary":"Request Archive Deletion Code","description":"Step one of deleting an archived class for good: the password, then a\ncode to the teacher's inbox.\n\nThe password is what archiving and restoring already ask for, and it is\nfriction. The code is the real second factor, for the reason\nschool_deletion gives: the way this goes wrong is not a misclick, it is a\nsession left open on a laptop, and a typed password proves less than a\ncode read out of the owner's own mail.","operationId":"request_archive_deletion_code_classrooms_archives__archive_id__deletion_code_post","parameters":[{"name":"archive_id","in":"path","required":true,"schema":{"type":"integer","title":"Archive Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Request Archive Deletion Code Classrooms Archives  Archive Id  Deletion Code Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/classrooms/archives/{archive_id}/delete":{"post":{"tags":["roster"],"summary":"Delete Archive Permanently","description":"Step two: spend the code, and the archived class is gone for good.\n\nWhat goes is the archive: the class, its roster, and which assignments\nwere its. The students were never in it (they belong to the school) and\nneither was anything they wrote, so both are untouched, and the class's\nassignments stay in the teacher's list without a class.","operationId":"delete_archive_permanently_classrooms_archives__archive_id__delete_post","parameters":[{"name":"archive_id","in":"path","required":true,"schema":{"type":"integer","title":"Archive Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArchiveDeleteConfirm"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete Archive Permanently Classrooms Archives  Archive Id  Delete Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/classrooms/{classroom_id}/deletion-preview":{"get":{"tags":["roster"],"summary":"Classroom Deletion Preview","description":"What deleting this class would actually destroy, so the confirmation can\nname real numbers instead of a generic warning.","operationId":"classroom_deletion_preview_classrooms__classroom_id__deletion_preview_get","parameters":[{"name":"classroom_id","in":"path","required":true,"schema":{"type":"integer","title":"Classroom Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClassroomDeletionPreview"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/classrooms/{classroom_id}/syllabus/autofill":{"post":{"tags":["roster"],"summary":"Autofill From Syllabus","description":"Read the syllabus and auto-populate units (+ fill an empty description).\n\nKEPT, and now a thin wrapper over analyze-then-commit-all. The registrar\nconsole calls this and should keep working exactly as it did — but it must\nnot be a SECOND extraction with its own prompt, because two prompts drift\nand the console quietly becomes worse than the course page beside it.\n\nIt writes without review, which is the behaviour it has always had and is\ndefensible for a class with nothing in it yet. It now REFUSES a class that\nalready has units, because pressing it twice duplicated everything — see\nthe comment below, which has the measurements. The reviewed path is\n`analyze` → edit → `POST /classrooms/{id}/course-plan`, and that is where\na re-read belongs.","operationId":"autofill_from_syllabus_classrooms__classroom_id__syllabus_autofill_post","parameters":[{"name":"classroom_id","in":"path","required":true,"schema":{"type":"integer","title":"Classroom Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyllabusAutofillResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/classrooms/{classroom_id}/roster":{"get":{"tags":["roster"],"summary":"Classroom Roster","operationId":"classroom_roster_classrooms__classroom_id__roster_get","parameters":[{"name":"classroom_id","in":"path","required":true,"schema":{"type":"integer","title":"Classroom Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RosterEntry"},"title":"Response Classroom Roster Classrooms  Classroom Id  Roster Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/classrooms/{classroom_id}/roster.csv":{"get":{"tags":["roster"],"summary":"Classroom Roster Codes Csv","description":"The class's names and login codes as a spreadsheet, to print and hand out (#375).\n\nThe same rule as the roster above, and no wider: this file holds exactly\nthe codes that page shows in the clear, the class's teachers' — the owner\nand a co-teacher (_code_holder). The gate is require_classroom_access, so\nSupport (read-only staff) never reaches it, as they never reach the roster.\n\nAn admin passes that gate but sees the roster MASKED, and reveals codes\none at a time, each leaving a CredentialAccess row. A bulk download for\nthem would be every one of those reveals at once with no record — the\nthing the masking exists to prevent — so they are refused here and\npointed back at the roster.\n\nA co-teacher's download is recorded; the owner's is not, as the owner's\nreveal is not. The record is one CredentialAccess row per student in the\nfile (action \"export_csv\"), all stamped with the same moment: that says\nwho, which class, when, and also which credentials left, without storing\na code. Per student rather than one row per download because the table\nkeys on the enrollment, and widening it would mean a migration racing the\ntwo open 0130s. Written and committed before the file is returned, so a\nfailure to record is a failure to download, the rule reveal-code keeps.\n\nEvery enrolled student is a row, with or without an email: the code is a\nfirst-class way in, not a fallback. A code that is switched off is still\nlisted, marked, so nobody hands out a slip that cannot work without\nknowing it.\n\nNothing here is logged. The response is marked no-store so a shared\nmachine does not keep a copy of a class's credentials in its cache.","operationId":"classroom_roster_codes_csv_classrooms__classroom_id__roster_csv_get","parameters":[{"name":"classroom_id","in":"path","required":true,"schema":{"type":"integer","title":"Classroom Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/classrooms/{classroom_id}/enrollments":{"post":{"tags":["roster"],"summary":"Enroll","description":"Enrol an existing student. Under `directory`, this is the sanctioned path.\n\nThe policy gate runs BEFORE the directory membership check so that\n`admin_only` and `approve` answer first — otherwise a school in\n`admin_only` would leak whether a given student is on its list.","operationId":"enroll_classrooms__classroom_id__enrollments_post","parameters":[{"name":"classroom_id","in":"path","required":true,"schema":{"type":"integer","title":"Classroom Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrollmentCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrollmentRead"}}}},"202":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RosterRequestRead"}}},"description":"Accepted"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/classrooms/{classroom_id}/students":{"post":{"tags":["roster"],"summary":"Add Roster Student","description":"Teacher adds a student to a classroom: finds or creates the Student\n(inheriting the classroom's school) and enrolls them, minting the access\ncode — in one teacher-authorized call (so it works without the admin token,\nunlike POST /students).\n\nThis is the endpoint roster governance exists for. Under `approve` it\nanswers 202 with the request instead, and NO Student, Enrollment or access\ncode is created until an admin says yes.\n\nIT NO LONGER ALWAYS CREATES. It used to, every time, so a child added by\ntwo teachers was two accounts with their work split between them. Given an\naddress somebody at this school already has, it enrols THAT student and\nsays so (`matched_existing`); given one from another school it refuses.\nroster_lib.student_for_add is the whole rule.\n\nNothing is emailed to the student. They ask for a sign-in code the first\ntime they sign in, and until then their teacher has the access code this\nreturns, exactly as before.","operationId":"add_roster_student_classrooms__classroom_id__students_post","parameters":[{"name":"classroom_id","in":"path","required":true,"schema":{"type":"integer","title":"Classroom Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RosterStudentCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RosterEntry"}}}},"202":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RosterRequestRead"}}},"description":"Accepted"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/enrollments/{enrollment_id}/reveal-code":{"post":{"tags":["roster"],"summary":"Reveal Code","description":"Read one student's access code, and leave a mark.\n\nThe teacher who owns the class already has every code on the roster and\nnever comes here. This exists for the width above them, where the roster\narrives masked: an admin setting up a class in the first week, or picking\nup after a teacher who left.\n\nIt is not a gate — nobody is refused — so the audit row is the entire\npoint. Reading a child's credential should be recoverable afterwards, the\nway reading a safeguarding disclosure is. A gate that an administrator can\nalways open teaches people to route around it; a record they cannot erase\ndoes not.\n\nAppend-only: written before the code is returned, so a failure to log is a\nfailure to reveal rather than a silent read.","operationId":"reveal_code_enrollments__enrollment_id__reveal_code_post","parameters":[{"name":"enrollment_id","in":"path","required":true,"schema":{"type":"integer","title":"Enrollment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrollmentRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/enrollments/{enrollment_id}/regenerate-code":{"post":{"tags":["roster"],"summary":"Regenerate Code","operationId":"regenerate_code_enrollments__enrollment_id__regenerate_code_post","parameters":[{"name":"enrollment_id","in":"path","required":true,"schema":{"type":"integer","title":"Enrollment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrollmentRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/enrollments/{enrollment_id}/deactivate-code":{"post":{"tags":["roster"],"summary":"Deactivate Code","operationId":"deactivate_code_enrollments__enrollment_id__deactivate_code_post","parameters":[{"name":"enrollment_id","in":"path","required":true,"schema":{"type":"integer","title":"Enrollment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrollmentRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/enrollments/{enrollment_id}/activate-code":{"post":{"tags":["roster"],"summary":"Activate Code","operationId":"activate_code_enrollments__enrollment_id__activate_code_post","parameters":[{"name":"enrollment_id","in":"path","required":true,"schema":{"type":"integer","title":"Enrollment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrollmentRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/enrollments/{enrollment_id}":{"delete":{"tags":["roster"],"summary":"Unenroll","description":"Remove a student from a class (deletes the enrollment). The Student and\nall their work are untouched — history binds to the Student, not the\nenrollment.","operationId":"unenroll_enrollments__enrollment_id__delete","parameters":[{"name":"enrollment_id","in":"path","required":true,"schema":{"type":"integer","title":"Enrollment Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/enrollments/{enrollment_id}/move":{"post":{"tags":["roster"],"summary":"Move Enrollment","description":"Move a student to another class (leaves the current one). Copy — being in\nboth — is a plain POST /classrooms/{id}/enrollments on the destination.\n\nBOTH ends are checked. The route dependency covers the source enrollment;\nthe destination arrives in the body, which a dependency cannot read, so it\nis authorized here. Checking only the source would leave the worst version\nof this bug intact — a teacher moving another school's student INTO their\nown class, which is what a running server let them do.","operationId":"move_enrollment_enrollments__enrollment_id__move_post","parameters":[{"name":"enrollment_id","in":"path","required":true,"schema":{"type":"integer","title":"Enrollment Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrollmentMove"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrollmentRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/classrooms/{classroom_id}/roster-import":{"post":{"tags":["roster"],"summary":"Classroom Roster Import","description":"Import a teacher's own class list into ONE classroom.\n\nThe school-level import below is the registrar's path: admin-only, and it\nneeds a sis_id or email on every row so students dedup across a school. A\nteacher has a column of names — this takes that. Only `name` is required;\nsis_id, email, grade and age are used when present. Idempotent, and it\nnever removes anyone: a student dropped from the file keeps their place and\ntheir work.","operationId":"classroom_roster_import_classrooms__classroom_id__roster_import_post","parameters":[{"name":"classroom_id","in":"path","required":true,"schema":{"type":"integer","title":"Classroom Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_classroom_roster_import_classrooms__classroom_id__roster_import_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RosterImportResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/schools/{school_id}/roster-import":{"post":{"tags":["roster"],"summary":"Roster Import","description":"Registrar CSV import into a school. OneRoster-shaped columns (sis_id,\nname, grade, age, email, code, class, teacher_code). Idempotent: upserts\nstudents by sis_id (then email) and enrolls them — re-importing updates in\nplace, never duplicates.\n\nNEVER governed by the school's roster policy, deliberately. This route is\nalready admin-only, so it IS the school-authorized path by construction —\nit is how the directory that `directory` mode reads from gets filled.\nApplying the policy here would let a setting the school chose lock the\nschool's own registrar out of the only bulk path that dedups on sis_id.","operationId":"roster_import_schools__school_id__roster_import_post","parameters":[{"name":"school_id","in":"path","required":true,"schema":{"type":"integer","title":"School Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_roster_import_schools__school_id__roster_import_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RosterImportResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/schools/{school_id}/roster-policy":{"get":{"tags":["roster"],"summary":"Read Roster Policy","description":"What this school lets its teachers do.\n\nREAD IS DELIBERATELY WIDER THAN WRITE. Any teacher at this school may read\nit, not only the admins who may set it — because the teacher's own roster\nscreen has to render the right affordances, and a teacher who cannot read\nthe policy discovers it by getting a 403 halfway through typing a student's\nname. If you are about to \"unify\" this with the PATCH authorizer below,\nthat is what you would be shipping.","operationId":"read_roster_policy_schools__school_id__roster_policy_get","parameters":[{"name":"school_id","in":"path","required":true,"schema":{"type":"integer","title":"School Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RosterPolicyRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["roster"],"summary":"Update Roster Policy","description":"Set what this school lets its teachers do. Its admins only.\n\nReuses authorize_school_action rather than inventing an authorizer: it\nalready returns exactly the three widths that may do this, and already\nrefuses a plain teacher for their own school on the reasoning that a role\nwhich can create accounts can create one for itself with a wider role.\nChanging what every colleague may do is the same class of act.\n\nPartial — only the settings present in the body change. Existing classes\nand students are never touched: this governs what happens next.","operationId":"update_roster_policy_schools__school_id__roster_policy_patch","parameters":[{"name":"school_id","in":"path","required":true,"schema":{"type":"integer","title":"School Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RosterPolicyUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RosterPolicyRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/schools/{school_id}/hours":{"get":{"tags":["roster"],"summary":"Read School Hours","description":"When this school is open. Its admins only — nothing a teacher's screen\nrenders depends on it.","operationId":"read_school_hours_schools__school_id__hours_get","parameters":[{"name":"school_id","in":"path","required":true,"schema":{"type":"integer","title":"School Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SchoolHoursRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["roster"],"summary":"Update School Hours","description":"Set when this school is open, and where it is. Its admins only.\n\nThis is also the one place a school's timezone is set ON PURPOSE. Until\nnow it was whatever the first teacher's browser said\n(roster.remember_school_timezone), which is right nearly always and\nuncorrectable when it is not.\n\nEvery value is validated rather than stored as given: these feed what a\nstudent in crisis is told about who can reach them, and a typo that reads\nas \"always closed\" or \"always open\" is a wrong sentence on that screen.","operationId":"update_school_hours_schools__school_id__hours_patch","parameters":[{"name":"school_id","in":"path","required":true,"schema":{"type":"integer","title":"School Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SchoolHoursUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SchoolHoursRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/schools/{school_id}/directory":{"get":{"tags":["roster"],"summary":"School Directory","description":"The school's student list, for the enroll-from-directory picker.\n\nScoped by the classroom being filled when one is named — that is the\nordinary case and it is the narrower check. Without one, this is an\nadmin-shaped read of the whole school and is gated as such.\n\nNever carries an access code: DirectoryStudent has no such field. A teacher\nbrowsing the directory is by definition looking at students who are not\ntheirs yet, and handing over a working credential is the exact bug\nrequire_classroom_access exists to close.","operationId":"school_directory_schools__school_id__directory_get","parameters":[{"name":"school_id","in":"path","required":true,"schema":{"type":"integer","title":"School Id"}},{"name":"classroom_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Classroom Id"}},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Q"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":200,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DirectoryStudent"},"title":"Response School Directory Schools  School Id  Directory Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/schools/{school_id}/roster-requests":{"get":{"tags":["roster"],"summary":"List Roster Requests","description":"The approval queue for this school. Its admins only.","operationId":"list_roster_requests_schools__school_id__roster_requests_get","parameters":[{"name":"school_id","in":"path","required":true,"schema":{"type":"integer","title":"School Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":"pending","title":"Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RosterRequestRead"},"title":"Response List Roster Requests Schools  School Id  Roster Requests Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/roster-requests/{request_id}/decision":{"post":{"tags":["roster"],"summary":"Decide Roster Request","description":"Approve or reject one request.\n\nONE endpoint for both, mirroring converge_moderation.resolve: one\ndispatcher, one idempotency guard, one place the cross-school check lives.\n\nThe row is loaded BEFORE authorizing, and the school is read off the row\nrather than from the path or body. That makes \"a school admin cannot decide\nanother school's request\" true by construction rather than by a filter\nsomebody can forget.\n\nApproving twice is a no-op that returns what the first approval made — the\nguard is what stops a double-click minting a second access code and\nsilently invalidating the first.","operationId":"decide_roster_request_roster_requests__request_id__decision_post","parameters":[{"name":"request_id","in":"path","required":true,"schema":{"type":"integer","title":"Request Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RosterRequestDecide"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RosterRequestRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/students/{student_id}/email":{"put":{"tags":["roster"],"summary":"Set Student Email","description":"Put an address on a student, or change the one they have.\n\nAuthorized by authorize_student_access, which is already exactly this\nwidth: a teacher for a student enrolled in a class of theirs, a school\nadmin for anyone at their school, the operator widths above that. No new\nauthorizer — a second one for \"may touch this student\" is how the two\nwould come to disagree. It answers 404, not 403, for a student out of\nscope, so this cannot be used to find out who exists.\n\nTheir access codes are untouched and keep working. Nothing is emailed.\n\nWHEN ANOTHER STUDENT AT THIS SCHOOL HAS THE ADDRESS the answer is a 409\nwhose detail carries both of them — name, classes, how many sessions — so\nthe screen can put them side by side. That is nearly always the same child\nadded twice, and merging them is the fix; it is a school admin's act\n(POST /schools/{id}/students/merge), so `can_merge` says whether THIS\ncaller may, and a teacher is told who to ask.\n\nShowing a teacher the other student's name and classes is no wider than\nthe school directory, which already lists every student at their school\nwith their address (DirectoryStudent). A student at ANOTHER school is a\nplain 409 that says nothing about them.","operationId":"set_student_email_students__student_id__email_put","parameters":[{"name":"student_id","in":"path","required":true,"schema":{"type":"integer","title":"Student Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StudentEmailSet"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StudentEmailRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/schools/{school_id}/students/merge":{"post":{"tags":["roster"],"summary":"Merge School Students","description":"Make two student accounts at this school into one. Cannot be undone.\n\nA school admin's act, gated by authorize_school_action — the same gate as\nadding staff and setting roster policy, and for the same reason it refuses\na plain teacher at their own school. A teacher sees one class of a student\nwho may be in five; folding two children together is only safe for\nsomebody who can see all of both.\n\nBOTH students must belong to the school in the path, and that is checked\nagainst their own school_id rather than trusted from the caller. A student\nwho is not at this school is a 404 — the same answer as one who does not\nexist, so a school admin cannot use this to probe another school's ids.\n\nWhat moves and what is dropped is roster_lib.merge_students.","operationId":"merge_school_students_schools__school_id__students_merge_post","parameters":[{"name":"school_id","in":"path","required":true,"schema":{"type":"integer","title":"School Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StudentMergeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StudentMergeResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/schools/{school_id}/students/{student_id}/removal-preview":{"get":{"tags":["roster"],"summary":"Student Removal Preview","description":"What removing this student would delete. Changes nothing.","operationId":"student_removal_preview_schools__school_id__students__student_id__removal_preview_get","parameters":[{"name":"school_id","in":"path","required":true,"schema":{"type":"integer","title":"School Id"}},{"name":"student_id","in":"path","required":true,"schema":{"type":"integer","title":"Student Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StudentRemovalPreview"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/schools/{school_id}/students/{student_id}/removal":{"post":{"tags":["roster"],"summary":"Remove School Student","description":"Delete a student account and all its work. Cannot be undone.\n\nFrees the student's email address, which is the point when the student\nwas a teacher added to try a class: they can be invited as staff after.","operationId":"remove_school_student_schools__school_id__students__student_id__removal_post","parameters":[{"name":"school_id","in":"path","required":true,"schema":{"type":"integer","title":"School Id"}},{"name":"student_id","in":"path","required":true,"schema":{"type":"integer","title":"Student Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StudentRemoval"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Remove School Student Schools  School Id  Students  Student Id  Removal Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/schools/{school_id}/teachers/{teacher_id}/departure-preview":{"get":{"tags":["roster"],"summary":"Teacher Departure Preview","description":"What removing this teacher would touch. Read-only; changes nothing.\n\nDeliberately NOT narrowed to the school admin the way the POST below is.\nThe gate belongs on the act, not on looking at it — an operator who can\nremove somebody through the coded platform path can obviously see what\nthat would touch, and refusing them the counts here would only push them\nto work it out from the staff list.","operationId":"teacher_departure_preview_schools__school_id__teachers__teacher_id__departure_preview_get","parameters":[{"name":"school_id","in":"path","required":true,"schema":{"type":"integer","title":"School Id"}},{"name":"teacher_id","in":"path","required":true,"schema":{"type":"integer","title":"Teacher Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeparturePreview"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/schools/{school_id}/teachers/{teacher_id}/departure":{"post":{"tags":["roster"],"summary":"Teacher Departure","description":"Remove a teacher, by reassigning their classes or archiving them.\n\nRefuses to be turned on the person asking. Same reasoning as\nreissue_school_teacher_code above, only harder: an admin who archived\nthemselves would clear their own credentials and lock the school out of\nits own admin account, with no path back that does not involve the\nplatform token.","operationId":"teacher_departure_schools__school_id__teachers__teacher_id__departure_post","parameters":[{"name":"school_id","in":"path","required":true,"schema":{"type":"integer","title":"School Id"}},{"name":"teacher_id","in":"path","required":true,"schema":{"type":"integer","title":"Teacher Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeacherDeparture"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeacherDepartureResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/schools/{school_id}/archived-classrooms":{"get":{"tags":["roster"],"summary":"School Archived Classrooms","description":"Dormant classes waiting for a teacher. Everything in them survives.","operationId":"school_archived_classrooms_schools__school_id__archived_classrooms_get","parameters":[{"name":"school_id","in":"path","required":true,"schema":{"type":"integer","title":"School Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ArchivedClassroom"},"title":"Response School Archived Classrooms Schools  School Id  Archived Classrooms Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/schools/{school_id}/archived-classrooms/{classroom_id}/assign":{"post":{"tags":["roster"],"summary":"Assign Archived Classroom","description":"Bring a dormant class back under a new teacher.\n\nCodes stay off unless reissue_codes is set, and the new teacher can turn\nthem on themselves from their own roster once they have looked at it.","operationId":"assign_archived_classroom_schools__school_id__archived_classrooms__classroom_id__assign_post","parameters":[{"name":"school_id","in":"path","required":true,"schema":{"type":"integer","title":"School Id"}},{"name":"classroom_id","in":"path","required":true,"schema":{"type":"integer","title":"Classroom Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClassroomUnarchive"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClassroomRevived"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/classrooms/{classroom_id}/reissue-codes":{"post":{"tags":["roster"],"summary":"Reissue Classroom Codes","description":"New codes for a whole class, and switch every login back on.\n\nThe other half of taking on a class that was dormant: the admin hands it\nover, the teacher looks at the roster, then does this. Regenerated rather\nthan merely reactivated — the old codes were handed out by a teacher who\nhas since left.\n\nrequire_classroom_access, so the receiving teacher can do it themselves\nwithout going back to the admin.","operationId":"reissue_classroom_codes_classrooms__classroom_id__reissue_codes_post","parameters":[{"name":"classroom_id","in":"path","required":true,"schema":{"type":"integer","title":"Classroom Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Reissue Classroom Codes Classrooms  Classroom Id  Reissue Codes Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/terms":{"get":{"tags":["roster"],"summary":"List Terms","operationId":"list_terms_terms_get","parameters":[{"name":"school_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"School Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TermRead"},"title":"Response List Terms Terms Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["roster"],"summary":"Create Term","description":"Make a term.\n\nA TEACHER MAY, which this used to refuse. It was `require_admin`, on the\nreasonable reading that a term is a school-level fact owned by a registrar\n— and the consequence was that a pilot teacher setting up their own class,\nwith no admin anywhere in their school, could not get a term at all. A\nterm's start date is what every unit's dates are measured from, so that\none gate held back the whole of the course calendar.\n\nIt is still school-scoped, so a teacher making one makes it for their\nschool and a colleague finds it waiting rather than making a second\n\"Fall 2026\". Terms are few, named, and visible to everyone who shares a\nschool: the failure mode of letting a teacher make one is a duplicate\nsomebody can see and fix, and the failure mode of refusing is a product\nthat does not work without a registrar.","operationId":"create_term_terms_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TermCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TermRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/classrooms/{classroom_id}/units":{"get":{"tags":["roster"],"summary":"List Units","description":"This class's units, each with its window RESOLVED.\n\nThe window is computed here rather than left to the client, because the\nteacher's own dates, the parsed week numbers and the term's start have to\nbe reconciled in one place — three surfaces each reconciling them would be\nthree chances to disagree about when a unit runs.","operationId":"list_units_classrooms__classroom_id__units_get","parameters":[{"name":"classroom_id","in":"path","required":true,"schema":{"type":"integer","title":"Classroom Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/UnitRead"},"title":"Response List Units Classrooms  Classroom Id  Units Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["roster"],"summary":"Create Unit","description":"Add one unit by hand. Needs no syllabus.\n\nA unit typed by a teacher lands the way one read from a syllabus does: at\nthe END of the teaching order unless a position is given, and with its week\nspan parsed, so its dates derive the same way. Both were skipped here while\nthe only caller was the registrar console.","operationId":"create_unit_classrooms__classroom_id__units_post","parameters":[{"name":"classroom_id","in":"path","required":true,"schema":{"type":"integer","title":"Classroom Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnitCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnitRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/units/{unit_id}":{"patch":{"tags":["roster"],"summary":"Update Unit","description":"Change a unit — including WHEN IT RUNS.\n\nThere was no PATCH for a unit at all, which is how a teacher ended up able\nto write a course plan and then unable to correct a word of it. Dates are\nthe reason it is here now: a parse of a syllabus's free text will be wrong\nsometimes, and a teacher who cannot fix it is worse off than one who was\nnever given a guess.\n\nSetting `starts_on` / `ends_on` overrides the derived window. Clearing\nBOTH hands the unit back to its week numbers, so a teacher can undo their\nown correction without knowing what the weeks were.\n\n`weeks` and the parsed numbers move together: editing the words re-parses\nthem, because leaving a stale 7-10 under the words \"weeks 3-6\" is how the\ntwo drift apart.","operationId":"update_unit_units__unit_id__patch","parameters":[{"name":"unit_id","in":"path","required":true,"schema":{"type":"integer","title":"Unit Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnitUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnitRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["roster"],"summary":"Delete Unit","description":"Delete a course unit. The owning teacher, their school admin, or an admin.\n\nThe route dependency only asks whether SOMEBODY is signed in. It cannot ask\nwhose unit this is, because the path names a unit and the scope lives on its\nclassroom — so any signed-in teacher could delete any unit in any school by\nguessing an id, which is what a running server let them do. Same shape as\nthe eleven cross-school leaks closed in the classrooms and enrollments\nroutes, and the same fix as move_enrollment above: authorize in the body,\nwhere the row that carries the scope has actually been loaded.","operationId":"delete_unit_units__unit_id__delete","parameters":[{"name":"unit_id","in":"path","required":true,"schema":{"type":"integer","title":"Unit Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/classrooms/{classroom_id}/outcomes":{"get":{"tags":["course-plan"],"summary":"List Outcomes","description":"Every outcome in the class, or one unit's.\n\n`unit_id=0` means the course-level ones, because a query string cannot\ncarry SQL NULL and \"give me the outcomes with no unit\" is a real request.","operationId":"list_outcomes_classrooms__classroom_id__outcomes_get","parameters":[{"name":"classroom_id","in":"path","required":true,"schema":{"type":"integer","title":"Classroom Id"}},{"name":"unit_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"omit for every outcome in the class; 0 for course-level only","title":"Unit Id"},"description":"omit for every outcome in the class; 0 for course-level only"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/OutcomeRead"},"title":"Response List Outcomes Classrooms  Classroom Id  Outcomes Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["course-plan"],"summary":"Create Outcome","operationId":"create_outcome_classrooms__classroom_id__outcomes_post","parameters":[{"name":"classroom_id","in":"path","required":true,"schema":{"type":"integer","title":"Classroom Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutcomeCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutcomeRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/outcomes/{outcome_id}":{"patch":{"tags":["course-plan"],"summary":"Update Outcome","description":"Edit one outcome.\n\nAuthorized in the body rather than the signature: the path names an\nOUTCOME and the scope lives on its classroom, so a route dependency could\nonly ask whether somebody is signed in. Same shape as `delete_unit` and\n`move_enrollment` next door, and the same reason — a dependency cannot\nload the row that carries the scope.","operationId":"update_outcome_outcomes__outcome_id__patch","parameters":[{"name":"outcome_id","in":"path","required":true,"schema":{"type":"integer","title":"Outcome Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutcomeUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutcomeRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["course-plan"],"summary":"Delete Outcome","operationId":"delete_outcome_outcomes__outcome_id__delete","parameters":[{"name":"outcome_id","in":"path","required":true,"schema":{"type":"integer","title":"Outcome Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/classrooms/{classroom_id}/outcomes/order":{"put":{"tags":["course-plan"],"summary":"Reorder Outcomes","description":"Replace-all ordering. Ids not in this class are refused rather than\nskipped — a silent partial reorder leaves a teacher looking at a list that\ndisagrees with what they just dragged.","operationId":"reorder_outcomes_classrooms__classroom_id__outcomes_order_put","parameters":[{"name":"classroom_id","in":"path","required":true,"schema":{"type":"integer","title":"Classroom Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutcomeOrderWrite"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/OutcomeRead"},"title":"Response Reorder Outcomes Classrooms  Classroom Id  Outcomes Order Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/classrooms/{classroom_id}/syllabus/analyze":{"post":{"tags":["course-plan"],"summary":"Analyze Syllabus","description":"Read the syllabus and return a proposal. WRITES NO UNITS OR OUTCOMES.\n\n(It does cache the extracted text — that is not the plan, it is the file\nalready on disk in a readable form.)","operationId":"analyze_syllabus_classrooms__classroom_id__syllabus_analyze_post","parameters":[{"name":"classroom_id","in":"path","required":true,"schema":{"type":"integer","title":"Classroom Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CoursePlanProposal"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/classrooms/{classroom_id}/course-plan":{"post":{"tags":["course-plan"],"summary":"Commit Course Plan","description":"Save a proposal the teacher has edited.\n\nADDITIVE, not replace-all. A teacher re-reading a syllabus in November must\nnot lose the outcomes they have written by hand since September, and a\ncommitting endpoint that silently deletes is not one anybody should have to\nbe brave to use. Units whose name already exists are skipped, so\nre-running is close to idempotent.\n\nOne transaction: a half-committed plan — units in, outcomes missing — is a\nworse state than no plan, because it looks finished.","operationId":"commit_course_plan_classrooms__classroom_id__course_plan_post","parameters":[{"name":"classroom_id","in":"path","required":true,"schema":{"type":"integer","title":"Classroom Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CoursePlanCommit"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CoursePlanCommitResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/units/{unit_id}/outcomes/draft":{"post":{"tags":["course-plan"],"summary":"Draft Outcomes For Unit","description":"Spar drafts 2-5 outcomes for one unit. SAVES NOTHING.\n\nWorks with no syllabus attached, from the unit's name alone — otherwise\n\"draft with Spar\" is a reward for having uploaded the right file, and the\nteacher who typed their units by hand gets the worse product.","operationId":"draft_outcomes_for_unit_units__unit_id__outcomes_draft_post","parameters":[{"name":"unit_id","in":"path","required":true,"schema":{"type":"integer","title":"Unit Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnitOutcomeDraft"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/units/{unit_id}/assignments/draft":{"post":{"tags":["course-plan"],"summary":"Draft Assignments For Unit","description":"Spar suggests 2-4 assignments for one unit. SAVES NOTHING.\n\nThe twin of `POST /units/{id}/outcomes/draft`, and it keeps that route's\none load-bearing property: it works from the unit's NAME alone. A teacher\nwho typed their units by hand gets the same help as one who uploaded a\nPDF, because otherwise \"suggest assignments\" is a reward for having the\nright file.\n\nWhat the unit ALREADY has is passed in, so the suggestions are things the\nteacher has not set rather than a list they have to mentally subtract\ntheir own work from -- which is most of the effort this is meant to save.\n\nNothing is written. The teacher takes a suggestion into the builder, where\nthe assignment is actually made, because a route that CREATED assignments\nfrom a model's output would be putting work in front of students that no\nteacher had read.","operationId":"draft_assignments_for_unit_units__unit_id__assignments_draft_post","parameters":[{"name":"unit_id","in":"path","required":true,"schema":{"type":"integer","title":"Unit Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnitAssignmentDraft"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/assignments/{assignment_id}/outcomes/map":{"post":{"tags":["course-plan"],"summary":"Map Assignment To Outcomes","description":"Spar says which outcomes this work serves. SAVES NOTHING.\n\nThe teacher does not have to read twenty-odd lines of curriculum and\ndecide, which is the state in which the reasonable move is to tick\nnothing — and an assignment tied to no outcome is the thing the picker\nexists to prevent.\n\nWHAT IT MAPS ACROSS is wider than what the picker offers. The picker\nnarrows to the chosen unit on purpose: course-level outcomes are what a\nwhole term serves, and ticking one against a single session says something\na teacher almost never means. But \"almost never\" is not never, and this is\nwhere that case is served — Spar reads the work and says if it genuinely\nreaches one.\n\nIt PROPOSES. The answer is the same data a teacher would have ticked by\nhand, so it comes back as ids to show as ticks they can clear. Nothing is\nwritten here, for the reason the unit-suggestion route gives: work put in\nfront of students that no teacher read is the failure this product cannot\nhave.","operationId":"map_assignment_to_outcomes_assignments__assignment_id__outcomes_map_post","parameters":[{"name":"assignment_id","in":"path","required":true,"schema":{"type":"integer","title":"Assignment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutcomeMapProposal"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/assignments/{assignment_id}/outcomes":{"get":{"tags":["course-plan"],"summary":"Get Assignment Outcomes","description":"Which outcomes this assignment serves.\n\nCurriculum design -- what a teacher decided this piece of work is FOR, in\ntheir own words. The PUT directly below checks ownership; this GET was left\non the router-level gate, so any signed-in teacher could read any school's\ncourse design by walking assignment ids.","operationId":"get_assignment_outcomes_assignments__assignment_id__outcomes_get","parameters":[{"name":"assignment_id","in":"path","required":true,"schema":{"type":"integer","title":"Assignment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/OutcomeRead"},"title":"Response Get Assignment Outcomes Assignments  Assignment Id  Outcomes Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["course-plan"],"summary":"Set Assignment Outcomes","description":"Replace-all: which outcomes this assignment serves.\n\nMirrors `PUT /assignments/{id}/targets` deliberately — same replace-all\nshape, written at the same moment in the builder's save.\n\nAn empty list is legal and means \"not for any outcome in particular\",\nwhich is a real answer for a diagnostic or a one-off. Refusing it would\nmake every assignment claim a purpose it might not have.","operationId":"set_assignment_outcomes_assignments__assignment_id__outcomes_put","parameters":[{"name":"assignment_id","in":"path","required":true,"schema":{"type":"integer","title":"Assignment Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignmentOutcomesWrite"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/OutcomeRead"},"title":"Response Set Assignment Outcomes Assignments  Assignment Id  Outcomes Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/student/classrooms/{classroom_id}/course-plan":{"get":{"tags":["course-plan"],"summary":"Student Course Plan","description":"The course plan, as the student in this class may read it.\n\nThree gates, and they fail the same way on purpose. A student who is not\nenrolled, and a class whose plan is unpublished, both get 404 — not 403.\n\"You are not allowed to see this\" confirms the thing exists; a student\npoking at ids should learn nothing either way.\n\nThe response model carries no `source` and no coverage. That omission is\nstructural — StudentOutcomeRead has no such fields — rather than a filter\nsomebody has to remember to keep applying.","operationId":"student_course_plan_student_classrooms__classroom_id__course_plan_get","parameters":[{"name":"classroom_id","in":"path","required":true,"schema":{"type":"integer","title":"Classroom Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StudentCoursePlanRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/classrooms/{classroom_id}/coverage":{"get":{"tags":["course-plan"],"summary":"Course Coverage","description":"Every unit, its outcomes, and the work assigned against each.\n\nTHE BOARD IS A DIFFERENT QUESTION FROM THE PLAN. The Plan is for writing\nthe course: outcomes in order, editable where they sit. The Board is for\nseeing what the course DOES AND DOES NOT COVER -- which is a question\nabout the whole class at once, and cannot be answered by the Plan's reads\nbecause they never touch `assignment_outcomes`.\n\nAnswered in one request, not one per outcome. A board of seven units and\nforty outcomes is forty-one round trips the other way, and the answers\narrive at different times, so the thing a teacher is reading for -- the\nshape of the gaps -- assembles in front of them in the wrong order.\n\nTHREE PLACES WORK CAN SIT, and all three are returned:\n\n  * under the outcome it serves, which is the normal case;\n  * `unlinked_assignments`, for work filed under a unit that serves no\n    outcome;\n  * `unplaced_assignments`, for work in the class that is under no unit.\n\nThe last two exist because this surface is read as an inventory. Every\nassignment is drawn beneath the outcome it serves, so work linked to\nnothing would otherwise appear NOWHERE -- and a teacher looking at a page\nwhose whole subject is gaps would read the unit as lighter than it is.\nThe gap in those cases is in the LINK, and naming it requires the work to\nstill be on the page.\n\nDrafts are included and marked. \"Nothing assigned against this\" is false\nif something is built and unsent, and a teacher checking coverage in\nAugust has mostly drafts.","operationId":"course_coverage_classrooms__classroom_id__coverage_get","parameters":[{"name":"classroom_id","in":"path","required":true,"schema":{"type":"integer","title":"Classroom Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CourseCoverage"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/assignments/{assignment_id}/groups":{"post":{"tags":["converge"],"summary":"Create Group","operationId":"create_group_assignments__assignment_id__groups_post","parameters":[{"name":"assignment_id","in":"path","required":true,"schema":{"type":"integer","title":"Assignment Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GroupCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GroupRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["converge"],"summary":"List Groups","operationId":"list_groups_assignments__assignment_id__groups_get","parameters":[{"name":"assignment_id","in":"path","required":true,"schema":{"type":"integer","title":"Assignment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/GroupRead"},"title":"Response List Groups Assignments  Assignment Id  Groups Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/assignments/{assignment_id}/group-candidates":{"get":{"tags":["converge"],"summary":"Group Candidates","operationId":"group_candidates_assignments__assignment_id__group_candidates_get","parameters":[{"name":"assignment_id","in":"path","required":true,"schema":{"type":"integer","title":"Assignment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/GroupCandidateRead"},"title":"Response Group Candidates Assignments  Assignment Id  Group Candidates Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/assignments/{assignment_id}/blocks/{block_id}/groups/auto":{"post":{"tags":["converge"],"summary":"Auto Form","description":"Spar's balanced-distribution suggestion: partition the given students into\ngroups for the Converge block. Teacher can then reshuffle.","operationId":"auto_form_assignments__assignment_id__blocks__block_id__groups_auto_post","parameters":[{"name":"assignment_id","in":"path","required":true,"schema":{"type":"integer","title":"Assignment Id"}},{"name":"block_id","in":"path","required":true,"schema":{"type":"integer","title":"Block Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutoFormRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/GroupRead"},"title":"Response Auto Form Assignments  Assignment Id  Blocks  Block Id  Groups Auto Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/assignments/{assignment_id}/blocks/{block_id}/members/{student_id}":{"patch":{"tags":["converge"],"summary":"Move Member","description":"Move a student to another group in this Converge block, or out of any group\n(to_group_id=null). Non-destructive; allowed mid-discussion (their existing\ncontributions stay in the old thread). Returns the block's refreshed groups.","operationId":"move_member_assignments__assignment_id__blocks__block_id__members__student_id__patch","parameters":[{"name":"assignment_id","in":"path","required":true,"schema":{"type":"integer","title":"Assignment Id"}},{"name":"block_id","in":"path","required":true,"schema":{"type":"integer","title":"Block Id"}},{"name":"student_id","in":"path","required":true,"schema":{"type":"integer","title":"Student Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemberMoveRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/GroupRead"},"title":"Response Move Member Assignments  Assignment Id  Blocks  Block Id  Members  Student Id  Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/assignments/{assignment_id}/blocks/{block_id}/members/swap":{"post":{"tags":["converge"],"summary":"Swap Members","description":"Trade two students between their groups (size-neutral; bypasses the max\ncap). Returns the block's refreshed groups.","operationId":"swap_members_assignments__assignment_id__blocks__block_id__members_swap_post","parameters":[{"name":"assignment_id","in":"path","required":true,"schema":{"type":"integer","title":"Assignment Id"}},{"name":"block_id","in":"path","required":true,"schema":{"type":"integer","title":"Block Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemberSwapRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/GroupRead"},"title":"Response Swap Members Assignments  Assignment Id  Blocks  Block Id  Members Swap Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/groups/{group_id}":{"get":{"tags":["converge"],"summary":"Get Group","operationId":"get_group_groups__group_id__get","parameters":[{"name":"group_id","in":"path","required":true,"schema":{"type":"integer","title":"Group Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GroupRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/groups/{group_id}/converge/status":{"get":{"tags":["converge"],"summary":"Converge Status","operationId":"converge_status_groups__group_id__converge_status_get","parameters":[{"name":"group_id","in":"path","required":true,"schema":{"type":"integer","title":"Group Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatingStatus"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/groups/{group_id}/converge":{"get":{"tags":["converge"],"summary":"Get Converge","operationId":"get_converge_groups__group_id__converge_get","parameters":[{"name":"group_id","in":"path","required":true,"schema":{"type":"integer","title":"Group Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConvergeRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/groups/{group_id}/converge/open":{"post":{"tags":["converge"],"summary":"Open Converge","operationId":"open_converge_groups__group_id__converge_open_post","parameters":[{"name":"group_id","in":"path","required":true,"schema":{"type":"integer","title":"Group Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenConvergeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConvergeRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/converge/{converge_id}/close":{"post":{"tags":["converge"],"summary":"Close Converge","operationId":"close_converge_converge__converge_id__close_post","parameters":[{"name":"converge_id","in":"path","required":true,"schema":{"type":"integer","title":"Converge Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloseConvergeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConvergeRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/converge/{converge_id}/thread":{"get":{"tags":["converge"],"summary":"Get Thread","operationId":"get_thread_converge__converge_id__thread_get","parameters":[{"name":"converge_id","in":"path","required":true,"schema":{"type":"integer","title":"Converge Id"}},{"name":"viewer_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Viewer Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response Get Thread Converge  Converge Id  Thread Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/converge/{converge_id}/seen":{"post":{"tags":["converge"],"summary":"Mark Seen","operationId":"mark_seen_converge__converge_id__seen_post","parameters":[{"name":"converge_id","in":"path","required":true,"schema":{"type":"integer","title":"Converge Id"}},{"name":"viewer_id","in":"query","required":true,"schema":{"type":"integer","title":"Viewer Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Mark Seen Converge  Converge Id  Seen Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/converge/{converge_id}/notifications":{"get":{"tags":["converge"],"summary":"Get Notifications","operationId":"get_notifications_converge__converge_id__notifications_get","parameters":[{"name":"converge_id","in":"path","required":true,"schema":{"type":"integer","title":"Converge Id"}},{"name":"viewer_id","in":"query","required":true,"schema":{"type":"integer","title":"Viewer Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response Get Notifications Converge  Converge Id  Notifications Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/converge/{converge_id}/catchup":{"get":{"tags":["converge"],"summary":"Get Catchup","description":"First-entry catch-up: a one-time Spar brief on what's happened so far.","operationId":"get_catchup_converge__converge_id__catchup_get","parameters":[{"name":"converge_id","in":"path","required":true,"schema":{"type":"integer","title":"Converge Id"}},{"name":"viewer_id","in":"query","required":true,"schema":{"type":"integer","title":"Viewer Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Catchup Converge  Converge Id  Catchup Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/converge/{converge_id}/your-thinking":{"get":{"tags":["converge"],"summary":"Get Your Thinking","description":"The viewer's OWN private-loop artifacts for the drawer (own data only).","operationId":"get_your_thinking_converge__converge_id__your_thinking_get","parameters":[{"name":"converge_id","in":"path","required":true,"schema":{"type":"integer","title":"Converge Id"}},{"name":"viewer_id","in":"query","required":true,"schema":{"type":"integer","title":"Viewer Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Your Thinking Converge  Converge Id  Your Thinking Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/converge/{converge_id}/contributions":{"post":{"tags":["converge"],"summary":"Post Contribution","operationId":"post_contribution_converge__converge_id__contributions_post","parameters":[{"name":"converge_id","in":"path","required":true,"schema":{"type":"integer","title":"Converge Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContributionCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Post Contribution Converge  Converge Id  Contributions Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/converge/{converge_id}/catch-up":{"post":{"tags":["converge"],"summary":"Catch Up Contribution","description":"Case B: a member who missed the live window adds their voice to a CLOSED\nConverge, framed against the group's landed position. Spar responds.","operationId":"catch_up_contribution_converge__converge_id__catch_up_post","parameters":[{"name":"converge_id","in":"path","required":true,"schema":{"type":"integer","title":"Converge Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContributionCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Catch Up Contribution Converge  Converge Id  Catch Up Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/contributions/{contribution_id}":{"patch":{"tags":["converge"],"summary":"Edit Contribution","operationId":"edit_contribution_contributions__contribution_id__patch","parameters":[{"name":"contribution_id","in":"path","required":true,"schema":{"type":"integer","title":"Contribution Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContributionEdit"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Edit Contribution Contributions  Contribution Id  Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["converge"],"summary":"Delete Contribution","operationId":"delete_contribution_contributions__contribution_id__delete","parameters":[{"name":"contribution_id","in":"path","required":true,"schema":{"type":"integer","title":"Contribution Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete Contribution Contributions  Contribution Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/contributions/{contribution_id}/reactions":{"post":{"tags":["converge"],"summary":"React","operationId":"react_contributions__contribution_id__reactions_post","parameters":[{"name":"contribution_id","in":"path","required":true,"schema":{"type":"integer","title":"Contribution Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReactionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response React Contributions  Contribution Id  Reactions Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/contributions/{contribution_id}/report":{"post":{"tags":["converge"],"summary":"Report Contribution","description":"Report a contribution: it's immediately hidden from the group, then\nSpar reviews it (when moderation is enabled). Anonymous to the contributor.","operationId":"report_contribution_contributions__contribution_id__report_post","parameters":[{"name":"contribution_id","in":"path","required":true,"schema":{"type":"integer","title":"Contribution Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Report Contribution Contributions  Contribution Id  Report Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/contributions/{contribution_id}/review":{"post":{"tags":["converge"],"summary":"Review Contribution","description":"Run (or re-run) Spar's review on a reported contribution.","operationId":"review_contribution_contributions__contribution_id__review_post","parameters":[{"name":"contribution_id","in":"path","required":true,"schema":{"type":"integer","title":"Contribution Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Review Contribution Contributions  Contribution Id  Review Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/converge/{converge_id}/students/{student_id}/release-cooldown":{"post":{"tags":["converge"],"summary":"Release Cooldown","operationId":"release_cooldown_converge__converge_id__students__student_id__release_cooldown_post","parameters":[{"name":"converge_id","in":"path","required":true,"schema":{"type":"integer","title":"Converge Id"}},{"name":"student_id","in":"path","required":true,"schema":{"type":"integer","title":"Student Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Release Cooldown Converge  Converge Id  Students  Student Id  Release Cooldown Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/assignments/{assignment_id}/converge/moderation-queue":{"get":{"tags":["converge"],"summary":"Moderation Queue","description":"The teacher moderation-review queue: unresolved holds, cool-downs,\nremovals, and reported contributions across the assignment's groups, with the\nflagged content in context. The sanctioned exception to the content-free\nrule — surfaced only here, behind a 'shown for review' banner.","operationId":"moderation_queue_assignments__assignment_id__converge_moderation_queue_get","parameters":[{"name":"assignment_id","in":"path","required":true,"schema":{"type":"integer","title":"Assignment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response Moderation Queue Assignments  Assignment Id  Converge Moderation Queue Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/converge/moderation/resolve":{"post":{"tags":["converge"],"summary":"Resolve Moderation","description":"Apply a teacher decision to a queue item: release / uphold / escalate /\nrelease_cooldown.","operationId":"resolve_moderation_converge_moderation_resolve_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModerationResolveRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Resolve Moderation Converge Moderation Resolve Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/assignments/{assignment_id}/converge/dashboard":{"get":{"tags":["converge"],"summary":"Converge Dashboard","description":"Live group dashboard: one tile per group with presence + alert signals.","operationId":"converge_dashboard_assignments__assignment_id__converge_dashboard_get","parameters":[{"name":"assignment_id","in":"path","required":true,"schema":{"type":"integer","title":"Assignment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response Converge Dashboard Assignments  Assignment Id  Converge Dashboard Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/assignments/{assignment_id}/converge/broadcast":{"post":{"tags":["converge"],"summary":"Broadcast","description":"Send one teacher message into every OPEN group converge for the\nassignment at once (a reminder/redirect to all groups).","operationId":"broadcast_assignments__assignment_id__converge_broadcast_post","parameters":[{"name":"assignment_id","in":"path","required":true,"schema":{"type":"integer","title":"Assignment Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BroadcastRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Broadcast Assignments  Assignment Id  Converge Broadcast Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/converge/{converge_id}/teacher-summary":{"get":{"tags":["converge"],"summary":"Converge Teacher Summary","description":"Post-Converge teacher view: group synthesis + collaboration summary +\nparticipation record. Privacy-safe — participation, not content.","operationId":"converge_teacher_summary_converge__converge_id__teacher_summary_get","parameters":[{"name":"converge_id","in":"path","required":true,"schema":{"type":"integer","title":"Converge Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Converge Teacher Summary Converge  Converge Id  Teacher Summary Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/essays/standalone":{"post":{"tags":["essays"],"summary":"Start Standalone","description":"Open a standalone Phase 4 session — direct entry into composition.","operationId":"start_standalone_essays_standalone_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandalonePhase4Start"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandalonePhase4Response"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/essays/enter/{session_id}":{"post":{"tags":["essays"],"summary":"Enter Phase 4","description":"Full-pedagogy entry: PHASE_3_DIALOGUE/DECISION_POINT → PHASE_4_COMPOSITION.\n\nPhase 4 is depth — gated on a redeemed access code. An uncoded demo\nsession cannot enter composition even though it reached Phase 3.","operationId":"enter_phase_4_essays_enter__session_id__post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"integer","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnterPhase4Response"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/essays/{essay_id}":{"get":{"tags":["essays"],"summary":"Get Essay","operationId":"get_essay_essays__essay_id__get","parameters":[{"name":"essay_id","in":"path","required":true,"schema":{"type":"string","title":"Essay Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EssayRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/essays/{essay_id}/reference":{"get":{"tags":["essays"],"summary":"Get Essay Reference","description":"Surfaces the student's own Phase 1 history + Braindump for the\ncomposition reference panel. Standalone essays return empty lists.\nSTUDENT-FACING ONLY (the privacy rule that prevents teachers from\nseeing raw Phase 1 quotes does not apply — the student is reading\ntheir own content).","operationId":"get_essay_reference_essays__essay_id__reference_get","parameters":[{"name":"essay_id","in":"path","required":true,"schema":{"type":"string","title":"Essay Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EssayReferenceContent"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/essays/{essay_id}/paragraphs":{"put":{"tags":["essays"],"summary":"Save Essay","description":"Auto-save / explicit-save target. Replaces the working paragraph set.\n\nPer spec §State Machine, no version checkpoint is taken here —\ncheckpoints fire only on state transitions. This is the working draft.","operationId":"save_essay_essays__essay_id__paragraphs_put","parameters":[{"name":"essay_id","in":"path","required":true,"schema":{"type":"string","title":"Essay Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EssaySaveRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EssayRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/essays/{essay_id}/transition":{"post":{"tags":["essays"],"summary":"Transition Essay","description":"Move forward or backward through Phase 4 sub-states.\n\nForward chain: composition → editorial_dialogue → pre_submit → submitted.\nBackward transitions are also student-initiated and supported per spec.\nA version checkpoint is taken at every transition.","operationId":"transition_essay_essays__essay_id__transition_post","parameters":[{"name":"essay_id","in":"path","required":true,"schema":{"type":"string","title":"Essay Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EssayTransitionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EssayRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/essays/{essay_id}/observations/analyze":{"post":{"tags":["essays"],"summary":"Analyze Observations","description":"Run the Pattern C analyzer against the essay-so-far.\n\nIdempotent on the essay's text hash within a 5-minute window. Returns\nthe active (un-dismissed) observation set after the call.","operationId":"analyze_observations_essays__essay_id__observations_analyze_post","parameters":[{"name":"essay_id","in":"path","required":true,"schema":{"type":"string","title":"Essay Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalyzeInCompositionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/essays/{essay_id}/observations":{"get":{"tags":["essays"],"summary":"List Observations","description":"Active (un-dismissed) observations for the essay, oldest first.","operationId":"list_observations_essays__essay_id__observations_get","parameters":[{"name":"essay_id","in":"path","required":true,"schema":{"type":"string","title":"Essay Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EssayObservationRead"},"title":"Response List Observations Essays  Essay Id  Observations Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/essays/observations/{observation_id}/view":{"post":{"tags":["essays"],"summary":"View Observation","description":"Mark an observation as viewed (telemetry — does not dismiss).","operationId":"view_observation_essays_observations__observation_id__view_post","parameters":[{"name":"observation_id","in":"path","required":true,"schema":{"type":"string","title":"Observation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EssayObservationRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/essays/observations/{observation_id}/dismiss":{"post":{"tags":["essays"],"summary":"Dismiss Observation","description":"Mark an observation as dismissed; removes it from the active list.","operationId":"dismiss_observation_essays_observations__observation_id__dismiss_post","parameters":[{"name":"observation_id","in":"path","required":true,"schema":{"type":"string","title":"Observation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EssayObservationRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/essays/{essay_id}/mini-volley":{"post":{"tags":["essays"],"summary":"Start Mini Volley","description":"Open a fresh mini-Volley invocation for the essay.\n\nSpec: 5-minute / 5-exchange caps enforced by the orchestrator.\nReuses Phase 1 mechanics with the mid-composition framing block\nappended to the system prompt.\n\nCatches unhandled exceptions in addition to the known service\nerrors and returns them as JSON 500s. The CORS middleware adds\nheaders to JSON responses but not to a connection that dies\nmid-request, so without this wrapper a downstream Anthropic or\nstate-machine crash surfaces in the browser as a misleading\n\"blocked by CORS policy\" error instead of a real traceback.","operationId":"start_mini_volley_essays__essay_id__mini_volley_post","parameters":[{"name":"essay_id","in":"path","required":true,"schema":{"type":"string","title":"Essay Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MiniVolleyRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/essays/mini-volley/{mini_volley_id}/message":{"post":{"tags":["essays"],"summary":"Send Mini Volley Message","description":"Send a student message into an active mini-Volley.\n\nReturns the updated transcript. The orchestrator checks both caps\n(exchange count and wall clock) before invoking the LLM and ends\nthe mini-Volley if either is reached.","operationId":"send_mini_volley_message_essays_mini_volley__mini_volley_id__message_post","parameters":[{"name":"mini_volley_id","in":"path","required":true,"schema":{"type":"string","title":"Mini Volley Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MiniVolleyMessageRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MiniVolleyRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/essays/mini-volley/{mini_volley_id}/end":{"post":{"tags":["essays"],"summary":"End Mini Volley","description":"Student-initiated end. Idempotent.","operationId":"end_mini_volley_essays_mini_volley__mini_volley_id__end_post","parameters":[{"name":"mini_volley_id","in":"path","required":true,"schema":{"type":"string","title":"Mini Volley Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MiniVolleyRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/essays/{essay_id}/editorial":{"post":{"tags":["essays"],"summary":"Enter Editorial","description":"Transition the essay into editorial dialogue.\n\nRuns the editorial observation analyzer and persists the validated\nlist. Auto-ends with `list_exhausted` if the analyzer produced zero\nobservations (transitions to PRE_SUBMIT directly).","operationId":"enter_editorial_essays__essay_id__editorial_post","parameters":[{"name":"essay_id","in":"path","required":true,"schema":{"type":"string","title":"Essay Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorialDialogueRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["essays"],"summary":"Get Editorial","description":"Latest editorial dialogue for the essay (active or ended).\n\nUsed by the frontend resume-after-reload flow.","operationId":"get_editorial_essays__essay_id__editorial_get","parameters":[{"name":"essay_id","in":"path","required":true,"schema":{"type":"string","title":"Essay Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorialDialogueRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/essays/editorial/{dialogue_id}/advance":{"post":{"tags":["essays"],"summary":"Advance Editorial","description":"Record the student's reply to the current observation, advance\nthe cursor, present the next observation. Auto-ends on exhaustion.","operationId":"advance_editorial_essays_editorial__dialogue_id__advance_post","parameters":[{"name":"dialogue_id","in":"path","required":true,"schema":{"type":"string","title":"Dialogue Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorialAdvanceRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorialDialogueRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/essays/editorial/{dialogue_id}/end":{"post":{"tags":["essays"],"summary":"End Editorial","description":"Student-initiated end. Transitions essay to PRE_SUBMIT.","operationId":"end_editorial_essays_editorial__dialogue_id__end_post","parameters":[{"name":"dialogue_id","in":"path","required":true,"schema":{"type":"string","title":"Dialogue Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditorialDialogueRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/essays/{essay_id}/grammar":{"post":{"tags":["essays"],"summary":"Grammar Pass","description":"Run the rule-based grammar pass and return per-paragraph issues.\n\nSpec: opt-in, pre_submit only. Each issue is a `{kind, snippet,\nquestion, char_start, char_end}` record. The frontend renders the\nsnippet + question and lets the student dismiss; it never proposes\na corrected string.","operationId":"grammar_pass_essays__essay_id__grammar_post","parameters":[{"name":"essay_id","in":"path","required":true,"schema":{"type":"string","title":"Essay Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrammarPassResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/essays/{essay_id}/submit_check":{"get":{"tags":["essays"],"summary":"Submit Check","description":"Advisory the frontend reads BEFORE the submit POST.\n\nTells the canvas whether to interpose the slow-down prompt (active\nobservations that the student appears to have bypassed) and which\nspecific observations to surface in it. The gate is advisory — the\nstudent can always proceed by calling /submit.","operationId":"submit_check_essays__essay_id__submit_check_get","parameters":[{"name":"essay_id","in":"path","required":true,"schema":{"type":"string","title":"Essay Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitCheckResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/essays/{essay_id}/submit":{"post":{"tags":["essays"],"summary":"Submit Essay","description":"Student-invoked submit. Builds the signed artifact, runs the\nengagement + wellbeing analyzers, and transitions the essay state.\nRe-submission updates the artifact with the latest process record.\n\nThe slow-down advisory is exposed at /submit_check; this route does\nnot gate on it. The canvas calls /submit_check first to decide\nwhether to interpose the prompt; if the student chooses to submit\nanyway, the canvas calls /submit directly.","operationId":"submit_essay_essays__essay_id__submit_post","parameters":[{"name":"essay_id","in":"path","required":true,"schema":{"type":"string","title":"Essay Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignedArtifactRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/essays/{essay_id}/artifact":{"get":{"tags":["essays"],"summary":"Get Artifact","description":"Teacher-facing render of a submitted essay's artifact.\n\n404 if the essay hasn't been submitted yet (no signed_artifact on\nthe row).","operationId":"get_artifact_essays__essay_id__artifact_get","parameters":[{"name":"essay_id","in":"path","required":true,"schema":{"type":"string","title":"Essay Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignedArtifactRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/essays/by-assignment/{assignment_id}":{"get":{"tags":["essays"],"summary":"List Submitted Essays For Assignment","description":"All submitted essays for an assignment, newest first.\n\nBacks the teacher dashboard's \"view essay\" affordance on the\nassignment view (per spec §Teacher Dashboard Surface).\n\n`require_teacher_or_admin` alone made this every submitted essay for any\nassignment id in the deployment, each row carrying `student_name` -- so one\nwalk of the integers enumerated other schools' children against their\nwriting. Scoped the same way the rest of the assignment's cross-student\nevidence is.","operationId":"list_submitted_essays_for_assignment_essays_by_assignment__assignment_id__get","parameters":[{"name":"assignment_id","in":"path","required":true,"schema":{"type":"integer","title":"Assignment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TeacherEssayListItem"},"title":"Response List Submitted Essays For Assignment Essays By Assignment  Assignment Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/essays/{essay_id}/teacher_overview_note":{"put":{"tags":["essays"],"summary":"Put Teacher Overview Note","operationId":"put_teacher_overview_note_essays__essay_id__teacher_overview_note_put","parameters":[{"name":"essay_id","in":"path","required":true,"schema":{"type":"string","title":"Essay Id"}},{"name":"teacher_id","in":"query","required":true,"schema":{"type":"integer","title":"Teacher Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeacherOverviewNoteUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EssayRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/essays/{essay_id}/annotations":{"post":{"tags":["essays"],"summary":"Create Annotation","operationId":"create_annotation_essays__essay_id__annotations_post","parameters":[{"name":"essay_id","in":"path","required":true,"schema":{"type":"string","title":"Essay Id"}},{"name":"teacher_id","in":"query","required":true,"schema":{"type":"integer","title":"Teacher Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeacherAnnotationCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeacherAnnotation"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/essays/annotations/{annotation_id}":{"patch":{"tags":["essays"],"summary":"Patch Annotation","operationId":"patch_annotation_essays_annotations__annotation_id__patch","parameters":[{"name":"annotation_id","in":"path","required":true,"schema":{"type":"integer","title":"Annotation Id"}},{"name":"teacher_id","in":"query","required":true,"schema":{"type":"integer","title":"Teacher Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeacherAnnotationUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeacherAnnotation"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["essays"],"summary":"Delete Annotation","operationId":"delete_annotation_essays_annotations__annotation_id__delete","parameters":[{"name":"annotation_id","in":"path","required":true,"schema":{"type":"integer","title":"Annotation Id"}},{"name":"teacher_id","in":"query","required":true,"schema":{"type":"integer","title":"Teacher Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/essays/{essay_id}/accept":{"post":{"tags":["essays"],"summary":"Accept","description":"Mark the essay finished. The other half of push_back — without it a\nreview could be sent back but never closed.","operationId":"accept_essays__essay_id__accept_post","parameters":[{"name":"essay_id","in":"path","required":true,"schema":{"type":"string","title":"Essay Id"}},{"name":"teacher_id","in":"query","required":true,"schema":{"type":"integer","title":"Teacher Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EssayRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/essays/{essay_id}/push_back":{"post":{"tags":["essays"],"summary":"Push Back","description":"Send the essay back. The body is optional and so is everything in it:\na date to have it back by, and whether each comment needs a response.","operationId":"push_back_essays__essay_id__push_back_post","parameters":[{"name":"essay_id","in":"path","required":true,"schema":{"type":"string","title":"Essay Id"}},{"name":"teacher_id","in":"query","required":true,"schema":{"type":"integer","title":"Teacher Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/PushBackRequest"},{"type":"null"}],"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EssayRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/essays/{essay_id}/annotations/{annotation_id}/response":{"put":{"tags":["essays"],"summary":"Put Comment Response","description":"The student's short answer to one of the teacher's comments. One per\ncomment: writing again replaces it.","operationId":"put_comment_response_essays__essay_id__annotations__annotation_id__response_put","parameters":[{"name":"annotation_id","in":"path","required":true,"schema":{"type":"integer","title":"Annotation Id"}},{"name":"essay_id","in":"path","required":true,"schema":{"type":"string","title":"Essay Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommentResponseWrite"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["essays"],"summary":"Delete Comment Response","operationId":"delete_comment_response_essays__essay_id__annotations__annotation_id__response_delete","parameters":[{"name":"annotation_id","in":"path","required":true,"schema":{"type":"integer","title":"Annotation Id"}},{"name":"essay_id","in":"path","required":true,"schema":{"type":"string","title":"Essay Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/essays/{essay_id}/versions/{version_id}":{"get":{"tags":["essays"],"summary":"Get Essay Version","description":"One snapshot of the essay, with its text, for \"See what changed\".\n\nGated exactly as the essay is. The version must belong to THIS essay: a\nversion id is an integer, and the gate is on the essay in the path.","operationId":"get_essay_version_essays__essay_id__versions__version_id__get","parameters":[{"name":"version_id","in":"path","required":true,"schema":{"type":"integer","title":"Version Id"}},{"name":"essay_id","in":"path","required":true,"schema":{"type":"string","title":"Essay Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EssayVersionParagraphs"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/essays/teacher/{teacher_id}/review_queue":{"get":{"tags":["essays"],"summary":"List Review Queue","description":"A teacher's own queue, and only their own.\n\nrequire_teacher_identity lets a school_admin act AS any teacher in their\nschool, which is right for administrative work and wrong for this: it would\nhand an admin every submission in the building one teacher at a time, undoing\nthe narrowing in list_essays_for_teacher_review. A queue of children's\nwriting is not something you read on someone else's behalf.\n\nThe operator token and a platform_admin are exempt, as they are everywhere\n-- that is support access, not a school's own admin browsing.","operationId":"list_review_queue_essays_teacher__teacher_id__review_queue_get","parameters":[{"name":"teacher_id","in":"path","required":true,"schema":{"type":"integer","title":"Teacher Id"}},{"name":"assignment_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Assignment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TeacherReviewEssayListItem"},"title":"Response List Review Queue Essays Teacher  Teacher Id  Review Queue Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/essays/{essay_id}/support_comments":{"post":{"tags":["essays"],"summary":"Create Support Comment","operationId":"create_support_comment_essays__essay_id__support_comments_post","parameters":[{"name":"essay_id","in":"path","required":true,"schema":{"type":"string","title":"Essay Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupportCommentCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupportComment"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/essays/{essay_id}/support_comments/{comment_id}":{"delete":{"tags":["essays"],"summary":"Delete Support Comment","operationId":"delete_support_comment_essays__essay_id__support_comments__comment_id__delete","parameters":[{"name":"essay_id","in":"path","required":true,"schema":{"type":"string","title":"Essay Id"}},{"name":"comment_id","in":"path","required":true,"schema":{"type":"integer","title":"Comment Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/waitlist":{"post":{"tags":["waitlist"],"summary":"Join Waitlist","description":"Add (or update telemetry on) a waitlist row.\n\nDedupe is by email — first-write-wins on the source, so the\ntemperature at first capture is preserved even if the visitor\nre-joins from a different surface later.","operationId":"join_waitlist_waitlist_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WaitlistJoinRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WaitlistJoinResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/waitlist/list":{"get":{"tags":["waitlist"],"summary":"List Waitlist","description":"All waitlist signups, newest first. Admin-only.\n\nAuth: requires the `x-spar-admin` header to match SPAR_ADMIN_TOKEN.\nReturns 403 without it (see spar.api.deps.require_admin).\n\nThe IP and user_agent columns are deliberately NOT included in\nthe response — they're internal telemetry, not outreach data.\nThe legacy `role` column is included alongside `roles` so old\nrows written before the multi-select migration (0011 → 0012)\naren't silently invisible.\n\n`total` counts all rows across all sources, regardless of the\n`?source=` filter, so the caller can see overall signups even\nwhen slicing by lead temperature. `count` is post-filter.","operationId":"list_waitlist_waitlist_list_get","parameters":[{"name":"source","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional filter — one of waitlist_cold / waitlist_mid_demo / waitlist_post_demo / waitlist_teacher.","title":"Source"},"description":"Optional filter — one of waitlist_cold / waitlist_mid_demo / waitlist_post_demo / waitlist_teacher."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":5000,"minimum":1,"default":1000,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WaitlistListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/contact":{"post":{"tags":["forms"],"summary":"Submit Contact","description":"Accept a contact-form submission: persist, then email support@.","operationId":"submit_contact_contact_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactSubmitRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactSubmitResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/privacy/request":{"post":{"tags":["forms"],"summary":"Submit Privacy Request","description":"Accept a data-rights request: persist (system of record), then\nemail privacy@.","operationId":"submit_privacy_request_privacy_request_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PrivacyRequestSubmitRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PrivacyRequestSubmitResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/safeguarding/postmark-webhook":{"post":{"tags":["safeguarding"],"summary":"Postmark Webhook","description":"Postmark delivery/bounce webhook — record the event + update delivery.","operationId":"postmark_webhook_api_safeguarding_postmark_webhook_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/safeguarding/incidents":{"get":{"tags":["safeguarding"],"summary":"List Incidents","operationId":"list_incidents_api_safeguarding_incidents_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"tier","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tier"}},{"name":"school_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"School Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":200,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/safeguarding/incidents/{incident_id}":{"get":{"tags":["safeguarding"],"summary":"Get Incident","operationId":"get_incident_api_safeguarding_incidents__incident_id__get","parameters":[{"name":"incident_id","in":"path","required":true,"schema":{"type":"string","title":"Incident Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/safeguarding/incidents/{incident_id}/activity":{"get":{"tags":["safeguarding"],"summary":"Get Activity","description":"The incident timeline and its comment thread. AUDITED.\n\nThis wrote no IncidentAccess row. The module docstring in\nspar/safeguarding/access.py claims \"every read of the verbatim text, every\nacknowledgement and every resolution writes an immutable IncidentAccess\nrow\" -- and the comment thread, which is where the adults actually write\ndown what happened to a child, sat outside that guarantee entirely. The\ntimeline also carries every prior actor, their IP and their auth path.\n\nLogged as its own action rather than as `view_verbatim`, because the audit\ntrail must not claim a disclosure that did not happen -- the same reason\nview_incident only logs the verbatim action when verbatim was served.","operationId":"get_activity_api_safeguarding_incidents__incident_id__activity_get","parameters":[{"name":"incident_id","in":"path","required":true,"schema":{"type":"string","title":"Incident Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/safeguarding/incidents/{incident_id}/ack":{"post":{"tags":["safeguarding"],"summary":"Ack","operationId":"ack_api_safeguarding_incidents__incident_id__ack_post","parameters":[{"name":"incident_id","in":"path","required":true,"schema":{"type":"string","title":"Incident Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/safeguarding/incidents/{incident_id}/lift-hold":{"post":{"tags":["safeguarding"],"summary":"Lift Hold","description":"Release a student from the block without closing the incident.\n\nFor the case the block cannot otherwise survive: nobody at the school has\nresolved it, and the student has been locked out of their coursework long\nenough that the lockout is now the bigger harm. The incident stays open and\nthe escalation ladder keeps climbing.","operationId":"lift_hold_api_safeguarding_incidents__incident_id__lift_hold_post","parameters":[{"name":"incident_id","in":"path","required":true,"schema":{"type":"string","title":"Incident Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LiftHoldBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/safeguarding/incidents/{incident_id}/resolve":{"post":{"tags":["safeguarding"],"summary":"Resolve","operationId":"resolve_api_safeguarding_incidents__incident_id__resolve_post","parameters":[{"name":"incident_id","in":"path","required":true,"schema":{"type":"string","title":"Incident Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolveBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/safeguarding/incidents/{incident_id}/comments":{"post":{"tags":["safeguarding"],"summary":"Add Comment","operationId":"add_comment_api_safeguarding_incidents__incident_id__comments_post","parameters":[{"name":"incident_id","in":"path","required":true,"schema":{"type":"string","title":"Incident Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommentBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/safeguarding/comments/{comment_id}":{"patch":{"tags":["safeguarding"],"summary":"Edit Comment","operationId":"edit_comment_api_safeguarding_comments__comment_id__patch","parameters":[{"name":"comment_id","in":"path","required":true,"schema":{"type":"integer","title":"Comment Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommentBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["safeguarding"],"summary":"Delete Comment","operationId":"delete_comment_api_safeguarding_comments__comment_id__delete","parameters":[{"name":"comment_id","in":"path","required":true,"schema":{"type":"integer","title":"Comment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/safeguarding/metrics":{"get":{"tags":["safeguarding"],"summary":"Get Metrics","operationId":"get_metrics_api_safeguarding_metrics_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/safeguarding/recipients":{"get":{"tags":["safeguarding"],"summary":"List Recipients","operationId":"list_recipients_api_safeguarding_recipients_get","parameters":[{"name":"school_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"School Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["safeguarding"],"summary":"Add Recipient","operationId":"add_recipient_api_safeguarding_recipients_post","parameters":[{"name":"school_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"School Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecipientBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/safeguarding/recipients/test":{"post":{"tags":["safeguarding"],"summary":"Test Recipients","description":"Send every recipient a clearly-labelled test, and say who it reached.\n\nSame gate as changing who receives alerts, because it is the same\nquestion asked the other way round. Creates no incident and writes\nnothing: see notifier.send_test_alert.","operationId":"test_recipients_api_safeguarding_recipients_test_post","parameters":[{"name":"school_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"School Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/safeguarding/recipients/{recipient_id}":{"patch":{"tags":["safeguarding"],"summary":"Edit Recipient","operationId":"edit_recipient_api_safeguarding_recipients__recipient_id__patch","parameters":[{"name":"recipient_id","in":"path","required":true,"schema":{"type":"integer","title":"Recipient Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecipientBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["safeguarding"],"summary":"Remove Recipient","operationId":"remove_recipient_api_safeguarding_recipients__recipient_id__delete","parameters":[{"name":"recipient_id","in":"path","required":true,"schema":{"type":"integer","title":"Recipient Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/safeguarding/config-health":{"get":{"tags":["safeguarding"],"summary":"Config Health","description":"Schools whose incidents would detect, log, and notify nobody.\n\nA school with no active recipient is silent by construction — the notifier\nlogs a warning and sends nothing. This is the surface that makes that\nfailure visible instead of leaving it in a log file.","operationId":"config_health_api_safeguarding_config_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/safeguarding/incidents/{incident_id}/access":{"post":{"tags":["safeguarding"],"summary":"Magic Access","description":"Redeem an alert email's one-time link with a TOTP second factor.\n\nKept for the after-hours case: the person on call opens the incident from\ntheir phone without hunting for a password. It resolves to an account and\ngrants that ONE incident.","operationId":"magic_access_api_safeguarding_incidents__incident_id__access_post","parameters":[{"name":"incident_id","in":"path","required":true,"schema":{"type":"string","title":"Incident Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccessBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/safeguarding/incidents/{incident_id}/access/request-code":{"post":{"tags":["safeguarding"],"summary":"Magic Access Request Code","description":"Email a one-time code to a recipient holding a valid magic link.\n\nThe response is deliberately identical whether the address matched a\nrecipient or not. Anyone holding a leaked link could otherwise use this to\nenumerate which staff at a school are safeguarding recipients -- exactly\nthe roster a person who should not have the link would want.","operationId":"magic_access_request_code_api_safeguarding_incidents__incident_id__access_request_code_post","parameters":[{"name":"incident_id","in":"path","required":true,"schema":{"type":"string","title":"Incident Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestCodeBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/wellbeing/students":{"get":{"tags":["wellbeing"],"summary":"List Students","operationId":"list_students_api_wellbeing_students_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WellbeingStudentList"}}}}}}},"/api/wellbeing/students/{student_id}":{"get":{"tags":["wellbeing"],"summary":"Student Notes","operationId":"student_notes_api_wellbeing_students__student_id__get","parameters":[{"name":"student_id","in":"path","required":true,"schema":{"type":"integer","title":"Student Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WellbeingStudentDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/schools/{school_id}/safety-response":{"get":{"tags":["safeguarding"],"summary":"Read Safety Response","description":"What this school's paused students are shown. Any of its staff may read\nit — a teacher should know what a student of theirs is looking at.","operationId":"read_safety_response_schools__school_id__safety_response_get","parameters":[{"name":"school_id","in":"path","required":true,"schema":{"type":"integer","title":"School Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SafetyResponseRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["safeguarding"],"summary":"Update Safety Response","description":"Set this school's two lead messages and its crisis contacts.\n\nIts counselor or its admin. Everything is validated before anything is\nwritten, so a refused save changes nothing; the refusal is a 422 whose\ndetail carries a sentence for the person typing and the field it is about.","operationId":"update_safety_response_schools__school_id__safety_response_put","parameters":[{"name":"school_id","in":"path","required":true,"schema":{"type":"integer","title":"School Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SafetyResponseUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SafetyResponseRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/assignments/{assignment_id}/participation":{"get":{"tags":["participation"],"summary":"Assignment Participation","description":"Every student this assignment reaches, and where each of them got to.\n\nThe cohort comes from `roster.students_for_assignment` rather than from\nwhoever happens to have a BlockInstance row. Those differ in exactly the\ncase worth seeing: a student who has never opened the assignment has no\nrows at all, and reading the grid off the instances would omit the person\nthe teacher most needs to notice.","operationId":"assignment_participation_assignments__assignment_id__participation_get","parameters":[{"name":"assignment_id","in":"path","required":true,"schema":{"type":"integer","title":"Assignment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignmentParticipation"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/assignments/{assignment_id}/reflections":{"get":{"tags":["reflections"],"summary":"Assignment Reflections","description":"Every student this assignment reaches, with the reflections they wrote.\n\nStudents in roster order, each with zero or more reflections in step\norder. A recurring assignment can hold several for one step; all are\nreturned, oldest first.","operationId":"assignment_reflections_assignments__assignment_id__reflections_get","parameters":[{"name":"assignment_id","in":"path","required":true,"schema":{"type":"integer","title":"Assignment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignmentReflections"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/essays/{essay_id}/comment-exchanges":{"get":{"tags":["comment-exchanges"],"summary":"List Exchanges","description":"This round's exchanges, so the page can say which comments have been\nworked on and reopen one that is part-way through.","operationId":"list_exchanges_essays__essay_id__comment_exchanges_get","parameters":[{"name":"essay_id","in":"path","required":true,"schema":{"type":"string","title":"Essay Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CommentExchangeRead"},"title":"Response List Exchanges Essays  Essay Id  Comment Exchanges Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["comment-exchanges"],"summary":"Open Exchange","description":"Open the exchange on one comment, with Spar's first turn. Pressing it\nagain returns the same exchange: one go per comment, each round.","operationId":"open_exchange_essays__essay_id__comment_exchanges_post","parameters":[{"name":"essay_id","in":"path","required":true,"schema":{"type":"string","title":"Essay Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommentExchangeOpen"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommentExchangeRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/essays/{essay_id}/comment-exchanges/{exchange_id}/replies":{"post":{"tags":["comment-exchanges"],"summary":"Reply","operationId":"reply_essays__essay_id__comment_exchanges__exchange_id__replies_post","parameters":[{"name":"exchange_id","in":"path","required":true,"schema":{"type":"integer","title":"Exchange Id"}},{"name":"essay_id","in":"path","required":true,"schema":{"type":"string","title":"Essay Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommentExchangeSay"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommentExchangeRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/essays/{essay_id}/comment-exchanges/worked-on":{"get":{"tags":["comment-exchanges"],"summary":"Worked On","description":"How many comments the student worked on with Spar this round. For the\nteacher's process record. A count; there is no route that gives a teacher\nthe exchange itself.","operationId":"worked_on_essays__essay_id__comment_exchanges_worked_on_get","parameters":[{"name":"essay_id","in":"path","required":true,"schema":{"type":"string","title":"Essay Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommentsWorkedOn"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/assignments/{assignment_id}/submissions":{"get":{"tags":["submissions"],"summary":"Assignment Submissions","description":"Every student this assignment reaches, with what each handed in.\n\nStudents in roster order; within a student, work in step order. With\n`student_id`, that one student only — 404 if they are not someone this\nassignment reaches, so the answer cannot be used to ask who is.\n\nWho may read it is exactly who may read the assignment's reflections:\n`authorize_assignment_read`, the same subject check and the same width.","operationId":"assignment_submissions_assignments__assignment_id__submissions_get","parameters":[{"name":"assignment_id","in":"path","required":true,"schema":{"type":"integer","title":"Assignment Id"}},{"name":"student_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Student Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignmentSubmissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/classrooms/{classroom_id}/library":{"get":{"tags":["class-library"],"summary":"Class Library","description":"What this class is working from.\n\n`require_classroom_read` rather than `require_classroom_owner`: this is a\nread, and an admin covering an absent colleague needs to see what the class\nhas been given. Writing to any of it still goes through the routes that own\nit — the syllabus upload and the assignment's own source management — so\nthere is no write surface to widen here.","operationId":"class_library_classrooms__classroom_id__library_get","parameters":[{"name":"classroom_id","in":"path","required":true,"schema":{"type":"integer","title":"Classroom Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClassLibrary"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/classrooms/askable":{"get":{"tags":["class-staff"],"summary":"List Askable","description":"Classes at my school I am not on, each with its teacher's name: the\nsections the builder offers to ask about. Names only, and only staff.","operationId":"list_askable_classrooms_askable_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/AskableClass"},"type":"array","title":"Response List Askable Classrooms Askable Get"}}}}}}},"/classrooms/{classroom_id}/staff/ask":{"post":{"tags":["class-staff"],"summary":"Ask To Be Added","description":"One email to the class's teacher. Nothing is stored; they add me from\nthe class's Staff tab if they agree.","operationId":"ask_to_be_added_classrooms__classroom_id__staff_ask_post","parameters":[{"name":"classroom_id","in":"path","required":true,"schema":{"type":"integer","title":"Classroom Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AskResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/classrooms/{classroom_id}/staff":{"get":{"tags":["class-staff"],"summary":"List Staff","operationId":"list_staff_classrooms__classroom_id__staff_get","parameters":[{"name":"classroom_id","in":"path","required":true,"schema":{"type":"integer","title":"Classroom Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClassStaff"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["class-staff"],"summary":"Add Staff","operationId":"add_staff_classrooms__classroom_id__staff_post","parameters":[{"name":"classroom_id","in":"path","required":true,"schema":{"type":"integer","title":"Classroom Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StaffAdd"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClassStaff"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/classrooms/{classroom_id}/staff/candidates":{"get":{"tags":["class-staff"],"summary":"List Candidates","operationId":"list_candidates_classrooms__classroom_id__staff_candidates_get","parameters":[{"name":"classroom_id","in":"path","required":true,"schema":{"type":"integer","title":"Classroom Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/StaffCandidate"},"title":"Response List Candidates Classrooms  Classroom Id  Staff Candidates Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/classrooms/{classroom_id}/staff/{teacher_id}":{"delete":{"tags":["class-staff"],"summary":"Remove Staff","operationId":"remove_staff_classrooms__classroom_id__staff__teacher_id__delete","parameters":[{"name":"classroom_id","in":"path","required":true,"schema":{"type":"integer","title":"Classroom Id"}},{"name":"teacher_id","in":"path","required":true,"schema":{"type":"integer","title":"Teacher Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClassStaff"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/assignments/{assignment_id}/staff":{"get":{"tags":["assignment-staff"],"summary":"List Staff","operationId":"list_staff_assignments__assignment_id__staff_get","parameters":[{"name":"assignment_id","in":"path","required":true,"schema":{"type":"integer","title":"Assignment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignmentStaffView"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["assignment-staff"],"summary":"Add Staff","operationId":"add_staff_assignments__assignment_id__staff_post","parameters":[{"name":"assignment_id","in":"path","required":true,"schema":{"type":"integer","title":"Assignment Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StaffAdd"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignmentStaffView"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/assignments/{assignment_id}/staff/candidates":{"get":{"tags":["assignment-staff"],"summary":"List Candidates","operationId":"list_candidates_assignments__assignment_id__staff_candidates_get","parameters":[{"name":"assignment_id","in":"path","required":true,"schema":{"type":"integer","title":"Assignment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/StaffCandidate"},"title":"Response List Candidates Assignments  Assignment Id  Staff Candidates Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/assignments/{assignment_id}/staff/{teacher_id}":{"delete":{"tags":["assignment-staff"],"summary":"Remove Staff","operationId":"remove_staff_assignments__assignment_id__staff__teacher_id__delete","parameters":[{"name":"assignment_id","in":"path","required":true,"schema":{"type":"integer","title":"Assignment Id"}},{"name":"teacher_id","in":"path","required":true,"schema":{"type":"integer","title":"Teacher Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignmentStaffView"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/teachers/{teacher_id}/study-invites":{"post":{"tags":["independent study"],"summary":"Create Invite","description":"Invite one student to design an independent study.\n\nAccepting makes a class, so the school's rule on who may create one\napplies here, where the teacher can be told, and not later to the student.","operationId":"create_invite_teachers__teacher_id__study_invites_post","parameters":[{"name":"teacher_id","in":"path","required":true,"schema":{"type":"integer","title":"Teacher Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["independent study"],"summary":"List Teacher Invites","operationId":"list_teacher_invites_teachers__teacher_id__study_invites_get","parameters":[{"name":"teacher_id","in":"path","required":true,"schema":{"type":"integer","title":"Teacher Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/teachers/{teacher_id}/study-invites/{invite_id}":{"get":{"tags":["independent study"],"summary":"Read Teacher Invite","operationId":"read_teacher_invite_teachers__teacher_id__study_invites__invite_id__get","parameters":[{"name":"teacher_id","in":"path","required":true,"schema":{"type":"integer","title":"Teacher Id"}},{"name":"invite_id","in":"path","required":true,"schema":{"type":"integer","title":"Invite Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["independent study"],"summary":"Change Invite","description":"Change an invitation nobody has answered yet: where it was sent, what\nwas fixed, the level.","operationId":"change_invite_teachers__teacher_id__study_invites__invite_id__patch","parameters":[{"name":"teacher_id","in":"path","required":true,"schema":{"type":"integer","title":"Teacher Id"}},{"name":"invite_id","in":"path","required":true,"schema":{"type":"integer","title":"Invite Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitePatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["independent study"],"summary":"Delete Invite","description":"Delete an independent study that has not been published: the\ninvitation, the plan, and the hidden class.","operationId":"delete_invite_teachers__teacher_id__study_invites__invite_id__delete","parameters":[{"name":"teacher_id","in":"path","required":true,"schema":{"type":"integer","title":"Teacher Id"}},{"name":"invite_id","in":"path","required":true,"schema":{"type":"integer","title":"Invite Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/teachers/{teacher_id}/study-invites/{invite_id}/resend":{"post":{"tags":["independent study"],"summary":"Resend Invite","operationId":"resend_invite_teachers__teacher_id__study_invites__invite_id__resend_post","parameters":[{"name":"teacher_id","in":"path","required":true,"schema":{"type":"integer","title":"Teacher Id"}},{"name":"invite_id","in":"path","required":true,"schema":{"type":"integer","title":"Invite Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/teachers/{teacher_id}/study-invites/{invite_id}/deletion-code":{"post":{"tags":["independent study"],"summary":"Request Study Deletion Code","description":"Step one: the password, then a code to the teacher's inbox.","operationId":"request_study_deletion_code_teachers__teacher_id__study_invites__invite_id__deletion_code_post","parameters":[{"name":"teacher_id","in":"path","required":true,"schema":{"type":"integer","title":"Teacher Id"}},{"name":"invite_id","in":"path","required":true,"schema":{"type":"integer","title":"Invite Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Request Study Deletion Code Teachers  Teacher Id  Study Invites  Invite Id  Deletion Code Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/teachers/{teacher_id}/study-invites/{invite_id}/delete-closed":{"post":{"tags":["independent study"],"summary":"Delete Closed Study","description":"Step two: spend the code, and the closed study is gone for good. The\nstudent, their sessions and what they handed in are untouched.","operationId":"delete_closed_study_teachers__teacher_id__study_invites__invite_id__delete_closed_post","parameters":[{"name":"teacher_id","in":"path","required":true,"schema":{"type":"integer","title":"Teacher Id"}},{"name":"invite_id","in":"path","required":true,"schema":{"type":"integer","title":"Invite Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StudyDeleteConfirm"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete Closed Study Teachers  Teacher Id  Study Invites  Invite Id  Delete Closed Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/students/{student_id}/study-invites":{"get":{"tags":["independent study"],"summary":"List Student Invites","operationId":"list_student_invites_students__student_id__study_invites_get","parameters":[{"name":"student_id","in":"path","required":true,"schema":{"type":"integer","title":"Student Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/study/invites/{invite_id}/accept":{"post":{"tags":["independent study"],"summary":"Accept Invite","operationId":"accept_invite_study_invites__invite_id__accept_post","parameters":[{"name":"invite_id","in":"path","required":true,"schema":{"type":"integer","title":"Invite Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/study/invites/{invite_id}/decline":{"post":{"tags":["independent study"],"summary":"Decline Invite","operationId":"decline_invite_study_invites__invite_id__decline_post","parameters":[{"name":"invite_id","in":"path","required":true,"schema":{"type":"integer","title":"Invite Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/study/proposals/{proposal_id}":{"get":{"tags":["independent study"],"summary":"Read Plan","operationId":"read_plan_study_proposals__proposal_id__get","parameters":[{"name":"proposal_id","in":"path","required":true,"schema":{"type":"integer","title":"Proposal Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/study/proposals/{proposal_id}/plan":{"put":{"tags":["independent study"],"summary":"Write Plan","operationId":"write_plan_study_proposals__proposal_id__plan_put","parameters":[{"name":"proposal_id","in":"path","required":true,"schema":{"type":"integer","title":"Proposal Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/study/proposals/{proposal_id}/readings":{"post":{"tags":["independent study"],"summary":"Add Reading","description":"Add a reading: a citation, and its file if there is one.\n\nThe file is checked exactly as a teacher's material is (the same formats,\nthe same 25 MB, the same look inside it) and then HELD. Nothing a student\nuploads is read into a session until a teacher has published the plan it\nis on.","operationId":"add_reading_study_proposals__proposal_id__readings_post","parameters":[{"name":"proposal_id","in":"path","required":true,"schema":{"type":"integer","title":"Proposal Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_add_reading_study_proposals__proposal_id__readings_post"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/study/proposals/{proposal_id}/readings/{reading_id}":{"put":{"tags":["independent study"],"summary":"Move Reading","operationId":"move_reading_study_proposals__proposal_id__readings__reading_id__put","parameters":[{"name":"proposal_id","in":"path","required":true,"schema":{"type":"integer","title":"Proposal Id"}},{"name":"reading_id","in":"path","required":true,"schema":{"type":"integer","title":"Reading Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReadingMove"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["independent study"],"summary":"Remove Reading","operationId":"remove_reading_study_proposals__proposal_id__readings__reading_id__delete","parameters":[{"name":"proposal_id","in":"path","required":true,"schema":{"type":"integer","title":"Proposal Id"}},{"name":"reading_id","in":"path","required":true,"schema":{"type":"integer","title":"Reading Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/study/proposals/{proposal_id}/readings/{reading_id}/confirm":{"post":{"tags":["independent study"],"summary":"Confirm Reading","description":"The teacher says a held reading file is curriculum. Before publish,\npublish will now build it; on a running study it is handed to its\nmilestone's assignment at once. The teacher's call, not the student's:\nthe student's choices are to remove it or add the reading again with a\ndifferent file. The outbound guard still redacts any known identifier in\nit on the way to the build.","operationId":"confirm_reading_study_proposals__proposal_id__readings__reading_id__confirm_post","parameters":[{"name":"proposal_id","in":"path","required":true,"schema":{"type":"integer","title":"Proposal Id"}},{"name":"reading_id","in":"path","required":true,"schema":{"type":"integer","title":"Reading Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/study/proposals/{proposal_id}/readings/{reading_id}/parts":{"get":{"tags":["independent study"],"summary":"Reading Parts","description":"What Spar found in a reading: its chapters, from the file's bookmarks,\nor equal parts by pages when it has none. Nothing is moved by asking.","operationId":"reading_parts_study_proposals__proposal_id__readings__reading_id__parts_get","parameters":[{"name":"proposal_id","in":"path","required":true,"schema":{"type":"integer","title":"Proposal Id"}},{"name":"reading_id","in":"path","required":true,"schema":{"type":"integer","title":"Reading Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/study/proposals/{proposal_id}/readings/{reading_id}/spread":{"post":{"tags":["independent study"],"summary":"Spread Reading","operationId":"spread_reading_study_proposals__proposal_id__readings__reading_id__spread_post","parameters":[{"name":"proposal_id","in":"path","required":true,"schema":{"type":"integer","title":"Proposal Id"}},{"name":"reading_id","in":"path","required":true,"schema":{"type":"integer","title":"Reading Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SpreadIt"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/study/proposals/{proposal_id}/readings/{reading_id}/join":{"post":{"tags":["independent study"],"summary":"Join Reading","operationId":"join_reading_study_proposals__proposal_id__readings__reading_id__join_post","parameters":[{"name":"proposal_id","in":"path","required":true,"schema":{"type":"integer","title":"Proposal Id"}},{"name":"reading_id","in":"path","required":true,"schema":{"type":"integer","title":"Reading Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/study/proposals/{proposal_id}/readings/{reading_id}/place":{"put":{"tags":["independent study"],"summary":"Place Reading","operationId":"place_reading_study_proposals__proposal_id__readings__reading_id__place_put","parameters":[{"name":"proposal_id","in":"path","required":true,"schema":{"type":"integer","title":"Proposal Id"}},{"name":"reading_id","in":"path","required":true,"schema":{"type":"integer","title":"Reading Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Placing"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/study/proposals/{proposal_id}/comments":{"post":{"tags":["independent study"],"summary":"Add Comment","operationId":"add_comment_study_proposals__proposal_id__comments_post","parameters":[{"name":"proposal_id","in":"path","required":true,"schema":{"type":"integer","title":"Proposal Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommentCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/study/proposals/{proposal_id}/comments/{comment_id}/resolve":{"post":{"tags":["independent study"],"summary":"Resolve Comment","operationId":"resolve_comment_study_proposals__proposal_id__comments__comment_id__resolve_post","parameters":[{"name":"proposal_id","in":"path","required":true,"schema":{"type":"integer","title":"Proposal Id"}},{"name":"comment_id","in":"path","required":true,"schema":{"type":"integer","title":"Comment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/study/proposals/{proposal_id}/submit":{"post":{"tags":["independent study"],"summary":"Submit Plan","operationId":"submit_plan_study_proposals__proposal_id__submit_post","parameters":[{"name":"proposal_id","in":"path","required":true,"schema":{"type":"integer","title":"Proposal Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/study/proposals/{proposal_id}/take-back":{"post":{"tags":["independent study"],"summary":"Take Back Plan","description":"The student takes a plan they sent back, to change it and send it again.","operationId":"take_back_plan_study_proposals__proposal_id__take_back_post","parameters":[{"name":"proposal_id","in":"path","required":true,"schema":{"type":"integer","title":"Proposal Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/study/proposals/{proposal_id}/teacher-reading":{"post":{"tags":["independent study"],"summary":"Teacher Reading","description":"The teacher's page is open on the study. Sent when it opens and about\nonce a minute while it is visible; the student waits while it holds.","operationId":"teacher_reading_study_proposals__proposal_id__teacher_reading_post","parameters":[{"name":"proposal_id","in":"path","required":true,"schema":{"type":"integer","title":"Proposal Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["independent study"],"summary":"Teacher Done Reading","description":"The teacher left the page. The study is the student's again.","operationId":"teacher_done_reading_study_proposals__proposal_id__teacher_reading_delete","parameters":[{"name":"proposal_id","in":"path","required":true,"schema":{"type":"integer","title":"Proposal Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/study/proposals/{proposal_id}/request-revisions":{"post":{"tags":["independent study"],"summary":"Request Revisions","operationId":"request_revisions_study_proposals__proposal_id__request_revisions_post","parameters":[{"name":"proposal_id","in":"path","required":true,"schema":{"type":"integer","title":"Proposal Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/study/proposals/{proposal_id}/versions/{version_n}":{"get":{"tags":["independent study"],"summary":"Read Version","operationId":"read_version_study_proposals__proposal_id__versions__version_n__get","parameters":[{"name":"proposal_id","in":"path","required":true,"schema":{"type":"integer","title":"Proposal Id"}},{"name":"version_n","in":"path","required":true,"schema":{"type":"integer","title":"Version N"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/study/proposals/{proposal_id}/design/door":{"put":{"tags":["independent study"],"summary":"Choose Door","operationId":"choose_door_study_proposals__proposal_id__design_door_put","parameters":[{"name":"proposal_id","in":"path","required":true,"schema":{"type":"integer","title":"Proposal Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Door"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/study/proposals/{proposal_id}/design":{"post":{"tags":["independent study"],"summary":"Design Turn","operationId":"design_turn_study_proposals__proposal_id__design_post","parameters":[{"name":"proposal_id","in":"path","required":true,"schema":{"type":"integer","title":"Proposal Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DesignTurn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/study/proposals/{proposal_id}/lay-out":{"post":{"tags":["independent study"],"summary":"Lay Out","description":"Lay her readings out as milestones from the three things she chose.\nThe layout is arithmetic. A model is asked for one thing only: phrases of\nher own to offer back as titles, each checked against what she wrote.","operationId":"lay_out_study_proposals__proposal_id__lay_out_post","parameters":[{"name":"proposal_id","in":"path","required":true,"schema":{"type":"integer","title":"Proposal Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LayOut"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/study/proposals/{proposal_id}/design/undo":{"post":{"tags":["independent study"],"summary":"Undo Layout","operationId":"undo_layout_study_proposals__proposal_id__design_undo_post","parameters":[{"name":"proposal_id","in":"path","required":true,"schema":{"type":"integer","title":"Proposal Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/study/proposals/{proposal_id}/publish":{"post":{"tags":["independent study"],"summary":"Publish Plan","description":"The teacher agrees the plan. This is what opens the class.","operationId":"publish_plan_study_proposals__proposal_id__publish_post","parameters":[{"name":"proposal_id","in":"path","required":true,"schema":{"type":"integer","title":"Proposal Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/study/proposals/{proposal_id}/class":{"get":{"tags":["independent study"],"summary":"Read Class","operationId":"read_class_study_proposals__proposal_id__class_get","parameters":[{"name":"proposal_id","in":"path","required":true,"schema":{"type":"integer","title":"Proposal Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/study/proposals/{proposal_id}/opens-on":{"put":{"tags":["independent study"],"summary":"Set Opens On","operationId":"set_opens_on_study_proposals__proposal_id__opens_on_put","parameters":[{"name":"proposal_id","in":"path","required":true,"schema":{"type":"integer","title":"Proposal Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpensOn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/study/proposals/{proposal_id}/class/readings":{"post":{"tags":["independent study"],"summary":"Add Reading To Class","description":"Add a reading to a milestone of a running study. The student may, with\nnobody's agreement, until that milestone's writing is handed in.","operationId":"add_reading_to_class_study_proposals__proposal_id__class_readings_post","parameters":[{"name":"proposal_id","in":"path","required":true,"schema":{"type":"integer","title":"Proposal Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_add_reading_to_class_study_proposals__proposal_id__class_readings_post"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/study/proposals/{proposal_id}/amendments":{"post":{"tags":["independent study"],"summary":"Propose Change","operationId":"propose_change_study_proposals__proposal_id__amendments_post","parameters":[{"name":"proposal_id","in":"path","required":true,"schema":{"type":"integer","title":"Proposal Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AmendmentCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/study/proposals/{proposal_id}/amendments/{amendment_id}/decide":{"post":{"tags":["independent study"],"summary":"Decide Change","operationId":"decide_change_study_proposals__proposal_id__amendments__amendment_id__decide_post","parameters":[{"name":"proposal_id","in":"path","required":true,"schema":{"type":"integer","title":"Proposal Id"}},{"name":"amendment_id","in":"path","required":true,"schema":{"type":"integer","title":"Amendment Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Decision"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/study/proposals/{proposal_id}/close":{"post":{"tags":["independent study"],"summary":"Close Study","operationId":"close_study_study_proposals__proposal_id__close_post","parameters":[{"name":"proposal_id","in":"path","required":true,"schema":{"type":"integer","title":"Proposal Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shp/gate":{"get":{"tags":["shp"],"summary":"Read Gate","description":"What the signed-out gate may know. Not a secret.","operationId":"read_gate_api_shp_gate_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Read Gate Api Shp Gate Get"}}}}}}},"/api/shp/access":{"post":{"tags":["shp"],"summary":"Open Notebook","operationId":"open_notebook_api_shp_access_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShpAccessRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShpSessionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shp/session":{"get":{"tags":["shp"],"summary":"Read Session","operationId":"read_session_api_shp_session_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShpSessionResponse"}}}}}}},"/api/shp/logout":{"post":{"tags":["shp"],"summary":"Close Notebook","operationId":"close_notebook_api_shp_logout_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShpOk"}}}}}}},"/api/shp/content":{"get":{"tags":["shp"],"summary":"Read Content","operationId":"read_content_api_shp_content_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Read Content Api Shp Content Get"}}}}}}},"/api/shp/documents":{"get":{"tags":["shp"],"summary":"List Documents","operationId":"list_documents_api_shp_documents_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response List Documents Api Shp Documents Get"}}}}}}},"/api/shp/documents/{slug}":{"get":{"tags":["shp"],"summary":"Download Document","operationId":"download_document_api_shp_documents__slug__get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shp/questions":{"post":{"tags":["shp"],"summary":"Ask Question","description":"Save the question, then tell Salma. A failed email never fails the\nrequest: the row is the record.","operationId":"ask_question_api_shp_questions_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShpQuestionRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShpOk"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/shp/events":{"post":{"tags":["shp"],"summary":"Count Section View","operationId":"count_section_view_api_shp_events_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShpEventRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShpOk"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/audio/status":{"get":{"tags":["audio"],"summary":"Status","description":"Probe both pipelines so the frontend can show a meaningful state.","operationId":"status_audio_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AudioStatus"}}}}}}},"/audio/synthesize":{"post":{"tags":["audio"],"summary":"Synthesize","operationId":"synthesize_audio_synthesize_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SynthesizeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/audio/transcribe":{"post":{"tags":["audio"],"summary":"Transcribe","operationId":"transcribe_audio_transcribe_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_transcribe_audio_transcribe_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TranscribeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"AccessBody":{"properties":{"token":{"type":"string","title":"Token"},"totp_code":{"type":"string","title":"Totp Code","default":""},"code":{"type":"string","title":"Code","default":""},"email":{"type":"string","title":"Email","default":""}},"type":"object","required":["token"],"title":"AccessBody"},"AdminAuditEventRead":{"properties":{"id":{"type":"integer","title":"Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"actor_teacher_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Actor Teacher Id"},"actor_label":{"type":"string","title":"Actor Label"},"action":{"type":"string","title":"Action"},"school_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"School Id"},"subject_kind":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject Kind"},"subject_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject Id"},"summary":{"type":"string","title":"Summary"},"detail":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Detail"}},"type":"object","required":["id","created_at","actor_label","action","summary"],"title":"AdminAuditEventRead","description":"One act of administration: who, what, when.\n\n`summary` is a sentence about an account or a setting. It never carries a\nstudent's name, anything a student wrote, or a code."},"AffordanceType":{"type":"string","enum":["explain_correction","push_back_on_probe","tell_me_more"],"title":"AffordanceType"},"AmendmentCreate":{"properties":{"change":{"additionalProperties":true,"type":"object","title":"Change"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"type":"object","required":["change"],"title":"AmendmentCreate"},"AnalyzeInCompositionResponse":{"properties":{"observations":{"items":{"$ref":"#/components/schemas/EssayObservationRead"},"type":"array","title":"Observations","default":[]},"from_cache":{"type":"boolean","title":"From Cache","default":false},"skipped_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Skipped Reason"}},"type":"object","title":"AnalyzeInCompositionResponse"},"AnonymousSessionResponse":{"properties":{"student":{"$ref":"#/components/schemas/StudentRead"},"session":{"$ref":"#/components/schemas/SessionRead"},"opening_text":{"type":"string","title":"Opening Text"},"opening_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Opening Message"},"session_token":{"type":"string","title":"Session Token"}},"type":"object","required":["student","session","opening_text","session_token"],"title":"AnonymousSessionResponse"},"ArchiveDeleteConfirm":{"properties":{"code":{"type":"string","title":"Code"}},"type":"object","required":["code"],"title":"ArchiveDeleteConfirm","description":"The six digits mailed to the teacher. A string: leading zeros count."},"ArchivedClassroom":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"archived_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Archived At"},"former_teacher_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Former Teacher Id"},"former_teacher_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Former Teacher Name"},"student_count":{"type":"integer","title":"Student Count","default":0},"assignment_count":{"type":"integer","title":"Assignment Count","default":0}},"type":"object","required":["id","name"],"title":"ArchivedClassroom","description":"A dormant class an admin can bring back.\n\nformer_teacher_name is on the row because \"Room 4B\" means nothing weeks\nlater — \"Room 4B, was Mr. Dan's\" is what an admin is actually looking for."},"AskAction":{"properties":{"kind":{"type":"string","title":"Kind"},"label":{"type":"string","title":"Label"},"assignment_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Assignment Id"},"classroom_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Classroom Id"},"unit_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Unit Id"},"outcome_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Outcome Id"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mode"},"text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text"},"weeks":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Weeks"},"student_ids":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Student Ids"}},"type":"object","required":["kind","label"],"title":"AskAction","description":"Something to DO next, as a proposal the surface carries out.\n\nNothing here has happened. `draft_assignment` means Spar wrote the title\nand chose the mode; the row does not exist until the teacher sends it from\nthe builder — the same rule the unit-suggestion route already follows,\nbecause a suggestion nobody asked for becoming a row is how a course plan\nfills with work nobody chose."},"AskAnswer":{"properties":{"answer":{"type":"string","title":"Answer"},"actions":{"items":{"$ref":"#/components/schemas/AskAction"},"type":"array","title":"Actions","default":[]},"confirming":{"type":"boolean","title":"Confirming","default":false}},"type":"object","required":["answer"],"title":"AskAnswer"},"AskRequest":{"properties":{"question":{"type":"string","maxLength":500,"minLength":1,"title":"Question"},"surface":{"type":"string","maxLength":64,"title":"Surface","default":"teacher.home"},"assignment_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Assignment Id"},"history":{"items":{"$ref":"#/components/schemas/AskTurn"},"type":"array","maxItems":12,"title":"History"},"student_ids":{"items":{"type":"integer"},"type":"array","maxItems":5,"title":"Student Ids"}},"type":"object","required":["question"],"title":"AskRequest"},"AskResult":{"properties":{"sent":{"type":"boolean","title":"Sent"},"teacher_name":{"type":"string","title":"Teacher Name"}},"type":"object","required":["sent","teacher_name"],"title":"AskResult"},"AskTurn":{"properties":{"role":{"type":"string","maxLength":16,"title":"Role"},"text":{"type":"string","maxLength":2000,"title":"Text"}},"type":"object","required":["role","text"],"title":"AskTurn"},"AskableClass":{"properties":{"classroom_id":{"type":"integer","title":"Classroom Id"},"name":{"type":"string","title":"Name"},"teacher_name":{"type":"string","title":"Teacher Name"}},"type":"object","required":["classroom_id","name","teacher_name"],"title":"AskableClass"},"AssignmentBlockCreate":{"properties":{"block_type":{"type":"string","enum":["spar_session","composition","offline","group","incubate"],"title":"Block Type"},"position":{"type":"integer","minimum":0.0,"title":"Position"},"mode":{"anyOf":[{"type":"string","enum":["exploration","essay_preparation","exam_study","concept_review","problem_sets","creative_writing","reflection"]},{"type":"null"}],"title":"Mode"},"config":{"additionalProperties":true,"type":"object","title":"Config"},"content_ref":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Content Ref"},"humanized_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Humanized Title"},"session_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Label"},"badges":{"items":{"type":"string"},"type":"array","title":"Badges"}},"additionalProperties":false,"type":"object","required":["block_type","position"],"title":"AssignmentBlockCreate","description":"One block in a composed assignment's sequence, as authored by the Builder.\n\n`config` / `content_ref` are open JSON: per-block knobs differ by type and\nthe validated boundary lives in the Builder layer. `position` is the ordinal\nin the sequence."},"AssignmentBlockRead":{"properties":{"id":{"type":"integer","title":"Id"},"assignment_id":{"type":"integer","title":"Assignment Id"},"position":{"type":"integer","title":"Position"},"block_type":{"type":"string","enum":["spar_session","composition","offline","group","incubate"],"title":"Block Type"},"mode":{"anyOf":[{"type":"string","enum":["exploration","essay_preparation","exam_study","concept_review","problem_sets","creative_writing","reflection"]},{"type":"null"}],"title":"Mode"},"config":{"additionalProperties":true,"type":"object","title":"Config"},"content_ref":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Content Ref"},"humanized_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Humanized Title"},"session_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Label"},"badges":{"items":{"type":"string"},"type":"array","title":"Badges"},"synthesized":{"type":"boolean","title":"Synthesized","default":false}},"type":"object","required":["id","assignment_id","position","block_type"],"title":"AssignmentBlockRead"},"AssignmentClassInsights":{"properties":{"assignment_id":{"type":"integer","title":"Assignment Id"},"students_total":{"type":"integer","title":"Students Total"},"sessions_total":{"type":"integer","title":"Sessions Total"},"common_themes":{"items":{"type":"string"},"type":"array","title":"Common Themes","default":[]},"shared_gaps":{"items":{"type":"string"},"type":"array","title":"Shared Gaps","default":[]},"shared_misconceptions":{"items":{"type":"string"},"type":"array","title":"Shared Misconceptions","default":[]},"strongest_thread_distribution":{"items":{"$ref":"#/components/schemas/StrongestThreadCount"},"type":"array","title":"Strongest Thread Distribution","default":[]},"engagement_outliers":{"items":{"$ref":"#/components/schemas/EngagementOutlier"},"type":"array","title":"Engagement Outliers","default":[]},"summary_paragraph":{"type":"string","title":"Summary Paragraph","default":""},"generated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Generated At"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"cache_status":{"type":"string","enum":["fresh","regenerated"],"title":"Cache Status","default":"regenerated"}},"type":"object","required":["assignment_id","students_total","sessions_total"],"title":"AssignmentClassInsights","description":"LLM-aggregated patterns across all closed sessions for an assignment."},"AssignmentCoverage":{"properties":{"assignment_id":{"type":"integer","title":"Assignment Id"},"title":{"type":"string","title":"Title"},"mode":{"type":"string","title":"Mode"},"students_completed":{"type":"integer","title":"Students Completed"},"students_total":{"type":"integer","title":"Students Total"},"most_common_strongest_thread":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Most Common Strongest Thread"},"most_common_gap":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Most Common Gap"},"per_student":{"items":{"$ref":"#/components/schemas/CoveragePerStudent"},"type":"array","title":"Per Student","default":[]}},"type":"object","required":["assignment_id","title","mode","students_completed","students_total"],"title":"AssignmentCoverage"},"AssignmentCreate":{"properties":{"teacher_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Teacher Id"},"client_timezone":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Client Timezone"},"school_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"School Id"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"title":{"type":"string","title":"Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"mode":{"type":"string","enum":["exploration","essay_preparation","exam_study","concept_review","problem_sets","creative_writing","reflection"],"title":"Mode"},"cycle_target":{"type":"string","title":"Cycle Target","default":"single"},"target_cycles":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Target Cycles"},"output_expectation":{"type":"string","enum":["summary_only","preparation"],"title":"Output Expectation","default":"summary_only"},"ckl_unit":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ckl Unit"},"unit_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Unit Id"},"classroom_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Classroom Id"},"target_scope":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Scope"},"due_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Due Date"},"braindump_default_seconds":{"anyOf":[{"type":"integer","maximum":7200.0,"minimum":60.0},{"type":"null"}],"title":"Braindump Default Seconds"},"ckl_course":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ckl Course"},"ckl_content_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ckl Content Text"},"ckl_source_only":{"type":"boolean","title":"Ckl Source Only","default":false},"choice_pick_count":{"anyOf":[{"type":"integer","maximum":20.0,"minimum":1.0},{"type":"null"}],"title":"Choice Pick Count"},"recurrence":{"anyOf":[{"$ref":"#/components/schemas/RecurrenceConfig"},{"type":"null"}]},"guiding_questions":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":5},{"type":"null"}],"title":"Guiding Questions"},"guiding_questions_required":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Guiding Questions Required"},"teacher_background":{"anyOf":[{"type":"string","maxLength":8000},{"type":"null"}],"title":"Teacher Background"},"phase2_pause_threshold_seconds":{"type":"integer","maximum":120.0,"minimum":1.0,"title":"Phase2 Pause Threshold Seconds","default":8},"phase2_min_new_words_per_partial":{"type":"integer","maximum":1000.0,"minimum":1.0,"title":"Phase2 Min New Words Per Partial","default":80},"phase2_max_partials_per_cycle":{"type":"integer","maximum":50.0,"minimum":0.0,"title":"Phase2 Max Partials Per Cycle","default":8},"phase2_partial_analysis_mode":{"type":"string","const":"full","title":"Phase2 Partial Analysis Mode","default":"full"},"phase2_guaranteed_boundary_partial":{"type":"boolean","title":"Phase2 Guaranteed Boundary Partial","default":false},"phase_4_enabled":{"type":"boolean","title":"Phase 4 Enabled","default":true},"phase_4_required":{"type":"boolean","title":"Phase 4 Required","default":false},"standalone_phase_4_allowed":{"type":"boolean","title":"Standalone Phase 4 Allowed","default":true},"signed_submission_required":{"type":"boolean","title":"Signed Submission Required","default":false},"paste_disabled":{"type":"boolean","title":"Paste Disabled","default":true},"voice_input_enabled":{"type":"boolean","title":"Voice Input Enabled","default":true},"min_volley_exchanges":{"anyOf":[{"type":"integer","maximum":50.0,"minimum":0.0},{"type":"null"}],"title":"Min Volley Exchanges"},"min_braindump_seconds":{"type":"integer","maximum":7200.0,"minimum":60.0,"title":"Min Braindump Seconds","default":300},"min_braindump_words":{"type":"string","enum":["quick_write","standard","deep_think","no_minimum"],"title":"Min Braindump Words","default":"standard"},"mini_volley_enabled":{"type":"boolean","title":"Mini Volley Enabled","default":true},"in_composition_feedback_enabled":{"type":"boolean","title":"In Composition Feedback Enabled","default":true},"grammar_pass_enabled":{"type":"boolean","title":"Grammar Pass Enabled","default":true},"editorial_dialogue_depth":{"type":"string","enum":["light","standard","deep"],"title":"Editorial Dialogue Depth","default":"standard"}},"type":"object","required":["title","mode"],"title":"AssignmentCreate"},"AssignmentEffectivenessRow":{"properties":{"title":{"type":"string","title":"Title"},"avg_cycles":{"type":"number","title":"Avg Cycles"},"frame_revisions":{"type":"integer","title":"Frame Revisions"},"cycle_2_dev_pct":{"type":"integer","title":"Cycle 2 Dev Pct"}},"type":"object","required":["title","avg_cycles","frame_revisions","cycle_2_dev_pct"],"title":"AssignmentEffectivenessRow"},"AssignmentInsightCard":{"properties":{"title":{"type":"string","title":"Title"},"body":{"type":"string","title":"Body"}},"type":"object","required":["title","body"],"title":"AssignmentInsightCard"},"AssignmentInsights":{"properties":{"assignment_id":{"type":"integer","title":"Assignment Id"},"students_total":{"type":"integer","title":"Students Total"},"sessions_total":{"type":"integer","title":"Sessions Total"},"cards":{"items":{"$ref":"#/components/schemas/AssignmentInsightCard"},"type":"array","title":"Cards"},"per_student":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Per Student"}},"type":"object","required":["assignment_id","students_total","sessions_total","cards","per_student"],"title":"AssignmentInsights"},"AssignmentLogRead":{"properties":{"student_id":{"type":"integer","title":"Student Id"},"assignment_id":{"type":"integer","title":"Assignment Id"},"goal":{"anyOf":[{"$ref":"#/components/schemas/GoalProgressRead"},{"type":"null"}]},"entries":{"items":{"$ref":"#/components/schemas/LogEntryRead"},"type":"array","title":"Entries"},"entry_fields":{"items":{"type":"string"},"type":"array","title":"Entry Fields"},"threads":{"items":{"type":"string"},"type":"array","title":"Threads"},"capstone_available":{"type":"boolean","title":"Capstone Available","default":false}},"type":"object","required":["student_id","assignment_id"],"title":"AssignmentLogRead","description":"The student's whole log for one recurring assignment.\n\n`goal` is None on a non-recurring assignment, which is how a caller tells\nthe two apart without a second request."},"AssignmentOutcomesWrite":{"properties":{"outcome_ids":{"items":{"type":"integer"},"type":"array","title":"Outcome Ids","default":[]}},"additionalProperties":false,"type":"object","title":"AssignmentOutcomesWrite","description":"Replace-all: which outcomes this assignment is for.\n\nMirrors AssignmentTargetsWrite deliberately — same replace-all shape, same\nplace in the builder's save. An empty list is legal and means \"not for any\noutcome in particular\", which is a real answer for a diagnostic or a\none-off."},"AssignmentParticipation":{"properties":{"assignment_id":{"type":"integer","title":"Assignment Id"},"blocks":{"items":{"$ref":"#/components/schemas/ParticipationBlock"},"type":"array","title":"Blocks"},"students":{"items":{"$ref":"#/components/schemas/ParticipationRow"},"type":"array","title":"Students"},"sections":{"items":{"$ref":"#/components/schemas/ParticipationSection"},"type":"array","title":"Sections","default":[]}},"type":"object","required":["assignment_id","blocks","students"],"title":"AssignmentParticipation"},"AssignmentProgressRead":{"properties":{"student_id":{"type":"integer","title":"Student Id"},"assignment_id":{"type":"integer","title":"Assignment Id"},"current_block_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Current Block Id"},"current_index":{"type":"integer","title":"Current Index","default":0},"status":{"type":"string","enum":["not_started","in_progress","complete"],"title":"Status","default":"not_started"},"instances":{"items":{"$ref":"#/components/schemas/BlockInstanceRead"},"type":"array","title":"Instances"},"converge_alert":{"anyOf":[{"$ref":"#/components/schemas/ConvergeAlert"},{"type":"null"}]},"review_alert":{"anyOf":[{"$ref":"#/components/schemas/ReviewAlert"},{"type":"null"}]},"support_comment_alert":{"anyOf":[{"$ref":"#/components/schemas/SupportCommentAlert"},{"type":"null"}]},"safeguarding_hold":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Safeguarding Hold"},"current_session_state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Session State"},"on_earlier_version":{"type":"boolean","title":"On Earlier Version","default":false},"switch_offered":{"type":"boolean","title":"Switch Offered","default":false}},"type":"object","required":["student_id","assignment_id"],"title":"AssignmentProgressRead","description":"Student progress through a composed assignment, for the Lobby / Intro\nPage. `blocks` carries per-block status so the Intro Page can render the\nprogress bar + START HERE / UP NEXT badges; `current_block_id` is the\nresume target."},"AssignmentRead":{"properties":{"id":{"type":"integer","title":"Id"},"my_role":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"My Role"},"sections":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Sections"},"assignment_only":{"type":"boolean","title":"Assignment Only","default":false},"teacher_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Teacher Id"},"title":{"type":"string","title":"Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"opens_after_assignment_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Opens After Assignment Id"},"opens_after":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Opens After"},"memory_scope":{"type":"string","title":"Memory Scope","default":"assignment"},"recurrence":{"anyOf":[{"$ref":"#/components/schemas/RecurrenceConfig"},{"type":"null"}]},"guiding_questions":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":5},{"type":"null"}],"title":"Guiding Questions"},"guiding_questions_required":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Guiding Questions Required"},"teacher_background":{"anyOf":[{"type":"string","maxLength":8000},{"type":"null"}],"title":"Teacher Background"},"origin":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Origin"},"mode":{"type":"string","enum":["exploration","essay_preparation","exam_study","concept_review","problem_sets","creative_writing","reflection"],"title":"Mode"},"cycle_target":{"type":"string","title":"Cycle Target"},"target_cycles":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Target Cycles"},"output_expectation":{"type":"string","enum":["summary_only","preparation"],"title":"Output Expectation"},"ckl_unit":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ckl Unit"},"unit_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Unit Id"},"classroom_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Classroom Id"},"school_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"School Id"},"status":{"type":"string","title":"Status","default":"active"},"closed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Closed At"},"target_scope":{"type":"string","title":"Target Scope","default":"class_all"},"effective_due":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Effective Due"},"is_makeup":{"type":"boolean","title":"Is Makeup","default":false},"teacher_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Teacher Name"},"unit_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Unit Title"},"ckl_source_only":{"type":"boolean","title":"Ckl Source Only","default":false},"choice_pick_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Choice Pick Count"},"ckl_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ckl Status"},"ckl_page_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Ckl Page Count"},"due_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Due Date"},"braindump_default_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Braindump Default Seconds"},"phase2_pause_threshold_seconds":{"type":"integer","title":"Phase2 Pause Threshold Seconds","default":8},"phase2_min_new_words_per_partial":{"type":"integer","title":"Phase2 Min New Words Per Partial","default":80},"phase2_max_partials_per_cycle":{"type":"integer","title":"Phase2 Max Partials Per Cycle","default":8},"phase2_partial_analysis_mode":{"type":"string","const":"full","title":"Phase2 Partial Analysis Mode","default":"full"},"phase2_guaranteed_boundary_partial":{"type":"boolean","title":"Phase2 Guaranteed Boundary Partial","default":false},"phase_4_enabled":{"type":"boolean","title":"Phase 4 Enabled","default":true},"phase_4_required":{"type":"boolean","title":"Phase 4 Required","default":false},"standalone_phase_4_allowed":{"type":"boolean","title":"Standalone Phase 4 Allowed","default":true},"signed_submission_required":{"type":"boolean","title":"Signed Submission Required","default":false},"paste_disabled":{"type":"boolean","title":"Paste Disabled","default":true},"voice_input_enabled":{"type":"boolean","title":"Voice Input Enabled","default":true},"min_volley_exchanges":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Min Volley Exchanges"},"min_braindump_seconds":{"type":"integer","title":"Min Braindump Seconds","default":300},"min_braindump_words":{"type":"string","enum":["quick_write","standard","deep_think","no_minimum"],"title":"Min Braindump Words","default":"standard"},"mini_volley_enabled":{"type":"boolean","title":"Mini Volley Enabled","default":true},"in_composition_feedback_enabled":{"type":"boolean","title":"In Composition Feedback Enabled","default":true},"grammar_pass_enabled":{"type":"boolean","title":"Grammar Pass Enabled","default":true},"editorial_dialogue_depth":{"type":"string","enum":["light","standard","deep"],"title":"Editorial Dialogue Depth","default":"standard"},"inherited_ckl_doc_ids":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Inherited Ckl Doc Ids"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","title","mode","cycle_target","output_expectation","created_at"],"title":"AssignmentRead"},"AssignmentReflections":{"properties":{"assignment_id":{"type":"integer","title":"Assignment Id"},"title":{"type":"string","title":"Title"},"steps":{"items":{"$ref":"#/components/schemas/ReflectionStep"},"type":"array","title":"Steps"},"students":{"items":{"$ref":"#/components/schemas/StudentReflections"},"type":"array","title":"Students"}},"type":"object","required":["assignment_id","title","steps","students"],"title":"AssignmentReflections"},"AssignmentRosterRead":{"properties":{"assignment_id":{"type":"integer","title":"Assignment Id"},"assignment_title":{"type":"string","title":"Assignment Title"},"students":{"type":"integer","title":"Students","default":0},"logged_total":{"type":"number","title":"Logged Total","default":0},"counts":{"additionalProperties":true,"type":"object","title":"Counts"},"rows":{"items":{"$ref":"#/components/schemas/RosterRowRead"},"type":"array","title":"Rows"}},"type":"object","required":["assignment_id","assignment_title"],"title":"AssignmentRosterRead"},"AssignmentStaffMember":{"properties":{"teacher_id":{"type":"integer","title":"Teacher Id"},"name":{"type":"string","title":"Name"},"level":{"type":"string","title":"Level"},"from_class":{"type":"boolean","title":"From Class","default":false},"class_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Class Name"},"added_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Added At"}},"type":"object","required":["teacher_id","name","level"],"title":"AssignmentStaffMember"},"AssignmentStaffView":{"properties":{"assignment_id":{"type":"integer","title":"Assignment Id"},"members":{"items":{"$ref":"#/components/schemas/AssignmentStaffMember"},"type":"array","title":"Members"}},"type":"object","required":["assignment_id","members"],"title":"AssignmentStaffView"},"AssignmentSubmissions":{"properties":{"assignment_id":{"type":"integer","title":"Assignment Id"},"title":{"type":"string","title":"Title"},"steps":{"items":{"$ref":"#/components/schemas/SubmissionStep"},"type":"array","title":"Steps"},"reflection_steps":{"items":{"$ref":"#/components/schemas/ReflectionStep"},"type":"array","title":"Reflection Steps"},"students":{"items":{"$ref":"#/components/schemas/StudentSubmissions"},"type":"array","title":"Students"}},"type":"object","required":["assignment_id","title","steps","reflection_steps","students"],"title":"AssignmentSubmissions"},"AssignmentSummaryRead":{"properties":{"id":{"type":"integer","title":"Id"},"student_id":{"type":"integer","title":"Student Id"},"assignment_id":{"type":"integer","title":"Assignment Id"},"content":{"additionalProperties":true,"type":"object","title":"Content"},"source_block_instance_ids":{"items":{"type":"integer"},"type":"array","title":"Source Block Instance Ids"},"generated_at":{"type":"string","format":"date-time","title":"Generated At"}},"type":"object","required":["id","student_id","assignment_id","generated_at"],"title":"AssignmentSummaryRead"},"AssignmentTargetRead":{"properties":{"student_id":{"type":"integer","title":"Student Id"},"student_name":{"type":"string","title":"Student Name"},"classroom_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Classroom Id"},"effective_due":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Effective Due"}},"type":"object","required":["student_id","student_name"],"title":"AssignmentTargetRead"},"AssignmentTargetsWrite":{"properties":{"mode":{"type":"string","enum":["class_all","subset","cross_class","school_all"],"title":"Mode","default":"class_all"},"class_ids":{"items":{"type":"integer"},"type":"array","title":"Class Ids","default":[]},"student_ids":{"items":{"type":"integer"},"type":"array","title":"Student Ids","default":[]},"due_overrides":{"additionalProperties":{"type":"string","format":"date-time"},"type":"object","title":"Due Overrides","default":{}},"section_due":{"additionalProperties":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"type":"object","title":"Section Due","default":{}}},"additionalProperties":false,"type":"object","title":"AssignmentTargetsWrite","description":"Replace-all targeting for an assignment. `class_all` clears per-student\nrows (whole-class visibility via classroom_id); `subset`/`cross_class` name\nthe students explicitly; `school_all` reaches every student in the school\nand clears the home class. `class_ids` is the source class(es); the first is\nthe home class.\n\n`school_all` is accepted here and REFUSED in the route for anyone but an\nadmin -- the schema says what the vocabulary is, the route says who may use\nit. Leaving it out of the literal would answer a plain teacher's attempt\nwith a 422 about JSON shape rather than a 403 about permission."},"AssignmentThinkingSummaries":{"properties":{"assignment_id":{"type":"integer","title":"Assignment Id"},"assignment_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assignment Title"},"summaries":{"items":{"$ref":"#/components/schemas/StudentThinkingSummary"},"type":"array","title":"Summaries"}},"type":"object","required":["assignment_id"],"title":"AssignmentThinkingSummaries","description":"Every student's Thinking Summary for one assignment, in one response.\n\nExists so a teacher can save the whole class as ONE document rather than\nopening each student and printing them one at a time. Same privacy rule as\nthe single-session detail: summary prose only, never analyzer output."},"AssignmentUpdate":{"properties":{"client_timezone":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Client Timezone"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"unit_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Unit Id"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"mode":{"anyOf":[{"type":"string","enum":["exploration","essay_preparation","exam_study","concept_review","problem_sets","creative_writing","reflection"]},{"type":"null"}],"title":"Mode"},"classroom_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Classroom Id"},"recurrence":{"anyOf":[{"$ref":"#/components/schemas/RecurrenceConfig"},{"type":"null"}]},"guiding_questions":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":5},{"type":"null"}],"title":"Guiding Questions"},"guiding_questions_required":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Guiding Questions Required"},"teacher_background":{"anyOf":[{"type":"string","maxLength":8000},{"type":"null"}],"title":"Teacher Background"},"school_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"School Id"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"cycle_target":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cycle Target"},"target_cycles":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Target Cycles"},"output_expectation":{"anyOf":[{"type":"string","enum":["summary_only","preparation"]},{"type":"null"}],"title":"Output Expectation"},"due_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Due Date"},"braindump_default_seconds":{"anyOf":[{"type":"integer","maximum":7200.0,"minimum":60.0},{"type":"null"}],"title":"Braindump Default Seconds"},"ckl_source_only":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Ckl Source Only"},"choice_pick_count":{"anyOf":[{"type":"integer","maximum":20.0,"minimum":1.0},{"type":"null"}],"title":"Choice Pick Count"},"phase2_pause_threshold_seconds":{"anyOf":[{"type":"integer","maximum":120.0,"minimum":1.0},{"type":"null"}],"title":"Phase2 Pause Threshold Seconds"},"phase2_min_new_words_per_partial":{"anyOf":[{"type":"integer","maximum":1000.0,"minimum":1.0},{"type":"null"}],"title":"Phase2 Min New Words Per Partial"},"phase2_max_partials_per_cycle":{"anyOf":[{"type":"integer","maximum":50.0,"minimum":0.0},{"type":"null"}],"title":"Phase2 Max Partials Per Cycle"},"phase2_partial_analysis_mode":{"anyOf":[{"type":"string","const":"full"},{"type":"null"}],"title":"Phase2 Partial Analysis Mode"},"phase2_guaranteed_boundary_partial":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Phase2 Guaranteed Boundary Partial"},"phase_4_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Phase 4 Enabled"},"phase_4_required":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Phase 4 Required"},"standalone_phase_4_allowed":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Standalone Phase 4 Allowed"},"signed_submission_required":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Signed Submission Required"},"paste_disabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Paste Disabled"},"voice_input_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Voice Input Enabled"},"min_volley_exchanges":{"anyOf":[{"type":"integer","maximum":50.0,"minimum":0.0},{"type":"null"}],"title":"Min Volley Exchanges"},"min_braindump_seconds":{"anyOf":[{"type":"integer","maximum":7200.0,"minimum":60.0},{"type":"null"}],"title":"Min Braindump Seconds"},"min_braindump_words":{"anyOf":[{"type":"string","enum":["quick_write","standard","deep_think","no_minimum"]},{"type":"null"}],"title":"Min Braindump Words"},"mini_volley_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Mini Volley Enabled"},"in_composition_feedback_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"In Composition Feedback Enabled"},"grammar_pass_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Grammar Pass Enabled"},"editorial_dialogue_depth":{"anyOf":[{"type":"string","enum":["light","standard","deep"]},{"type":"null"}],"title":"Editorial Dialogue Depth"}},"type":"object","title":"AssignmentUpdate","description":"Partial update of an assignment. Only fields explicitly set are changed\n(use model_dump(exclude_unset=True)). Excludes identity/ownership\n(id/teacher_id/created_at/demo_ephemeral) and the create-only inline-CKL\nfields (ckl_unit/ckl_course/ckl_content_text — CKL file management is a\nseparate sub-project). The ckl_source_only toggle IS editable here."},"AudioStatus":{"properties":{"tts_available":{"type":"boolean","title":"Tts Available"},"stt_available":{"type":"boolean","title":"Stt Available"},"tts_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tts Error"},"stt_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stt Error"},"tts_voice":{"type":"string","title":"Tts Voice"},"stt_model":{"type":"string","title":"Stt Model"}},"type":"object","required":["tts_available","stt_available","tts_voice","stt_model"],"title":"AudioStatus"},"AuthClaimEmailRequest":{"properties":{"email":{"type":"string","title":"Email"}},"additionalProperties":false,"type":"object","required":["email"],"title":"AuthClaimEmailRequest"},"AuthClaimPasswordRequest":{"properties":{"password":{"type":"string","title":"Password"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"}},"additionalProperties":false,"type":"object","required":["password"],"title":"AuthClaimPasswordRequest"},"AuthCodeRequest":{"properties":{"code":{"type":"string","title":"Code"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"}},"additionalProperties":false,"type":"object","required":["code"],"title":"AuthCodeRequest","description":"A six-digit code, as a STRING. Leading zeros are significant — coercing\nto int turns 042931 into 42931 and refuses a correct code."},"AuthEmailCodeRequest":{"properties":{"email":{"type":"string","title":"Email"},"code":{"type":"string","title":"Code"},"password":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Password"}},"additionalProperties":false,"type":"object","required":["email","code"],"title":"AuthEmailCodeRequest","description":"The six digits, as a STRING, for the reason AuthCodeRequest gives."},"AuthEmailSession":{"properties":{"role":{"type":"string","enum":["teacher","student"],"title":"Role"},"password_required":{"type":"boolean","title":"Password Required","default":false},"teacher":{"anyOf":[{"$ref":"#/components/schemas/TeacherRead"},{"type":"null"}]},"teacher_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Teacher Token"},"student":{"anyOf":[{"$ref":"#/components/schemas/StudentRead"},{"type":"null"}]},"classroom":{"anyOf":[{"$ref":"#/components/schemas/ClassroomRead"},{"type":"null"}]},"student_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Student Token"}},"type":"object","required":["role"],"title":"AuthEmailSession","description":"Signed in by email. `role` says which half is filled in.\n\nOne shape for both because the sign-in LINK does not know who is going to\nopen it until it has been spent — the page it lands on reads `role` to\ndecide which side of the product to open."},"AuthEmailStartRequest":{"properties":{"email":{"type":"string","title":"Email"}},"additionalProperties":false,"type":"object","required":["email"],"title":"AuthEmailStartRequest","description":"Ask for a sign-in code and link."},"AuthInviteAcceptRequest":{"properties":{"token":{"type":"string","title":"Token"}},"additionalProperties":false,"type":"object","required":["token"],"title":"AuthInviteAcceptRequest","description":"The token out of an invite link's query string."},"AuthInviteAccepted":{"properties":{"teacher":{"$ref":"#/components/schemas/TeacherRead"},"teacher_token":{"type":"string","title":"Teacher Token"},"email":{"type":"string","title":"Email"},"claim_required":{"type":"boolean","title":"Claim Required","default":true}},"type":"object","required":["teacher","teacher_token","email"],"title":"AuthInviteAccepted","description":"Signed in, with the address the invite proved, and one step left.\n\n`claim_required` is always true here: arriving by invite means the address\nis settled and the password is not. It is stated rather than inferred\nbecause the client's next screen depends on it, and `must_claim` keys on\nthe school's kind — which would let an invited teacher at a demo school\nthrough with no password at all."},"AuthLoginRequest":{"properties":{"email":{"type":"string","title":"Email"},"password":{"type":"string","title":"Password"}},"additionalProperties":false,"type":"object","required":["email","password"],"title":"AuthLoginRequest"},"AuthSessionResponse":{"properties":{"teacher":{"$ref":"#/components/schemas/TeacherRead"},"teacher_token":{"type":"string","title":"Teacher Token"}},"type":"object","required":["teacher","teacher_token"],"title":"AuthSessionResponse"},"AuthStatusResponse":{"properties":{"teacher":{"$ref":"#/components/schemas/TeacherRead"},"claim_required":{"type":"boolean","title":"Claim Required"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"email_domains":{"items":{"type":"string"},"type":"array","title":"Email Domains","default":[]},"school_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"School Name"}},"type":"object","required":["teacher","claim_required"],"title":"AuthStatusResponse","description":"What this account still has to do before it is a real account."},"AutoFormRequest":{"properties":{"student_ids":{"items":{"type":"integer"},"type":"array","title":"Student Ids"},"size":{"type":"integer","title":"Size","default":4}},"additionalProperties":false,"type":"object","required":["student_ids"],"title":"AutoFormRequest"},"BehavioralInsight":{"properties":{"icon":{"type":"string","enum":["growth","watch","trend","milestone"],"title":"Icon","default":"trend"},"headline":{"type":"string","title":"Headline"},"body":{"type":"string","title":"Body"}},"type":"object","required":["headline","body"],"title":"BehavioralInsight","description":"A single plain-language insight card surfaced on the Insights tab.\n\nPrivacy: insights are derived from session pacing, cycle counts, and\nprivacy-filtered summary section bodies — never from analyzer JSON or\nraw braindump text. Body is paraphrased in classroom-friendly language."},"BigNumber":{"properties":{"label":{"type":"string","title":"Label"},"value":{"type":"integer","title":"Value"},"delta_text":{"type":"string","title":"Delta Text"},"delta_direction":{"type":"string","enum":["up","down","flat"],"title":"Delta Direction"},"context":{"type":"string","title":"Context"}},"type":"object","required":["label","value","delta_text","delta_direction","context"],"title":"BigNumber","description":"One of the three headline metrics on the cognitive engagement section."},"BlockInstanceRead":{"properties":{"id":{"type":"integer","title":"Id"},"student_id":{"type":"integer","title":"Student Id"},"assignment_id":{"type":"integer","title":"Assignment Id"},"block_id":{"type":"integer","title":"Block Id"},"session_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Session Id"},"essay_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Essay Id"},"source_block_instance_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Source Block Instance Id"},"status":{"type":"string","enum":["locked","available","in_progress","complete","abandoned"],"title":"Status"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"}},"type":"object","required":["id","student_id","assignment_id","block_id","status"],"title":"BlockInstanceRead"},"Body_add_class_documents_classrooms__classroom_id__documents_post":{"properties":{"files":{"items":{"type":"string","contentMediaType":"application/octet-stream"},"type":"array","title":"Files"}},"type":"object","required":["files"],"title":"Body_add_class_documents_classrooms__classroom_id__documents_post"},"Body_add_reading_study_proposals__proposal_id__readings_post":{"properties":{"citation":{"type":"string","title":"Citation"},"milestone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Milestone"},"file":{"anyOf":[{"type":"string","contentMediaType":"application/octet-stream"},{"type":"null"}],"title":"File"}},"type":"object","required":["citation"],"title":"Body_add_reading_study_proposals__proposal_id__readings_post"},"Body_add_reading_to_class_study_proposals__proposal_id__class_readings_post":{"properties":{"citation":{"type":"string","title":"Citation"},"milestone":{"type":"string","title":"Milestone"},"file":{"anyOf":[{"type":"string","contentMediaType":"application/octet-stream"},{"type":"null"}],"title":"File"}},"type":"object","required":["citation","milestone"],"title":"Body_add_reading_to_class_study_proposals__proposal_id__class_readings_post"},"Body_answer_version_switch_assignments__assignment_id__version_switch_post":{"properties":{"accept":{"type":"boolean","title":"Accept"}},"type":"object","required":["accept"],"title":"Body_answer_version_switch_assignments__assignment_id__version_switch_post"},"Body_classroom_roster_import_classrooms__classroom_id__roster_import_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_classroom_roster_import_classrooms__classroom_id__roster_import_post"},"Body_roster_import_schools__school_id__roster_import_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_roster_import_schools__school_id__roster_import_post"},"Body_transcribe_audio_transcribe_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"},"strip_fillers":{"type":"boolean","title":"Strip Fillers","default":true}},"type":"object","required":["file"],"title":"Body_transcribe_audio_transcribe_post"},"Body_upload_ckl_document_assignments__assignment_id__ckl_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"},"course":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Course"},"unit":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Unit"},"role":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Role"},"teacher_note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Teacher Note"}},"type":"object","required":["file"],"title":"Body_upload_ckl_document_assignments__assignment_id__ckl_post"},"Body_upload_syllabus_classrooms__classroom_id__syllabus_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_upload_syllabus_classrooms__classroom_id__syllabus_post"},"BraindumpAnalyzePartialRequest":{"properties":{"text":{"type":"string","minLength":1,"title":"Text","description":"Current in-progress braindump text."}},"type":"object","required":["text"],"title":"BraindumpAnalyzePartialRequest","description":"POST /sessions/{id}/braindump/analyze_partial body."},"BraindumpAnalyzePartialResponse":{"properties":{"analyzer_output":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Analyzer Output"},"cached":{"type":"boolean","title":"Cached"},"in_flight":{"type":"boolean","title":"In Flight","default":false},"word_count":{"type":"integer","title":"Word Count"}},"type":"object","required":["cached","word_count"],"title":"BraindumpAnalyzePartialResponse"},"BraindumpAnalyzeSafetyRequest":{"properties":{"text":{"type":"string","minLength":1,"title":"Text","description":"Current in-progress braindump text."},"trigger_kind":{"type":"string","title":"Trigger Kind","description":"pause | boundary | abandonment","default":"pause"}},"type":"object","required":["text"],"title":"BraindumpAnalyzeSafetyRequest"},"BraindumpAnalyzeSafetyResponse":{"properties":{"recorded":{"type":"boolean","title":"Recorded"}},"type":"object","required":["recorded"],"title":"BraindumpAnalyzeSafetyResponse"},"BraindumpComplete":{"properties":{"text":{"type":"string","title":"Text","description":"Final braindump text to append before analysis.","default":""},"force":{"type":"boolean","title":"Force","default":false},"phase2_metrics":{"anyOf":[{"$ref":"#/components/schemas/Phase2Metrics"},{"type":"null"}]}},"type":"object","title":"BraindumpComplete","description":"POST /sessions/{id}/braindump/complete body."},"BraindumpDraftSaveRequest":{"properties":{"text":{"type":"string","title":"Text","description":"Current in-progress braindump text."},"elapsed_ms":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Elapsed Ms"}},"type":"object","required":["text"],"title":"BraindumpDraftSaveRequest","description":"POST /sessions/{id}/braindump/draft body.\n\nUnlike the analyze_partial body this allows an empty string: a student\nwho selects-all-and-deletes has genuinely emptied their draft, and the\nsave must be able to record that rather than silently keep stale text."},"BraindumpDraftSaveResponse":{"properties":{"saved":{"type":"boolean","title":"Saved","default":true},"word_count":{"type":"integer","title":"Word Count","default":0}},"type":"object","title":"BraindumpDraftSaveResponse"},"BraindumpOfferSignalResponse":{"properties":{"ready":{"type":"boolean","title":"Ready","default":false},"thread":{"type":"string","title":"Thread","default":""},"tension":{"type":"string","title":"Tension","default":""},"asked":{"type":"boolean","title":"Asked","default":false}},"type":"object","title":"BraindumpOfferSignalResponse","description":"GET /sessions/{id}/braindump-signal — the signal-driven Volley→Braindump\noffer, read from services.volley_readiness. ready=True when the student\nhas enough to write from; thread and tension are Spar's naming of what\nthey built and what they left open, never a quotation. asked=True when\ntheir last turn asked to write and the door is open."},"BraindumpStart":{"properties":{"resume":{"type":"boolean","title":"Resume","default":false},"skip_bridge":{"type":"boolean","title":"Skip Bridge","default":false},"partner_talk_seconds":{"anyOf":[{"type":"integer","maximum":7200.0,"minimum":0.0},{"type":"null"}],"title":"Partner Talk Seconds"}},"type":"object","title":"BraindumpStart","description":"POST /sessions/{id}/braindump body.\n\n`skip_min_exchanges` USED TO BE HERE, and it was a plain bool on a body\nthe STUDENT sends: this route is gated by `resolve_session_token`, which is\nthe student's own credential, and `services.transition_to_braindump` simply\nset `phase1_exchange_count = MIN_PHASE_1_EXCHANGES` when it was true. So\nthe volley floor -- the thing that \"prevents premature exits before the\ndialogue has done its work\" -- was defeatable with one request field.\n\nThe frontend has always sent `false`. The two callers that genuinely need\nto skip the floor, `spar/cli.py` and `spar/agentic/runner.py`, call\n`services.transition_to_braindump` IN-PROCESS and still pass the keyword\nthere, so the operator tools are unaffected. It is simply no longer\nreachable over HTTP."},"BraindumpStartResponse":{"properties":{"session":{"$ref":"#/components/schemas/SessionRead"},"transition_text":{"type":"string","title":"Transition Text"},"draft_text":{"type":"string","title":"Draft Text","default":""},"held":{"type":"boolean","title":"Held","default":false},"handoff":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Handoff"}},"type":"object","required":["session","transition_text"],"title":"BraindumpStartResponse"},"BroadcastRequest":{"properties":{"text":{"type":"string","title":"Text"},"teacher_name":{"type":"string","title":"Teacher Name","default":"Teacher"}},"additionalProperties":false,"type":"object","required":["text"],"title":"BroadcastRequest"},"CKLDocumentRead":{"properties":{"id":{"type":"integer","title":"Id"},"assignment_id":{"type":"integer","title":"Assignment Id"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"source_type":{"type":"string","title":"Source Type"},"status":{"type":"string","title":"Status"},"page_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Page Count"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"node_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Node Count"},"is_library":{"type":"boolean","title":"Is Library","default":false},"role":{"type":"string","title":"Role","default":"main"},"teacher_note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Teacher Note"},"author":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Author"},"central_claim":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Central Claim"},"intel_origin":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Intel Origin"},"is_inherited":{"type":"boolean","title":"Is Inherited","default":false},"created_at":{"type":"string","format":"date-time","title":"Created At"},"built_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Built At"},"screen_status":{"type":"string","title":"Screen Status","default":"clear"},"screen_reasons":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Screen Reasons"}},"type":"object","required":["id","assignment_id","source_type","status","created_at"],"title":"CKLDocumentRead","description":"Status view of an assignment's attached CKL source document.\n\nThe teacher UI polls this after upload: `status` walks pending → ready/failed\nas the async PageIndex build runs. `node_count` is non-null once ready.\nRaw `pdf_bytes` and node text are never serialized here."},"CKLDocumentUpdate":{"properties":{"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"role":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Role"},"teacher_note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Teacher Note"},"author":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Author"},"central_claim":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Central Claim"}},"type":"object","title":"CKLDocumentUpdate","description":"Teacher edits to one attached source: what kind of source it is, how the\nclass should approach it, and a correction to the extracted author/claim.\n\nEvery field is optional and only the ones PRESENT are written — the author\nand central_claim the build extracted must survive a teacher editing only the\nnote, and `None` has to stay distinguishable from \"not sent\" or clearing the\nnote would be impossible to tell from leaving it alone. Hence\n`model_fields_set` at the call site rather than a plain dict dump."},"CalibrationSubmission":{"properties":{"chosen_claim_id":{"type":"string","minLength":1,"title":"Chosen Claim Id"},"justification_text":{"type":"string","title":"Justification Text"},"confidence":{"anyOf":[{"type":"integer","maximum":10.0,"minimum":1.0},{"type":"null"}],"title":"Confidence"}},"additionalProperties":false,"type":"object","required":["chosen_claim_id","justification_text"],"title":"CalibrationSubmission","description":"Client request to `submit_calibration`: the student's choice + why."},"CapturedBy":{"type":"string","enum":["spar","student"],"title":"CapturedBy"},"ClassDocumentRead":{"properties":{"id":{"type":"integer","title":"Id"},"filename":{"type":"string","title":"Filename"},"content_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content Type"},"parsed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Parsed At"},"position":{"type":"integer","title":"Position","default":0},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"screen_status":{"type":"string","title":"Screen Status","default":"clear"},"screen_reasons":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Screen Reasons"},"screen_confirmed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Screen Confirmed At"}},"type":"object","required":["id","filename"],"title":"ClassDocumentRead","description":"One of the documents a class is set up from. The bytes are fetched\nseparately; `parsed_at` is null when no text could be read out of it."},"ClassEngagementRow":{"properties":{"student_id":{"type":"integer","title":"Student Id"},"name":{"type":"string","title":"Name"},"sessions_this_week":{"type":"integer","title":"Sessions This Week"},"sessions_this_month":{"type":"integer","title":"Sessions This Month"},"avg_braindump_words":{"type":"integer","title":"Avg Braindump Words"},"braindump_trend":{"type":"string","enum":["up","down","stable"],"title":"Braindump Trend"},"avg_cycles_per_session":{"type":"number","title":"Avg Cycles Per Session"},"last_session_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Session At"},"engagement_trend":{"type":"string","enum":["increasing","stable","decreasing"],"title":"Engagement Trend"}},"type":"object","required":["student_id","name","sessions_this_week","sessions_this_month","avg_braindump_words","braindump_trend","avg_cycles_per_session","engagement_trend"],"title":"ClassEngagementRow"},"ClassLibrary":{"properties":{"classroom_id":{"type":"integer","title":"Classroom Id"},"syllabus":{"anyOf":[{"$ref":"#/components/schemas/ClassSyllabus"},{"type":"null"}]},"documents":{"items":{"$ref":"#/components/schemas/ClassDocumentRead"},"type":"array","title":"Documents","default":[]},"items":{"items":{"$ref":"#/components/schemas/LibraryItem"},"type":"array","title":"Items","default":[]}},"type":"object","required":["classroom_id"],"title":"ClassLibrary"},"ClassRhythmCell":{"properties":{"day":{"type":"integer","title":"Day"},"time_of_day":{"type":"string","enum":["morn","aft","eve"],"title":"Time Of Day"},"session_count":{"type":"integer","title":"Session Count"},"is_synthetic":{"type":"boolean","title":"Is Synthetic","default":false}},"type":"object","required":["day","time_of_day","session_count"],"title":"ClassRhythmCell"},"ClassStaff":{"properties":{"classroom_id":{"type":"integer","title":"Classroom Id"},"members":{"items":{"$ref":"#/components/schemas/StaffMember"},"type":"array","title":"Members"}},"type":"object","required":["classroom_id","members"],"title":"ClassStaff"},"ClassSyllabus":{"properties":{"filename":{"type":"string","title":"Filename"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"content_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content Type"},"parsed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Parsed At"},"unit_count":{"type":"integer","title":"Unit Count","default":0},"outcome_count":{"type":"integer","title":"Outcome Count","default":0}},"type":"object","required":["filename"],"title":"ClassSyllabus","description":"The one class-level attachment. Bytes are never served here — this says\nit exists and what came out of it; the existing download route serves it."},"ClassroomCreate":{"properties":{"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"period":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Period"},"term_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Term Id"}},"additionalProperties":false,"type":"object","required":["name"],"title":"ClassroomCreate"},"ClassroomDeletionPreview":{"properties":{"classroom_id":{"type":"integer","title":"Classroom Id"},"classroom_name":{"type":"string","title":"Classroom Name"},"students_unenrolled":{"items":{"$ref":"#/components/schemas/ClassroomStudentRef"},"type":"array","title":"Students Unenrolled","default":[]},"students_elsewhere":{"items":{"$ref":"#/components/schemas/ClassroomStudentRef"},"type":"array","title":"Students Elsewhere","default":[]},"sessions_kept":{"type":"integer","title":"Sessions Kept","default":0},"essays_kept":{"type":"integer","title":"Essays Kept","default":0},"archive_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Archive Id"},"recoverable_until":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recoverable Until"}},"type":"object","required":["classroom_id","classroom_name"],"title":"ClassroomDeletionPreview","description":"What deleting a class does — returned both before (preview) and after\n(what actually happened), so a confirmation can name real numbers.\n\nNothing is destroyed but the class, its enrollments, and the link from its\nassignments. Students, sessions and essays survive: they belong to the\nschool, not the class."},"ClassroomRead":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"teacher_id":{"type":"integer","title":"Teacher Id"},"school_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"School Id"},"term_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Term Id"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"period":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Period"},"syllabus_filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Syllabus Filename"},"syllabus_parsed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Syllabus Parsed At"},"syllabus_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Syllabus Title"},"visible_to_students":{"type":"boolean","title":"Visible To Students","default":true},"short_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Short Name"},"course_plan_published":{"type":"boolean","title":"Course Plan Published","default":false},"current_unit_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Current Unit Id"},"audience":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Audience"},"syllabus_screen_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Syllabus Screen Status"},"syllabus_screen_reasons":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Syllabus Screen Reasons"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"my_role":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"My Role"}},"type":"object","required":["id","name","teacher_id","created_at"],"title":"ClassroomRead"},"ClassroomRestoreResult":{"properties":{"classroom_id":{"type":"integer","title":"Classroom Id"},"classroom_name":{"type":"string","title":"Classroom Name"},"students_restored":{"type":"integer","title":"Students Restored","default":0},"sessions_restored":{"type":"integer","title":"Sessions Restored","default":0},"essays_restored":{"type":"integer","title":"Essays Restored","default":0}},"type":"object","required":["classroom_id","classroom_name"],"title":"ClassroomRestoreResult"},"ClassroomRevived":{"properties":{"classroom":{"$ref":"#/components/schemas/ClassroomRead"},"codes_reissued":{"type":"integer","title":"Codes Reissued","default":0}},"type":"object","required":["classroom"],"title":"ClassroomRevived"},"ClassroomStudentRef":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"}},"type":"object","required":["id","name"],"title":"ClassroomStudentRef"},"ClassroomUnarchive":{"properties":{"teacher_id":{"type":"integer","title":"Teacher Id"},"reissue_codes":{"type":"boolean","title":"Reissue Codes","default":false}},"additionalProperties":false,"type":"object","required":["teacher_id"],"title":"ClassroomUnarchive","description":"Hand a dormant class to a teacher.\n\nreissue_codes defaults to False on purpose: assigning a class and silently\nswitching thirty logins back on in one click gives the new teacher no\nmoment to look at the roster first, and those codes were last seen by a\nteacher who has left."},"ClassroomUpdate":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"period":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Period"},"term_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Term Id"},"syllabus_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Syllabus Title"},"visible_to_students":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Visible To Students"},"short_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Short Name"},"course_plan_published":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Course Plan Published"},"current_unit_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Current Unit Id"},"audience":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Audience"}},"additionalProperties":false,"type":"object","title":"ClassroomUpdate","description":"Registrar edit of class metadata. Only provided fields change."},"CloseAssignment":{"properties":{"due_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Due Date"}},"type":"object","title":"CloseAssignment","description":"Reopening past a dead deadline has to supply a new one."},"CloseConvergeRequest":{"properties":{"synthesis_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Synthesis Text"}},"additionalProperties":false,"type":"object","title":"CloseConvergeRequest"},"CodeLoginRequest":{"properties":{"code":{"type":"string","title":"Code"}},"additionalProperties":false,"type":"object","required":["code"],"title":"CodeLoginRequest"},"CognitiveEngagementSection":{"properties":{"big_numbers":{"items":{"$ref":"#/components/schemas/BigNumber"},"type":"array","title":"Big Numbers"},"term_arc":{"items":{"$ref":"#/components/schemas/TermArcPoint"},"type":"array","title":"Term Arc"},"interpretation":{"type":"string","title":"Interpretation"}},"type":"object","required":["big_numbers","term_arc","interpretation"],"title":"CognitiveEngagementSection"},"CognitiveVocabularySection":{"properties":{"tags":{"items":{"$ref":"#/components/schemas/TagDistributionRow"},"type":"array","title":"Tags"},"interpretation":{"type":"string","title":"Interpretation"}},"type":"object","required":["tags","interpretation"],"title":"CognitiveVocabularySection"},"CommentBody":{"properties":{"body":{"type":"string","maxLength":8000,"minLength":1,"title":"Body"}},"type":"object","required":["body"],"title":"CommentBody"},"CommentCreate":{"properties":{"section":{"type":"string","title":"Section"},"body":{"type":"string","title":"Body"}},"type":"object","required":["section","body"],"title":"CommentCreate"},"CommentExchangeOpen":{"properties":{"annotation_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Annotation Id"}},"type":"object","title":"CommentExchangeOpen"},"CommentExchangeRead":{"properties":{"id":{"type":"integer","title":"Id"},"annotation_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Annotation Id"},"round":{"type":"integer","title":"Round"},"transcript":{"items":{"$ref":"#/components/schemas/CommentExchangeTurn"},"type":"array","title":"Transcript"},"spar_turns":{"type":"integer","title":"Spar Turns","default":0},"max_spar_turns":{"type":"integer","title":"Max Spar Turns","default":3},"finished":{"type":"boolean","title":"Finished","default":false}},"type":"object","required":["id","round"],"title":"CommentExchangeRead"},"CommentExchangeSay":{"properties":{"text":{"type":"string","maxLength":1200,"minLength":1,"title":"Text"}},"type":"object","required":["text"],"title":"CommentExchangeSay"},"CommentExchangeTurn":{"properties":{"role":{"type":"string","title":"Role"},"text":{"type":"string","title":"Text"}},"type":"object","required":["role","text"],"title":"CommentExchangeTurn"},"CommentResponse":{"properties":{"body":{"type":"string","title":"Body"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["body","updated_at"],"title":"CommentResponse","description":"The student's short answer to one teacher comment."},"CommentResponseWrite":{"properties":{"body":{"type":"string","title":"Body"}},"type":"object","required":["body"],"title":"CommentResponseWrite"},"CommentsWorkedOn":{"properties":{"round":{"type":"integer","title":"Round","default":0},"comments_worked_on":{"type":"integer","title":"Comments Worked On","default":0}},"type":"object","title":"CommentsWorkedOn"},"ContactSubmitRequest":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Name"},"email":{"type":"string","maxLength":254,"minLength":3,"title":"Email"},"subject":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Subject"},"message":{"type":"string","maxLength":8000,"minLength":1,"title":"Message"},"website":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}],"title":"Website"}},"type":"object","required":["email","message"],"title":"ContactSubmitRequest","description":"POST /contact body — the public contact form (Contact.jsx).\n\n`name` and `subject` are optional; `email` and `message` are required.\n`website` is a honeypot: a real human leaves it blank, bots fill it.\nThe route silently accepts honeypot-filled submissions but drops them."},"ContactSubmitResponse":{"properties":{"ok":{"type":"boolean","title":"Ok","default":true}},"type":"object","title":"ContactSubmitResponse"},"ContinueCycleRequest":{"properties":{"mode":{"type":"string","enum":["phase1","phase2","close"],"title":"Mode"}},"type":"object","required":["mode"],"title":"ContinueCycleRequest"},"ContinueCycleResponse":{"properties":{"session":{"$ref":"#/components/schemas/SessionRead"},"opening_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Opening Text"},"closing_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Closing Text"},"summary_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary Text"}},"type":"object","required":["session"],"title":"ContinueCycleResponse"},"ContributionCreate":{"properties":{"text":{"type":"string","title":"Text"},"author_student_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Author Student Id"},"reply_to_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Reply To Id"},"kind":{"type":"string","title":"Kind","default":"contribution"},"teacher_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Teacher Name"},"move_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Move Type"}},"additionalProperties":false,"type":"object","required":["text"],"title":"ContributionCreate"},"ContributionEdit":{"properties":{"text":{"type":"string","title":"Text"}},"additionalProperties":false,"type":"object","required":["text"],"title":"ContributionEdit"},"ConvergeAlert":{"properties":{"group_id":{"type":"integer","title":"Group Id"},"converge_id":{"type":"integer","title":"Converge Id"},"state":{"type":"string","title":"State"},"opened":{"type":"boolean","title":"Opened","default":false}},"type":"object","required":["group_id","converge_id","state"],"title":"ConvergeAlert","description":"Lobby signal that a student's group Converge has opened since they last\nlooked. `opened` drives the badge; the ids let the lobby link straight in."},"ConvergeRead":{"properties":{"id":{"type":"integer","title":"Id"},"group_id":{"type":"integer","title":"Group Id"},"state":{"type":"string","title":"State"},"open_mode":{"type":"string","title":"Open Mode"},"fault_line_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fault Line Text"},"synthesis_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Synthesis Text"},"guidance":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Guidance"},"opens_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Opens At"},"closes_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Closes At"},"opened_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Opened At"},"closed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Closed At"}},"type":"object","required":["id","group_id","state","open_mode"],"title":"ConvergeRead"},"CourseCoverage":{"properties":{"units":{"items":{"$ref":"#/components/schemas/CoverageUnit"},"type":"array","title":"Units","default":[]},"course_wide":{"items":{"$ref":"#/components/schemas/CoverageOutcome"},"type":"array","title":"Course Wide","default":[]},"unplaced_assignments":{"items":{"$ref":"#/components/schemas/CoverageAssignment"},"type":"array","title":"Unplaced Assignments","default":[]}},"type":"object","title":"CourseCoverage","description":"The Board: every unit, its outcomes, and the work against each.\n\nOne read rather than a request per outcome. The Board's question is about\nthe whole course at once -- what it develops and what it never assigns\nagainst -- and that question answered N requests at a time is both slow\nand racy."},"CoursePlanCommit":{"properties":{"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"audience":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Audience"},"course_outcomes":{"items":{"$ref":"#/components/schemas/ProposedCourseOutcome"},"type":"array","title":"Course Outcomes","default":[]},"units":{"items":{"$ref":"#/components/schemas/ProposedUnit"},"type":"array","title":"Units","default":[]},"source":{"type":"string","enum":["syllabus","teacher","spar"],"title":"Source","default":"spar"}},"additionalProperties":false,"type":"object","title":"CoursePlanCommit","description":"The proposal as the teacher approved it. Replaces nothing by default —\nunits and outcomes are ADDED, because a teacher who re-reads a syllabus\nmid-term must not lose the outcomes they have since written by hand."},"CoursePlanCommitResult":{"properties":{"units_created":{"items":{"type":"string"},"type":"array","title":"Units Created","default":[]},"drafts_created":{"type":"integer","title":"Drafts Created","default":0},"course_outcomes_created":{"type":"integer","title":"Course Outcomes Created","default":0},"unit_outcomes_created":{"type":"integer","title":"Unit Outcomes Created","default":0}},"type":"object","title":"CoursePlanCommitResult"},"CoursePlanProposal":{"properties":{"description":{"type":"string","title":"Description","default":""},"outcomes_lead_in":{"type":"string","title":"Outcomes Lead In","default":""},"audience":{"type":"string","title":"Audience","default":""},"course_outcomes":{"items":{"$ref":"#/components/schemas/ProposedCourseOutcome"},"type":"array","title":"Course Outcomes","default":[]},"units":{"items":{"$ref":"#/components/schemas/ProposedUnit"},"type":"array","title":"Units","default":[]}},"type":"object","title":"CoursePlanProposal","description":"What Spar read out of the syllabus. Nothing here is saved yet."},"CoverageAssignment":{"properties":{"id":{"type":"integer","title":"Id"},"title":{"type":"string","title":"Title"},"status":{"type":"string","title":"Status"},"due_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Due Date"}},"type":"object","required":["id","title","status"],"title":"CoverageAssignment","description":"An assignment as the Board draws it: enough to recognise, nothing more.\n\nNot AssignmentRead. That model carries the whole phase configuration --\nbraindump seconds, partial-analysis mode, paste rules -- and the Board\nrenders a title, whether it has been sent, and when it is due. Sending the\nrest would put a class's entire assignment configuration on a read that\nexists to answer a coverage question."},"CoverageOutcome":{"properties":{"id":{"type":"integer","title":"Id"},"classroom_id":{"type":"integer","title":"Classroom Id"},"unit_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Unit Id"},"parent_outcome_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Parent Outcome Id"},"text":{"type":"string","title":"Text"},"position":{"type":"integer","title":"Position"},"source":{"type":"string","title":"Source"},"assignable":{"type":"boolean","title":"Assignable"},"assignments":{"items":{"$ref":"#/components/schemas/CoverageAssignment"},"type":"array","title":"Assignments","default":[]}},"type":"object","required":["id","classroom_id","text","position","source","assignable"],"title":"CoverageOutcome","description":"An outcome with the work that serves it.\n\nThe join is `assignment_outcomes` -- what a teacher said this piece of\nwork is FOR. An outcome with an empty list here is the Board's whole\npoint: something the course claims to develop and assigns nothing against."},"CoveragePerStudent":{"properties":{"student_id":{"type":"integer","title":"Student Id"},"name":{"type":"string","title":"Name"},"sessions":{"type":"integer","title":"Sessions"},"completed":{"type":"boolean","title":"Completed"}},"type":"object","required":["student_id","name","sessions","completed"],"title":"CoveragePerStudent"},"CoverageUnit":{"properties":{"id":{"type":"integer","title":"Id"},"classroom_id":{"type":"integer","title":"Classroom Id"},"name":{"type":"string","title":"Name"},"position":{"type":"integer","title":"Position"},"ckl_unit":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ckl Unit"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary"},"weeks":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Weeks"},"start_week":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Start Week"},"end_week":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"End Week"},"starts_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Starts On"},"ends_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Ends On"},"implied_term_start":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Implied Term Start"},"window_starts_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Window Starts On"},"window_ends_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Window Ends On"},"strand":{"type":"boolean","title":"Strand","default":false},"outcomes":{"items":{"$ref":"#/components/schemas/CoverageOutcome"},"type":"array","title":"Outcomes","default":[]},"unlinked_assignments":{"items":{"$ref":"#/components/schemas/CoverageAssignment"},"type":"array","title":"Unlinked Assignments","default":[]}},"type":"object","required":["id","classroom_id","name","position"],"title":"CoverageUnit"},"DashboardHeadlines":{"properties":{"check_in_with":{"items":{"$ref":"#/components/schemas/StudentFlag"},"type":"array","title":"Check In With"},"star_students":{"items":{"$ref":"#/components/schemas/StudentFlag"},"type":"array","title":"Star Students"},"dive_deeper":{"$ref":"#/components/schemas/DiveDeeperBundle"}},"type":"object","required":["check_in_with","star_students","dive_deeper"],"title":"DashboardHeadlines","description":"Combined response for GET /teachers/{id}/dashboard/headlines."},"Decision":{"properties":{"approve":{"type":"boolean","title":"Approve"}},"type":"object","required":["approve"],"title":"Decision"},"DepartureClassroom":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"}},"type":"object","required":["id","name"],"title":"DepartureClassroom"},"DeparturePreview":{"properties":{"teacher_id":{"type":"integer","title":"Teacher Id"},"teacher_name":{"type":"string","title":"Teacher Name"},"classrooms":{"items":{"$ref":"#/components/schemas/DepartureClassroom"},"type":"array","title":"Classrooms","default":[]},"classroom_count":{"type":"integer","title":"Classroom Count","default":0},"student_count":{"type":"integer","title":"Student Count","default":0},"essay_count":{"type":"integer","title":"Essay Count","default":0},"alert_recipient":{"type":"boolean","title":"Alert Recipient","default":false},"other_alert_recipients":{"type":"integer","title":"Other Alert Recipients","default":0},"only_admin":{"type":"boolean","title":"Only Admin","default":false},"keeps_record":{"type":"boolean","title":"Keeps Record","default":false}},"type":"object","required":["teacher_id","teacher_name"],"title":"DeparturePreview","description":"What removing this teacher would touch, shown BEFORE the admin chooses.\n\nCounts students and work, not just classes. \"Delete Mr. Dan\" is an easy\nclick; \"3 classes, 28 students, 41 essays\" is the same click with its\nconsequences attached, which is the only honest way to ask."},"DesignTurn":{"properties":{"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"about":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"About"},"more":{"type":"boolean","title":"More","default":false}},"type":"object","title":"DesignTurn"},"DialogueTurnRequest":{"properties":{"affordance_type":{"$ref":"#/components/schemas/AffordanceType"},"anchor_ref":{"type":"string","minLength":1,"title":"Anchor Ref"},"student_message":{"type":"string","maxLength":8000,"minLength":1,"title":"Student Message"}},"additionalProperties":false,"type":"object","required":["affordance_type","anchor_ref","student_message"],"title":"DialogueTurnRequest"},"DirectoryStudent":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"grade":{"type":"integer","title":"Grade"},"sis_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sis Id"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"}},"type":"object","required":["id","name","grade"],"title":"DirectoryStudent","description":"One student on a school's list, for the enroll-from-directory picker.\n\nNarrower than StudentRead, and NEVER carries an access code. A teacher\nbrowsing the directory is by definition looking at students who are not\ntheirs yet; handing over a working credential is the exact bug\nrequire_classroom_access exists to close. sis_id and email are here because\ntelling two students called J. Smith apart is the entire job of a picker,\nand a teacher at that school already sees both in the registrar CSV."},"DisclosureAcknowledgement":{"properties":{"acknowledged":{"type":"boolean","title":"Acknowledged","default":false}},"type":"object","title":"DisclosureAcknowledgement"},"DiveDeeperBundle":{"properties":{"active":{"items":{"$ref":"#/components/schemas/DiveDeeperObservationRead"},"type":"array","title":"Active"},"resolved":{"items":{"$ref":"#/components/schemas/DiveDeeperObservationRead"},"type":"array","title":"Resolved"},"closed":{"items":{"$ref":"#/components/schemas/DiveDeeperObservationRead"},"type":"array","title":"Closed"},"counts":{"$ref":"#/components/schemas/DiveDeeperCounts"}},"type":"object","required":["active","resolved","closed","counts"],"title":"DiveDeeperBundle","description":"Dive Deeper observations split by lifecycle state, plus counts.\n\nFrontend renders `active` cards inline, `resolved` (and `closed`) behind\nthe \"N patterns resolved this week\" collapsible toggle. `counts` powers\nthe meta line in the tile header."},"DiveDeeperCounts":{"properties":{"active":{"type":"integer","title":"Active"},"resolved":{"type":"integer","title":"Resolved"},"closed":{"type":"integer","title":"Closed"}},"type":"object","required":["active","resolved","closed"],"title":"DiveDeeperCounts","description":"Counts surfaced in the Dive Deeper meta line."},"DiveDeeperObservationRead":{"properties":{"id":{"type":"integer","title":"Id"},"pattern_key":{"type":"string","title":"Pattern Key"},"pattern_type":{"type":"string","enum":["factual_misconception","conceptual_misconception","craft_pattern","engagement_trend","cross_student_synthesis","shared_analytical_struggle"],"title":"Pattern Type"},"state":{"type":"string","enum":["active","resolved","closed"],"title":"State"},"students":{"items":{"type":"string"},"type":"array","title":"Students"},"synthesis_short":{"type":"string","title":"Synthesis Short"},"synthesis_long":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Synthesis Long"},"suggested_action":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Suggested Action"},"resolved_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Resolved At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"teacher_responses":{"items":{"$ref":"#/components/schemas/TeacherResponseRead"},"type":"array","title":"Teacher Responses"}},"type":"object","required":["id","pattern_key","pattern_type","state","students","synthesis_short","updated_at"],"title":"DiveDeeperObservationRead","description":"One observation on the Dive Deeper tile.\n\n`state` controls display: `active` and `resolved` render normally;\nafter `resolved_at` + 30 days the frontend collapses the entry into\na \"Past observations\" section inline.\n\n`teacher_responses` carries any recorded acknowledgements / notes —\nthe frontend uses these to render the Handled marker and any\nlong-form notes inline on the card."},"Door":{"properties":{"door":{"type":"string","title":"Door"}},"type":"object","required":["door"],"title":"Door"},"EditorialAdvanceRequest":{"properties":{"student_reply":{"type":"string","minLength":1,"title":"Student Reply"}},"type":"object","required":["student_reply"],"title":"EditorialAdvanceRequest"},"EditorialDialogueRead":{"properties":{"id":{"type":"string","title":"Id"},"essay_id":{"type":"string","title":"Essay Id"},"started_at":{"type":"string","format":"date-time","title":"Started At"},"ended_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Ended At"},"end_reason":{"anyOf":[{"type":"string","enum":["list_exhausted","student_ended"]},{"type":"null"}],"title":"End Reason"},"depth_at_start":{"type":"string","enum":["light","standard","deep"],"title":"Depth At Start","default":"standard"},"current_position":{"type":"integer","title":"Current Position","default":0},"exchange_count":{"type":"integer","title":"Exchange Count","default":0},"observations":{"items":{"$ref":"#/components/schemas/EditorialObservationRead"},"type":"array","title":"Observations","default":[]}},"type":"object","required":["id","essay_id","started_at"],"title":"EditorialDialogueRead"},"EditorialObservationRead":{"properties":{"id":{"type":"string","title":"Id"},"dialogue_id":{"type":"string","title":"Dialogue Id"},"position":{"type":"integer","title":"Position"},"type":{"type":"string","enum":["threads_raised_but_not_engaged","claims_asserted_without_development","structural_inconsistency","concept_review_mechanism_gap","problem_set_legibility","creative_writing_intention"],"title":"Type"},"paragraph_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Paragraph Id"},"claim_quote":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Claim Quote"},"quote_from_prior":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Quote From Prior"},"body":{"type":"string","title":"Body"},"student_reply":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Student Reply"},"presented_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Presented At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"}},"type":"object","required":["id","dialogue_id","position","type","body"],"title":"EditorialObservationRead"},"EngagementOutlier":{"properties":{"student_name":{"type":"string","title":"Student Name"},"student_id":{"type":"integer","title":"Student Id"},"note":{"type":"string","title":"Note"}},"type":"object","required":["student_name","student_id","note"],"title":"EngagementOutlier"},"EnrollmentCreate":{"properties":{"student_id":{"type":"integer","title":"Student Id"}},"additionalProperties":false,"type":"object","required":["student_id"],"title":"EnrollmentCreate"},"EnrollmentMove":{"properties":{"classroom_id":{"type":"integer","title":"Classroom Id"}},"additionalProperties":false,"type":"object","required":["classroom_id"],"title":"EnrollmentMove","description":"Move a student's enrollment to another class (leaves the first). Copy\n(staying in both) is a plain enroll into the destination."},"EnrollmentRead":{"properties":{"id":{"type":"integer","title":"Id"},"student_id":{"type":"integer","title":"Student Id"},"classroom_id":{"type":"integer","title":"Classroom Id"},"access_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Access Code"},"code_active":{"type":"boolean","title":"Code Active"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","student_id","classroom_id","code_active","created_at"],"title":"EnrollmentRead","description":"A roster row, including the student's working login code.\n\nThe code is readable here on purpose. Students have no email and no second\nfactor; the code IS the account, and the roster is where their teacher\nlooks it up when somebody forgets. The protection is that the roster itself\nis reachable only by the teacher who owns the class or an admin above them\n(require_classroom_access), not that the credential is unreadable."},"EnterPhase4Response":{"properties":{"session":{"$ref":"#/components/schemas/SessionRead"},"essay":{"$ref":"#/components/schemas/EssayRead"}},"type":"object","required":["session","essay"],"title":"EnterPhase4Response"},"EssayObservationRead":{"properties":{"id":{"type":"string","title":"Id"},"essay_id":{"type":"string","title":"Essay Id"},"type":{"type":"string","enum":["missed_threads","explain_more","missing_thesis","topic_mismatch","concept_review_mechanism_gap","problem_set_legibility","creative_writing_intention"],"title":"Type"},"paragraph_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Paragraph Id"},"claim_quote":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Claim Quote"},"quote_from_prior":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Quote From Prior"},"body":{"type":"string","title":"Body"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"viewed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Viewed At"},"dismissed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Dismissed At"}},"type":"object","required":["id","essay_id","type","body","created_at"],"title":"EssayObservationRead"},"EssayParagraphInput":{"properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id"},"position":{"type":"integer","title":"Position","default":0},"content":{"type":"string","title":"Content","default":""}},"type":"object","title":"EssayParagraphInput","description":"Client-supplied paragraph for save. `id` may be None for new paragraphs."},"EssayParagraphOut":{"properties":{"position":{"type":"integer","title":"Position"},"content":{"type":"string","title":"Content"}},"type":"object","required":["position","content"],"title":"EssayParagraphOut"},"EssayParagraphRead":{"properties":{"id":{"type":"string","title":"Id"},"position":{"type":"integer","title":"Position"},"content":{"type":"string","title":"Content"},"heading":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Heading"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","position","content","created_at","updated_at"],"title":"EssayParagraphRead"},"EssayRead":{"properties":{"id":{"type":"string","title":"Id"},"student_id":{"type":"integer","title":"Student Id"},"student_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Student Name"},"assignment_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Assignment Id"},"current_session_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Current Session Id"},"entry_mode":{"type":"string","enum":["full_pedagogy","standalone"],"title":"Entry Mode"},"state":{"type":"string","enum":["composition","editorial_dialogue","pre_submit","submitted","submitted_revising"],"title":"State"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"paragraphs":{"items":{"$ref":"#/components/schemas/EssayParagraphRead"},"type":"array","title":"Paragraphs","default":[]},"min_words_to_submit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Min Words To Submit"},"versions":{"items":{"$ref":"#/components/schemas/EssayVersionRead"},"type":"array","title":"Versions","default":[]},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"submitted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Submitted At"},"spar_signed":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Spar Signed"},"spar_analysis":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Spar Analysis"},"wellbeing_present":{"type":"boolean","title":"Wellbeing Present","default":false},"wellbeing_observation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wellbeing Observation"},"signed_artifact":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Signed Artifact"},"teacher_overview_note":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Teacher Overview Note"},"teacher_annotations":{"items":{"$ref":"#/components/schemas/TeacherAnnotation"},"type":"array","title":"Teacher Annotations","default":[]},"support_comments":{"items":{"$ref":"#/components/schemas/SupportComment"},"type":"array","title":"Support Comments","default":[]},"viewer_is_support":{"type":"boolean","title":"Viewer Is Support","default":false},"class_teacher_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Class Teacher Name"},"teacher_review_status":{"anyOf":[{"type":"string","enum":["not_yet_reviewed","in_review","pushed_back","re_submitted","accepted"]},{"type":"null"}],"title":"Teacher Review Status"},"revision_due":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Revision Due"},"revision_overdue":{"type":"boolean","title":"Revision Overdue","default":false},"revision_response_required":{"type":"boolean","title":"Revision Response Required","default":false},"revision_late":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Revision Late"},"revision_days_late":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Revision Days Late"},"revision_round":{"type":"integer","title":"Revision Round","default":0},"responses_missing":{"type":"integer","title":"Responses Missing","default":0},"previous_round":{"items":{"$ref":"#/components/schemas/PreviousRoundComment"},"type":"array","title":"Previous Round","default":[]}},"type":"object","required":["id","student_id","entry_mode","state","created_at","updated_at"],"title":"EssayRead"},"EssayRecommendation":{"properties":{"source":{"type":"string","enum":["in_composition","editorial"],"title":"Source"},"type":{"type":"string","title":"Type"},"body":{"type":"string","title":"Body"}},"type":"object","required":["source","type","body"],"title":"EssayRecommendation","description":"A carry-forward recommendation surfaced on the My Essays page.\n\nSourced either from in-composition observations (still active /\nnot dismissed) or from completed editorial-dialogue observations."},"EssayReferenceContent":{"properties":{"phase_1_history":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Phase 1 History","default":[]},"braindumps":{"items":{"type":"string"},"type":"array","title":"Braindumps","default":[]}},"type":"object","title":"EssayReferenceContent","description":"Student's own prior thinking, surfaced in the composition reference\npanel. Full-pedagogy entries return Phase 1 history + braindumps;\nstandalone entries return empty lists. STUDENT-FACING ONLY — never\nrendered for teachers."},"EssaySaveRequest":{"properties":{"paragraphs":{"items":{"$ref":"#/components/schemas/EssayParagraphInput"},"type":"array","title":"Paragraphs","default":[]}},"type":"object","title":"EssaySaveRequest","description":"Auto-save / explicit-save target. Replaces the working paragraph set."},"EssaySubmission":{"properties":{"block_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Block Id"},"essay_id":{"type":"string","title":"Essay Id"},"handed_in":{"type":"boolean","title":"Handed In"},"revising":{"type":"boolean","title":"Revising","default":false},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"paragraphs":{"items":{"$ref":"#/components/schemas/EssayParagraphOut"},"type":"array","title":"Paragraphs"},"word_count":{"type":"integer","title":"Word Count","default":0},"submitted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Submitted At"},"teacher_review_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Teacher Review Status"}},"type":"object","required":["essay_id","handed_in"],"title":"EssaySubmission"},"EssayTransitionRequest":{"properties":{"target_state":{"type":"string","enum":["composition","editorial_dialogue","pre_submit","submitted","submitted_revising"],"title":"Target State"}},"type":"object","required":["target_state"],"title":"EssayTransitionRequest"},"EssayVersionParagraphs":{"properties":{"id":{"type":"integer","title":"Id"},"state_entered":{"type":"string","title":"State Entered"},"word_count":{"type":"integer","title":"Word Count"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"paragraphs":{"items":{"$ref":"#/components/schemas/EssayParagraphInput"},"type":"array","title":"Paragraphs","default":[]}},"type":"object","required":["id","state_entered","word_count","created_at"],"title":"EssayVersionParagraphs","description":"One snapshot of an essay, with its text. For \"See what changed\"."},"EssayVersionRead":{"properties":{"id":{"type":"integer","title":"Id"},"state_entered":{"type":"string","title":"State Entered"},"word_count":{"type":"integer","title":"Word Count"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","state_entered","word_count","created_at"],"title":"EssayVersionRead"},"GatingStatus":{"properties":{"ready":{"type":"boolean","title":"Ready"},"completed":{"type":"integer","title":"Completed"},"total":{"type":"integer","title":"Total"},"waiting_on":{"type":"integer","title":"Waiting On"}},"type":"object","required":["ready","completed","total","waiting_on"],"title":"GatingStatus"},"GoalProgressRead":{"properties":{"unit":{"type":"string","enum":["hours","entries"],"title":"Unit","default":"entries"},"logged":{"type":"number","title":"Logged","default":0},"target":{"type":"number","title":"Target","default":0},"met":{"type":"boolean","title":"Met","default":false},"entries":{"type":"integer","title":"Entries","default":0}},"type":"object","title":"GoalProgressRead","description":"What the student has banked toward the goal. Every surface that shows a\nnumber reads this one — the student's counter, the capstone gate and the\nteacher's roster have to agree, and they only will if they agree by\nconstruction."},"GrammarIssue":{"properties":{"kind":{"type":"string","enum":["missing_terminal_punctuation","mid_thought_ending","stray_character"],"title":"Kind"},"snippet":{"type":"string","title":"Snippet"},"question":{"type":"string","title":"Question"},"char_start":{"type":"integer","title":"Char Start"},"char_end":{"type":"integer","title":"Char End"}},"type":"object","required":["kind","snippet","question","char_start","char_end"],"title":"GrammarIssue"},"GrammarParagraphIssues":{"properties":{"paragraph_id":{"type":"string","title":"Paragraph Id"},"issues":{"items":{"$ref":"#/components/schemas/GrammarIssue"},"type":"array","title":"Issues","default":[]}},"type":"object","required":["paragraph_id"],"title":"GrammarParagraphIssues"},"GrammarPassResponse":{"properties":{"paragraphs":{"items":{"$ref":"#/components/schemas/GrammarParagraphIssues"},"type":"array","title":"Paragraphs","default":[]}},"type":"object","title":"GrammarPassResponse"},"GroupCandidateRead":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"completed_loop":{"type":"boolean","title":"Completed Loop","default":false}},"type":"object","required":["id","name"],"title":"GroupCandidateRead","description":"A student eligible for grouping on a Converge block, with whether they've\nfinished their private loop — so the teacher sees who is already waiting to\nconverge (drives the 'form groups' nudge)."},"GroupCreate":{"properties":{"student_ids":{"items":{"type":"integer"},"type":"array","title":"Student Ids"},"name":{"type":"string","title":"Name","default":"Group"},"block_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Block Id"}},"additionalProperties":false,"type":"object","required":["student_ids"],"title":"GroupCreate"},"GroupMemberRead":{"properties":{"id":{"type":"integer","title":"Id"},"student_id":{"type":"integer","title":"Student Id"}},"type":"object","required":["id","student_id"],"title":"GroupMemberRead"},"GroupRead":{"properties":{"id":{"type":"integer","title":"Id"},"assignment_id":{"type":"integer","title":"Assignment Id"},"block_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Block Id"},"name":{"type":"string","title":"Name"},"members":{"items":{"$ref":"#/components/schemas/GroupMemberRead"},"type":"array","title":"Members"}},"type":"object","required":["id","assignment_id","name"],"title":"GroupRead"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"IdleStuckSignal":{"properties":{},"type":"object","title":"IdleStuckSignal","description":"Frontend tells the backend the combined idle + low-WPM signal fired.\n\nGenerator is NOT invoked — this only logs telemetry so per-session\ncounts capture stuck signals that didn't lead to a tap."},"InsightsPayload":{"properties":{"period":{"type":"string","enum":["30d","term","year"],"title":"Period"},"period_start":{"type":"string","format":"date-time","title":"Period Start"},"period_end":{"type":"string","format":"date-time","title":"Period End"},"students_total":{"type":"integer","title":"Students Total"},"sessions_total":{"type":"integer","title":"Sessions Total"},"cognitive_engagement":{"$ref":"#/components/schemas/CognitiveEngagementSection"},"cognitive_vocabulary":{"$ref":"#/components/schemas/CognitiveVocabularySection"},"pattern_lifecycle":{"items":{"$ref":"#/components/schemas/PatternLifecycleRow"},"type":"array","title":"Pattern Lifecycle"},"student_arcs":{"items":{"$ref":"#/components/schemas/StudentArcCard"},"type":"array","title":"Student Arcs"},"assignment_effectiveness":{"items":{"$ref":"#/components/schemas/AssignmentEffectivenessRow"},"type":"array","title":"Assignment Effectiveness"},"class_rhythm":{"items":{"$ref":"#/components/schemas/ClassRhythmCell"},"type":"array","title":"Class Rhythm"}},"type":"object","required":["period","period_start","period_end","students_total","sessions_total","cognitive_engagement","cognitive_vocabulary","pattern_lifecycle","student_arcs","assignment_effectiveness","class_rhythm"],"title":"InsightsPayload","description":"Combined response for GET /teachers/{id}/insights?period=..."},"IntroSeen":{"properties":{"part":{"type":"string","enum":["intro","tour"],"title":"Part"},"skipped":{"type":"boolean","title":"Skipped","default":false}},"type":"object","required":["part"],"title":"IntroSeen","description":"A student has been shown part of the introduction, or has skipped it.\n\n`part` is which half: the scenes, or the tour of home.\nSkipping the scenes skips the tour too, so `skipped` stamps both."},"InviteCreate":{"properties":{"student_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Student Id"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"grade":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Grade"},"age":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Age"},"fixed":{"additionalProperties":true,"type":"object","title":"Fixed","default":{}},"level":{"type":"string","title":"Level","default":"school"}},"type":"object","title":"InviteCreate"},"InvitePatch":{"properties":{"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"fixed":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Fixed"},"level":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Level"}},"type":"object","title":"InvitePatch"},"LayOut":{"properties":{"pages_per_week":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Pages Per Week"},"per_milestone":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Per Milestone"},"session":{"type":"boolean","title":"Session"},"write":{"type":"string","title":"Write"}},"type":"object","required":["session","write"],"title":"LayOut"},"LibraryItem":{"properties":{"document":{"$ref":"#/components/schemas/CKLDocumentRead"},"assignment_id":{"type":"integer","title":"Assignment Id"},"assignment_title":{"type":"string","title":"Assignment Title"}},"type":"object","required":["document","assignment_id","assignment_title"],"title":"LibraryItem"},"LiftHoldBody":{"properties":{"note":{"type":"string","title":"Note","default":""}},"type":"object","title":"LiftHoldBody"},"LogEntryCreate":{"properties":{"fields":{"additionalProperties":true,"type":"object","title":"Fields"},"value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Value"}},"type":"object","title":"LogEntryCreate","description":"Open a visit. `fields` is schema-free because the teacher chooses what\neach pass records."},"LogEntryRead":{"properties":{"id":{"type":"integer","title":"Id"},"entry_index":{"type":"integer","title":"Entry Index"},"fields":{"additionalProperties":true,"type":"object","title":"Fields"},"value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Value"},"status":{"type":"string","enum":["in_progress","complete","abandoned"],"title":"Status","default":"in_progress"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"}},"type":"object","required":["id","entry_index"],"title":"LogEntryRead","description":"One pass through a recurring assignment's sequence — a visit."},"MarkerCoverage":{"properties":{"school_id":{"type":"integer","title":"School Id"},"school":{"type":"string","title":"School"},"have":{"type":"integer","title":"Have","default":0},"eligible":{"type":"integer","title":"Eligible","default":0}},"type":"object","required":["school_id","school"],"title":"MarkerCoverage"},"MarkerFigure":{"properties":{"key":{"type":"string","title":"Key"},"label":{"type":"string","title":"Label"},"value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Value"},"hint":{"type":"string","title":"Hint","default":""},"format":{"type":"string","title":"Format","default":"plain"}},"type":"object","required":["key","label"],"title":"MarkerFigure"},"MarkerReading":{"properties":{"headline":{"type":"string","title":"Headline"},"points":{"items":{"$ref":"#/components/schemas/MarkerReadingPoint"},"type":"array","title":"Points"},"cautions":{"items":{"type":"string"},"type":"array","title":"Cautions"},"written_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Written At"},"pilots":{"type":"integer","title":"Pilots","default":0},"students":{"type":"integer","title":"Students","default":0},"markers_read":{"type":"integer","title":"Markers Read","default":0},"stale":{"type":"boolean","title":"Stale","default":false}},"type":"object","required":["headline"],"title":"MarkerReading","description":"A short reading of what the marker results add up to.\n\nWritten by a model from the aggregates in PlatformMarkers and nothing else.\n`stale` is True when the results it was written from have since been\nrecomputed — it is then a reading of older numbers than the cards show."},"MarkerReadingEnvelope":{"properties":{"reading":{"anyOf":[{"$ref":"#/components/schemas/MarkerReading"},{"type":"null"}]},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"type":"object","title":"MarkerReadingEnvelope"},"MarkerReadingPoint":{"properties":{"text":{"type":"string","title":"Text"},"rests":{"items":{"type":"string"},"type":"array","title":"Rests"}},"type":"object","required":["text"],"title":"MarkerReadingPoint"},"MarkerResult":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"n":{"type":"integer","title":"N","default":0},"n_unit":{"type":"string","title":"N Unit","default":""},"stale":{"type":"boolean","title":"Stale","default":false},"suppressed":{"type":"boolean","title":"Suppressed","default":false},"headline":{"items":{"$ref":"#/components/schemas/MarkerFigure"},"type":"array","title":"Headline"},"split_key":{"type":"string","title":"Split Key","default":""},"split_unit":{"type":"string","title":"Split Unit","default":""},"split":{"items":{"$ref":"#/components/schemas/MarkerSplit"},"type":"array","title":"Split"},"distribution":{"anyOf":[{"items":{"type":"number"},"type":"array"},{"type":"null"}],"title":"Distribution"},"computed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Computed At"}},"type":"object","required":["id","name"],"title":"MarkerResult","description":"What one marker says about pilot students, pooled and per pilot.\n\nPilot schools only: a demo or agentic school's students are in the stored\ncohort rows and are deliberately left out here."},"MarkerSplit":{"properties":{"school_id":{"type":"integer","title":"School Id"},"school":{"type":"string","title":"School"},"value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Value"},"n":{"type":"integer","title":"N","default":0},"suppressed":{"type":"boolean","title":"Suppressed","default":false}},"type":"object","required":["school_id","school"],"title":"MarkerSplit"},"MarkerWiring":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"kind":{"type":"string","title":"Kind","default":""},"status":{"type":"string","title":"Status","default":"never run"},"chain":{"items":{"type":"string"},"type":"array","title":"Chain"},"queue_label":{"type":"string","title":"Queue Label","default":"promotion"},"captured":{"type":"integer","title":"Captured","default":0},"captured_unit":{"type":"string","title":"Captured Unit","default":""},"last_computed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Computed At"},"engine":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Engine"},"coverage":{"items":{"$ref":"#/components/schemas/MarkerCoverage"},"type":"array","title":"Coverage"},"suppressed_pct":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Suppressed Pct"},"failures":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Failures"},"failure_note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Failure Note"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"}},"type":"object","required":["id","name"],"title":"MarkerWiring","description":"One cognitive marker, as plumbing: is it capturing, has it computed,\nhow much of each pilot does it cover.\n\n`chain` is five stages in a fixed order — capture, queue or promotion,\ncompute, stored, shown — each 'ok' | 'idle' | 'blocked' | 'off'.\n`status` is the one word: live | stale | never run | parked | not built."},"MemberMoveRequest":{"properties":{"to_group_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"To Group Id"}},"additionalProperties":false,"type":"object","title":"MemberMoveRequest"},"MemberSwapRequest":{"properties":{"student_a":{"type":"integer","title":"Student A"},"student_b":{"type":"integer","title":"Student B"}},"additionalProperties":false,"type":"object","required":["student_a","student_b"],"title":"MemberSwapRequest"},"MiniVolleyMessageRequest":{"properties":{"text":{"type":"string","maxLength":8000,"minLength":1,"title":"Text"}},"type":"object","required":["text"],"title":"MiniVolleyMessageRequest"},"MiniVolleyRead":{"properties":{"id":{"type":"string","title":"Id"},"essay_id":{"type":"string","title":"Essay Id"},"started_at":{"type":"string","format":"date-time","title":"Started At"},"ended_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Ended At"},"end_reason":{"anyOf":[{"type":"string","enum":["student_ended","exchange_cap","wall_clock_cap"]},{"type":"null"}],"title":"End Reason"},"exchange_count":{"type":"integer","title":"Exchange Count","default":0},"transcript":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Transcript","default":[]}},"type":"object","required":["id","essay_id","started_at"],"title":"MiniVolleyRead"},"MisconceptionCard":{"properties":{"assignment_id":{"type":"integer","title":"Assignment Id"},"assignment_title":{"type":"string","title":"Assignment Title"},"headline":{"type":"string","title":"Headline"},"correction":{"type":"string","title":"Correction"},"student_count":{"type":"integer","title":"Student Count"}},"type":"object","required":["assignment_id","assignment_title","headline","correction","student_count"],"title":"MisconceptionCard"},"ModerationRef":{"properties":{"kind":{"type":"string","enum":["event","report_contribution"],"title":"Kind"},"id":{"type":"integer","title":"Id"}},"additionalProperties":false,"type":"object","required":["kind","id"],"title":"ModerationRef"},"ModerationResolveRequest":{"properties":{"ref":{"$ref":"#/components/schemas/ModerationRef"},"action":{"type":"string","enum":["release","uphold","escalate","release_cooldown"],"title":"Action"}},"additionalProperties":false,"type":"object","required":["ref","action"],"title":"ModerationResolveRequest"},"NudgeRequest":{"properties":{"level":{"type":"integer","enum":[1,2,3],"title":"Level"},"braindump_so_far":{"type":"string","title":"Braindump So Far","default":""}},"type":"object","required":["level"],"title":"NudgeRequest","description":"Tap on the Braindump margin nudge button.\n\n`level` is the frontend-resolved escalation level (1, 2, or 3) per the\nstate machine in spar_sprint_plan.md §Sprint 2. `braindump_so_far` is\nthe live in-progress text — the orchestrator pairs it with the latest\ncached partial-analyzer chunk for the generator's source-rule pass."},"NudgeResponse":{"properties":{"nudge":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Nudge"},"level":{"type":"integer","title":"Level"},"fallback":{"type":"boolean","title":"Fallback","default":false},"route_to_phase1":{"type":"boolean","title":"Route To Phase1","default":false},"route_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Route Message"},"route_reason":{"anyOf":[{"type":"string","enum":["fallback_fire","consecutive_taps"]},{"type":"null"}],"title":"Route Reason"}},"type":"object","required":["level"],"title":"NudgeResponse"},"OpenChatStart":{"properties":{"student_id":{"type":"integer","title":"Student Id"},"opening_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Opening Message"}},"type":"object","required":["student_id"],"title":"OpenChatStart","description":"Open-chat session for a logged-in student.\n\nNo demo gating (the student is authenticated). Not assignment-bound,\nso Phase 2/3/4 transitions are unreachable — the session stays in\nPhase 1 dialogue mode for as long as the student keeps talking."},"OpenConvergeRequest":{"properties":{"fault_line_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fault Line Text"},"force":{"type":"boolean","title":"Force","default":false}},"additionalProperties":false,"type":"object","title":"OpenConvergeRequest"},"OpensOn":{"properties":{"opens_on":{"type":"string","title":"Opens On"}},"type":"object","required":["opens_on"],"title":"OpensOn"},"OutcomeCreate":{"properties":{"text":{"type":"string","title":"Text"},"unit_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Unit Id"},"parent_outcome_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Parent Outcome Id"},"position":{"type":"integer","title":"Position","default":0},"source":{"type":"string","enum":["syllabus","teacher","spar"],"title":"Source","default":"teacher"},"assignable":{"type":"boolean","title":"Assignable","default":true}},"additionalProperties":false,"type":"object","required":["text"],"title":"OutcomeCreate"},"OutcomeMapProposal":{"properties":{"outcome_ids":{"items":{"type":"integer"},"type":"array","title":"Outcome Ids","default":[]},"why":{"type":"string","title":"Why","default":""}},"type":"object","title":"OutcomeMapProposal","description":"Which outcomes Spar thinks a piece of work serves. SAVES NOTHING.\n\nReal ids, because the answer is the same data a teacher would have ticked\nby hand — the surface shows them as ticks to clear, not as a second kind\nof link. `why` names what in the WORK does the serving, so a teacher can\ndisagree with the reason rather than only the result.\n\nAn empty list is a real answer: work that serves none of the stated\noutcomes is a thing a teacher is allowed to set."},"OutcomeOrderWrite":{"properties":{"outcome_ids":{"items":{"type":"integer"},"type":"array","title":"Outcome Ids"}},"additionalProperties":false,"type":"object","required":["outcome_ids"],"title":"OutcomeOrderWrite","description":"Replace-all ordering — the outcome ids in the order they should sit."},"OutcomeRead":{"properties":{"id":{"type":"integer","title":"Id"},"classroom_id":{"type":"integer","title":"Classroom Id"},"unit_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Unit Id"},"parent_outcome_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Parent Outcome Id"},"text":{"type":"string","title":"Text"},"position":{"type":"integer","title":"Position"},"source":{"type":"string","title":"Source"},"assignable":{"type":"boolean","title":"Assignable"}},"type":"object","required":["id","classroom_id","text","position","source","assignable"],"title":"OutcomeRead"},"OutcomeUpdate":{"properties":{"text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text"},"unit_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Unit Id"},"parent_outcome_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Parent Outcome Id"},"position":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Position"},"source":{"anyOf":[{"type":"string","enum":["syllabus","teacher","spar"]},{"type":"null"}],"title":"Source"},"assignable":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Assignable"}},"additionalProperties":false,"type":"object","title":"OutcomeUpdate","description":"Edit an outcome. Only provided fields change.\n\nEditing `text` is what turns a Spar draft into the teacher's own, so a\ncaller that changes the words should send `source: \"teacher\"` with them.\nThe server does not infer it: a typo fix is not authorship."},"ParticipationBlock":{"properties":{"block_id":{"type":"integer","title":"Block Id"},"position":{"type":"integer","title":"Position"},"block_type":{"type":"string","title":"Block Type"},"mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mode"}},"type":"object","required":["block_id","position","block_type"],"title":"ParticipationBlock"},"ParticipationCell":{"properties":{"block_id":{"type":"integer","title":"Block Id"},"status":{"type":"string","title":"Status"},"session_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Session Id"},"essay_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Essay Id"}},"type":"object","required":["block_id","status"],"title":"ParticipationCell"},"ParticipationRow":{"properties":{"student_id":{"type":"integer","title":"Student Id"},"name":{"type":"string","title":"Name"},"cells":{"items":{"$ref":"#/components/schemas/ParticipationCell"},"type":"array","title":"Cells"},"section_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Section Id"}},"type":"object","required":["student_id","name","cells"],"title":"ParticipationRow"},"ParticipationSection":{"properties":{"classroom_id":{"type":"integer","title":"Classroom Id"},"name":{"type":"string","title":"Name"}},"type":"object","required":["classroom_id","name"],"title":"ParticipationSection"},"PatternLifecycleRow":{"properties":{"pattern_key":{"type":"string","title":"Pattern Key"},"name":{"type":"string","title":"Name"},"students_count":{"type":"integer","title":"Students Count"},"started_at":{"type":"string","format":"date-time","title":"Started At"},"resolved_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Resolved At"},"state":{"type":"string","enum":["active","resolved","closed"],"title":"State"}},"type":"object","required":["pattern_key","name","students_count","started_at","state"],"title":"PatternLifecycleRow"},"Phase2Metrics":{"properties":{"pauses":{"items":{"$ref":"#/components/schemas/Phase2PauseEvent"},"type":"array","title":"Pauses","default":[]},"partial_calls_fired":{"type":"integer","title":"Partial Calls Fired","default":0},"revision_count":{"type":"integer","title":"Revision Count","default":0}},"type":"object","title":"Phase2Metrics","description":"Phase 2 client telemetry, sent in the /complete payload."},"Phase2PauseEvent":{"properties":{"duration_ms":{"type":"integer","minimum":0.0,"title":"Duration Ms"},"word_count_at_pause_end":{"type":"integer","minimum":0.0,"title":"Word Count At Pause End"}},"type":"object","required":["duration_ms","word_count_at_pause_end"],"title":"Phase2PauseEvent","description":"Single client-buffered pause record sent at /complete.\n\n`word_count_at_pause_end` is the word count at the moment the pause\nENDED (i.e., what the analyzer would have seen if a partial had\nfired at that instant). The \"_end\" suffix is explicit because \"at\npause\" is ambiguous between the start of the silence and the\nkeystroke that broke it."},"Phase3Read":{"properties":{"synthesis_output":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Synthesis Output"},"dialogue_turns":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Dialogue Turns"}},"type":"object","title":"Phase3Read","description":"Read model for GET /sessions/{id}/phase3 (Brief 4). The latest cycle's\nstructured synthesis (what the student saw — student-facing, safe to return)\nplus its dialogue turns, so the frontend can render anchored affordances and\nthe Composition notes panel. Loose dicts: the content is already validated\nupstream (SynthesisOutput at emit time, DialogueTurn at persist time)."},"Placing":{"properties":{"milestone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Milestone"},"order":{"items":{"type":"integer"},"type":"array","title":"Order","default":[]}},"type":"object","title":"Placing","description":"Where a card goes: a milestone, or None for the shelf, and that\nmilestone's readings top to bottom with it in its new place."},"PlanPatch":{"properties":{"question":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Question"},"reasons":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reasons"},"milestones":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Milestones"},"final":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Final"},"precis_headings":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Precis Headings"}},"type":"object","title":"PlanPatch"},"PlatformEgress":{"properties":{"violations":{"type":"integer","title":"Violations","default":0},"ambiguous_name_parts":{"type":"integer","title":"Ambiguous Name Parts","default":0},"name_parts":{"type":"integer","title":"Name Parts","default":0},"name_parts_by_kind":{"additionalProperties":{"type":"integer"},"type":"object","title":"Name Parts By Kind"},"by_identifier_kind":{"additionalProperties":{"type":"integer"},"type":"object","title":"By Identifier Kind"},"by_call_kind":{"additionalProperties":{"type":"integer"},"type":"object","title":"By Call Kind"}},"type":"object","title":"PlatformEgress","description":"What the outbound guard caught. Kinds and counts, never a value."},"PlatformEmailKind":{"properties":{"kind":{"type":"string","title":"Kind"},"tracked":{"type":"boolean","title":"Tracked","default":true},"sent":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Sent"},"delivered":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Delivered"},"bounced":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Bounced"},"failed":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Failed"}},"type":"object","required":["kind"],"title":"PlatformEmailKind"},"PlatformFunnelStep":{"properties":{"key":{"type":"string","title":"Key"},"label":{"type":"string","title":"Label"},"students":{"type":"integer","title":"Students"},"pct":{"type":"integer","title":"Pct"}},"type":"object","required":["key","label","students","pct"],"title":"PlatformFunnelStep","description":"One step of the cross-pilot drop-off.\n\nThe thing a single school structurally cannot see: their own drop-off at a\nstep is a class having a bad week; every school stopping at the SAME step\nis the product's problem."},"PlatformHealth":{"properties":{"window":{"type":"string","title":"Window","default":"30d"},"generated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Generated At"},"reliability":{"items":{"$ref":"#/components/schemas/PlatformReliability"},"type":"array","title":"Reliability"},"queues":{"items":{"$ref":"#/components/schemas/QueueHealth"},"type":"array","title":"Queues"},"email":{"items":{"$ref":"#/components/schemas/PlatformEmailKind"},"type":"array","title":"Email"},"inbound":{"$ref":"#/components/schemas/PlatformInbound"},"roster_imports":{"$ref":"#/components/schemas/PlatformRosterImports"},"safeguarding":{"$ref":"#/components/schemas/PlatformSafeguarding"},"egress":{"$ref":"#/components/schemas/PlatformEgress"}},"type":"object","title":"PlatformHealth"},"PlatformInbound":{"properties":{"waitlist":{"type":"integer","title":"Waitlist","default":0},"contact_messages":{"type":"integer","title":"Contact Messages","default":0},"privacy_requests":{"type":"integer","title":"Privacy Requests","default":0},"demo_sessions":{"type":"integer","title":"Demo Sessions","default":0},"signin_failures":{"type":"integer","title":"Signin Failures","default":0}},"type":"object","title":"PlatformInbound"},"PlatformMarkers":{"properties":{"window":{"type":"string","title":"Window","default":"30d"},"generated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Generated At"},"pilots":{"type":"integer","title":"Pilots","default":0},"students":{"type":"integer","title":"Students","default":0},"markers":{"items":{"$ref":"#/components/schemas/MarkerWiring"},"type":"array","title":"Markers"},"results":{"items":{"$ref":"#/components/schemas/MarkerResult"},"type":"array","title":"Results"}},"type":"object","title":"PlatformMarkers"},"PlatformOverview":{"properties":{"schools":{"items":{"$ref":"#/components/schemas/PlatformSchoolRow"},"type":"array","title":"Schools"},"funnel":{"items":{"$ref":"#/components/schemas/PlatformFunnelStep"},"type":"array","title":"Funnel"},"spend_usd":{"type":"number","title":"Spend Usd","default":0.0},"spend_usd_non_pilot":{"type":"number","title":"Spend Usd Non Pilot","default":0.0},"spend_usd_unattributed":{"type":"number","title":"Spend Usd Unattributed","default":0.0},"spend_usd_removed_schools":{"type":"number","title":"Spend Usd Removed Schools","default":0.0},"spend_usd_total":{"type":"number","title":"Spend Usd Total","default":0.0},"unattributed_calls":{"type":"integer","title":"Unattributed Calls","default":0},"calls_unpriced":{"type":"integer","title":"Calls Unpriced","default":0},"models_unpriced":{"items":{"type":"string"},"type":"array","title":"Models Unpriced"},"students_total":{"type":"integer","title":"Students Total","default":0},"students_active":{"type":"integer","title":"Students Active","default":0},"schools_total":{"type":"integer","title":"Schools Total","default":0},"window":{"type":"string","title":"Window","default":"30d"},"generated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Generated At"}},"type":"object","title":"PlatformOverview"},"PlatformQueues":{"properties":{"queues":{"items":{"$ref":"#/components/schemas/QueueHealth"},"type":"array","title":"Queues"}},"type":"object","title":"PlatformQueues"},"PlatformReliability":{"properties":{"call_kind":{"type":"string","title":"Call Kind"},"calls":{"type":"integer","title":"Calls","default":0},"failures":{"type":"integer","title":"Failures","default":0},"p50_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"P50 Ms"},"p95_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"P95 Ms"},"top_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Top Error"}},"type":"object","required":["call_kind"],"title":"PlatformReliability"},"PlatformRosterImports":{"properties":{"runs":{"type":"integer","title":"Runs","default":0},"students_created":{"type":"integer","title":"Students Created","default":0},"runs_with_errors":{"type":"integer","title":"Runs With Errors","default":0},"rows_with_errors":{"type":"integer","title":"Rows With Errors","default":0},"last_run_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Run At"}},"type":"object","title":"PlatformRosterImports","description":"CSV roster imports in the window. Counts only — never a file's rows."},"PlatformSafeguarding":{"properties":{"tier_1":{"type":"integer","title":"Tier 1","default":0},"tier_2":{"type":"integer","title":"Tier 2","default":0},"tier_3":{"type":"integer","title":"Tier 3","default":0},"by_status":{"additionalProperties":{"type":"integer"},"type":"object","title":"By Status"},"time_to_ack_seconds":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Time To Ack Seconds"},"time_to_resolution_seconds":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Time To Resolution Seconds"},"detector_errors":{"type":"integer","title":"Detector Errors","default":0},"alerts_bounced":{"type":"integer","title":"Alerts Bounced","default":0},"schools_without_recipient":{"items":{"type":"string"},"type":"array","title":"Schools Without Recipient"}},"type":"object","title":"PlatformSafeguarding","description":"Counts and times across every school. No incident text, no student."},"PlatformSchoolAccess":{"properties":{"on":{"type":"boolean","title":"On"}},"type":"object","required":["on"],"title":"PlatformSchoolAccess","description":"Turn a whole school's access to Spar on or off."},"PlatformSchoolCreate":{"properties":{"name":{"type":"string","title":"Name"},"kind":{"type":"string","title":"Kind","default":"pilot"},"cohort_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Cohort Id"},"admin_name":{"type":"string","title":"Admin Name"},"admin_display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Admin Display Name"},"email_domains":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email Domains"},"admin_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Admin Email"}},"additionalProperties":false,"type":"object","required":["name","admin_name"],"title":"PlatformSchoolCreate","description":"A school and its first admin, in one act — a school with nobody in it is\nnot a thing anyone wants."},"PlatformSchoolCreated":{"properties":{"school":{"$ref":"#/components/schemas/SchoolRead"},"admin":{"$ref":"#/components/schemas/TeacherRead"},"admin_access_code":{"type":"string","title":"Admin Access Code"},"invite":{"anyOf":[{"$ref":"#/components/schemas/StaffInviteSent"},{"type":"null"}]}},"type":"object","required":["school","admin","admin_access_code"],"title":"PlatformSchoolCreated"},"PlatformSchoolDetails":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"starts_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Starts On"},"ends_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Ends On"},"seat_limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Seat Limit"},"budget_usd_monthly":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Budget Usd Monthly"},"contact_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Name"},"contact_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Email"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},"additionalProperties":false,"type":"object","title":"PlatformSchoolDetails","description":"Edit what a pilot agreement says about a school. Partial: only the\nfields present change, and an explicit null clears one.\n\nValidated in the endpoint rather than by patterns here, so a refusal\narrives as a sentence the form can show beside the field."},"PlatformSchoolKind":{"properties":{"kind":{"type":"string","pattern":"^(pilot|demo|agentic|workshop)$","title":"Kind"}},"type":"object","required":["kind"],"title":"PlatformSchoolKind"},"PlatformSchoolMobile":{"properties":{"enabled":{"type":"boolean","title":"Enabled"}},"type":"object","required":["enabled"],"title":"PlatformSchoolMobile"},"PlatformSchoolRow":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"kind":{"type":"string","title":"Kind","default":"pilot"},"mobile_enabled":{"type":"boolean","title":"Mobile Enabled","default":false},"cohort_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Cohort Id"},"cohort_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cohort Name"},"teachers":{"type":"integer","title":"Teachers","default":0},"teachers_active":{"type":"integer","title":"Teachers Active","default":0},"students":{"type":"integer","title":"Students","default":0},"students_started":{"type":"integer","title":"Students Started","default":0},"assignments":{"type":"integer","title":"Assignments","default":0},"completion_pct":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Completion Pct"},"spend_usd":{"type":"number","title":"Spend Usd","default":0.0},"llm_calls":{"type":"integer","title":"Llm Calls","default":0},"signed_in":{"type":"integer","title":"Signed In","default":0},"students_seen_7d":{"type":"integer","title":"Students Seen 7D","default":0},"finished":{"type":"integer","title":"Finished","default":0},"weekly_active":{"type":"integer","title":"Weekly Active","default":0},"active_students":{"type":"integer","title":"Active Students","default":0},"closed_sessions":{"type":"integer","title":"Closed Sessions","default":0},"stalled_sessions":{"type":"integer","title":"Stalled Sessions","default":0},"teachers_claimed":{"type":"integer","title":"Teachers Claimed","default":0},"assignments_live":{"type":"integer","title":"Assignments Live","default":0},"assignments_draft":{"type":"integer","title":"Assignments Draft","default":0},"waiting_review":{"type":"integer","title":"Waiting Review","default":0},"roster_requests":{"type":"integer","title":"Roster Requests","default":0},"funnel":{"items":{"type":"integer"},"type":"array","title":"Funnel"},"alert_recipient":{"type":"boolean","title":"Alert Recipient","default":true},"last_seen_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Seen At"},"status":{"type":"string","title":"Status","default":"live"},"starts_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Starts On"},"ends_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Ends On"},"contact_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Name"},"contact_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Email"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"seat_limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Seat Limit"},"seats_used":{"type":"integer","title":"Seats Used","default":0},"budget_usd_monthly":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Budget Usd Monthly"},"budget_spend_usd":{"type":"number","title":"Budget Spend Usd","default":0.0},"budget_used_pct":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Budget Used Pct"}},"type":"object","required":["id","name"],"title":"PlatformSchoolRow","description":"One school as the platform admin sees it.\n\nEverything here is a COUNT or a total — the platform surface compares\nschools, and comparing does not require reading anyone's writing."},"PlatformSpend":{"properties":{"window":{"type":"string","title":"Window","default":"30d"},"generated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Generated At"},"total_usd":{"type":"number","title":"Total Usd","default":0.0},"by_phase":{"items":{"$ref":"#/components/schemas/PlatformSpendPart"},"type":"array","title":"By Phase"},"by_model":{"items":{"$ref":"#/components/schemas/PlatformSpendPart"},"type":"array","title":"By Model"},"by_actor":{"items":{"$ref":"#/components/schemas/PlatformSpendPart"},"type":"array","title":"By Actor"},"trend":{"items":{"$ref":"#/components/schemas/PlatformSpendDay"},"type":"array","title":"Trend"},"cache_read_pct":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Cache Read Pct"},"pilot_usd":{"type":"number","title":"Pilot Usd","default":0.0},"active_students":{"type":"integer","title":"Active Students","default":0},"closed_sessions":{"type":"integer","title":"Closed Sessions","default":0},"cost_per_session_p50_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cost Per Session P50 Usd"},"cost_per_session_p95_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cost Per Session P95 Usd"}},"type":"object","title":"PlatformSpend","description":"The bill, cut three ways and over time. Same window and same estimate\nas PlatformOverview; `total_usd` equals its `spend_usd_total`."},"PlatformSpendDay":{"properties":{"day":{"type":"string","format":"date","title":"Day"},"usd":{"type":"number","title":"Usd","default":0.0}},"type":"object","required":["day"],"title":"PlatformSpendDay"},"PlatformSpendPart":{"properties":{"key":{"type":"string","title":"Key"},"usd":{"type":"number","title":"Usd","default":0.0},"calls":{"type":"integer","title":"Calls","default":0}},"type":"object","required":["key"],"title":"PlatformSpendPart","description":"One slice of the bill. `key` is the raw value (a call_kind, a model id,\nan actor kind); naming it for a reader is the page's job."},"PreviousRoundComment":{"properties":{"annotation_id":{"type":"integer","title":"Annotation Id"},"paragraph_id":{"type":"string","title":"Paragraph Id"},"body":{"type":"string","title":"Body"},"author_display_name":{"type":"string","title":"Author Display Name","default":""},"response":{"anyOf":[{"$ref":"#/components/schemas/CommentResponse"},{"type":"null"}]},"paragraph_removed":{"type":"boolean","title":"Paragraph Removed","default":false}},"type":"object","required":["annotation_id","paragraph_id","body"],"title":"PreviousRoundComment"},"PriorSessionContext":{"properties":{"session_id":{"type":"integer","title":"Session Id"},"session_date":{"type":"string","title":"Session Date"},"cycles_completed":{"type":"integer","title":"Cycles Completed","default":0},"topic":{"type":"string","title":"Topic"},"primary_claims":{"items":{"type":"string"},"type":"array","title":"Primary Claims"},"gaps":{"items":{"type":"string"},"type":"array","title":"Gaps"},"strongest_thread":{"type":"string","title":"Strongest Thread"},"suggested_direction":{"type":"string","title":"Suggested Direction"}},"type":"object","required":["session_id","session_date","topic","primary_claims","gaps","strongest_thread","suggested_direction"],"title":"PriorSessionContext","description":"Cross-session re-entry context for a returning student.\n\nDistilled from the most recent engaged closed session on this assignment.\nSent to the orchestrator (as a `<prior_sessions>` block in the Phase 1\nsystem prompt) and to the frontend (as a dismissible memory panel\nsurfaced to the student before Phase 1 begins).\n\nNo raw braindump text is included — that's a hard privacy boundary.\nFields are derived from the prose summary, which itself was built from\nthe analyzer's structured extraction, not the raw writing."},"PrivacyRequestSubmitRequest":{"properties":{"request_type":{"type":"string","enum":["access","correct","delete","opt_out","other"],"title":"Request Type"},"email":{"type":"string","maxLength":254,"minLength":3,"title":"Email"},"details":{"anyOf":[{"type":"string","maxLength":8000},{"type":"null"}],"title":"Details"},"website":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}],"title":"Website"}},"type":"object","required":["request_type","email"],"title":"PrivacyRequestSubmitRequest","description":"POST /privacy/request body — the data-rights form (PrivacyRequest.jsx).\n\n`request_type` selects the right being exercised; `details` is the\nfree-text description. `website` is a honeypot (see ContactSubmitRequest)."},"PrivacyRequestSubmitResponse":{"properties":{"ok":{"type":"boolean","title":"Ok","default":true}},"type":"object","title":"PrivacyRequestSubmitResponse"},"ProposedAssignment":{"properties":{"title":{"type":"string","title":"Title"},"due":{"type":"string","title":"Due","default":""}},"type":"object","required":["title"],"title":"ProposedAssignment","description":"Work the syllabus NAMES for a unit, and what it said about when.\n\n`due` is the syllabus's own words — \"6 Oct\", \"week 9\", \"end of unit\" —\nnever a date the model converted. Turning words into a date is this\ncodebase's job, where it can be done against the term and refused when it\nis ambiguous; a model asked to convert will always produce something."},"ProposedCourseOutcome":{"properties":{"text":{"type":"string","title":"Text"},"assignable":{"type":"boolean","title":"Assignable","default":true}},"type":"object","required":["text"],"title":"ProposedCourseOutcome"},"ProposedOutcome":{"properties":{"text":{"type":"string","title":"Text"},"serves_course_outcome":{"type":"integer","title":"Serves Course Outcome","default":0}},"type":"object","required":["text"],"title":"ProposedOutcome"},"ProposedUnit":{"properties":{"name":{"type":"string","title":"Name"},"summary":{"type":"string","title":"Summary","default":""},"weeks":{"type":"string","title":"Weeks","default":""},"strand":{"type":"boolean","title":"Strand","default":false},"outcomes":{"items":{"$ref":"#/components/schemas/ProposedOutcome"},"type":"array","title":"Outcomes","default":[]},"assignments":{"items":{"$ref":"#/components/schemas/ProposedAssignment"},"type":"array","title":"Assignments","default":[]}},"type":"object","required":["name"],"title":"ProposedUnit"},"PushBackRequest":{"properties":{"revision_due":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Revision Due"},"response_required":{"type":"boolean","title":"Response Required","default":false}},"type":"object","title":"PushBackRequest","description":"What the teacher asks for as she sends an essay back. Both optional:\nthe comments and the note are already on the server and are published in\nplace. `revision_due` is a calendar day, inclusive, like a due date."},"QueueHealth":{"properties":{"name":{"type":"string","title":"Name"},"pending":{"type":"integer","title":"Pending","default":0},"running":{"type":"integer","title":"Running","default":0},"failed":{"type":"integer","title":"Failed","default":0},"stuck":{"type":"integer","title":"Stuck","default":0},"oldest_pending_age_s":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Oldest Pending Age S"}},"type":"object","required":["name"],"title":"QueueHealth","description":"Depth and staleness for one background queue.\n\nExists because a dead worker is otherwise invisible. `scoring_queue` has had\na health_stats() since it was written and nothing ever surfaced it, so a dead\nscoring worker looks exactly like slow scoring; a dead CKL worker would look\nexactly like a slow build. `stuck` and a growing `oldest_pending_age_s` are\nthe two signals that separate \"working\" from \"nobody is home\"."},"ReactionRequest":{"properties":{"student_id":{"type":"integer","title":"Student Id"},"kind":{"type":"string","title":"Kind"}},"additionalProperties":false,"type":"object","required":["student_id","kind"],"title":"ReactionRequest"},"ReadingMove":{"properties":{"milestone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Milestone"},"pages":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Pages"}},"type":"object","title":"ReadingMove","description":"Which milestone a reading is in, or about how long it is. Only what is\nsent is changed: a length sent alone does not unplace the reading."},"RecipientBody":{"properties":{"teacher_id":{"type":"integer","title":"Teacher Id"},"role":{"type":"string","title":"Role","default":"primary"},"min_tier":{"type":"string","title":"Min Tier","default":"tier_2"},"active":{"type":"boolean","title":"Active","default":true}},"type":"object","required":["teacher_id"],"title":"RecipientBody"},"RecurrenceConfig":{"properties":{"goal_unit":{"type":"string","enum":["hours","entries"],"title":"Goal Unit","default":"entries"},"goal_target":{"type":"number","maximum":10000.0,"minimum":0.0,"title":"Goal Target","default":0},"entry_fields":{"items":{"type":"string"},"type":"array","maxItems":8,"title":"Entry Fields"},"capstone_block_position":{"anyOf":[{"type":"integer","maximum":50.0,"minimum":0.0},{"type":"null"}],"title":"Capstone Block Position"}},"type":"object","title":"RecurrenceConfig","description":"How many times a student runs an assignment's block sequence, and toward\nwhat. Absent (null) on an ordinary assignment, which is all of them by\ndefault — a Log is opt-in and every existing assignment stays a one-shot.\n\nValidated here rather than accepted as a free dict so a malformed goal\ncannot reach the executor, where it would show a student a target they can\nnever meet."},"ReflectionEntry":{"properties":{"block_id":{"type":"integer","title":"Block Id"},"text":{"type":"string","title":"Text"},"question":{"type":"string","title":"Question"},"question_recorded":{"type":"boolean","title":"Question Recorded"},"written_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Written At"}},"type":"object","required":["block_id","text","question","question_recorded"],"title":"ReflectionEntry"},"ReflectionStep":{"properties":{"block_id":{"type":"integer","title":"Block Id"},"position":{"type":"integer","title":"Position"},"title":{"type":"string","title":"Title"},"kind":{"type":"string","title":"Kind"},"question":{"type":"string","title":"Question"}},"type":"object","required":["block_id","position","title","kind","question"],"title":"ReflectionStep","description":"A step of the assignment that asks for a reflection."},"ReflectionSubmit":{"properties":{"text":{"type":"string","maxLength":8000,"title":"Text","default":""}},"type":"object","title":"ReflectionSubmit","description":"POST /sessions/{id}/reflection body: a discussion's closing reflection.\n\nRead by the student's teacher as written, which the student is told on the\nscreen before they write it."},"ReportRequest":{"properties":{"reporter_student_id":{"type":"integer","title":"Reporter Student Id"},"category":{"type":"string","title":"Category","default":"other"}},"additionalProperties":false,"type":"object","required":["reporter_student_id"],"title":"ReportRequest"},"RequestCodeBody":{"properties":{"token":{"type":"string","title":"Token"},"email":{"type":"string","title":"Email"}},"type":"object","required":["token","email"],"title":"RequestCodeBody"},"ResolveBody":{"properties":{"remedy_kind":{"type":"string","title":"Remedy Kind","description":"what was done; closed vocabulary"},"note":{"type":"string","minLength":1,"title":"Note"}},"type":"object","required":["remedy_kind","note"],"title":"ResolveBody"},"RestorableClassroom":{"properties":{"id":{"type":"integer","title":"Id"},"classroom_name":{"type":"string","title":"Classroom Name"},"student_count":{"type":"integer","title":"Student Count","default":0},"session_count":{"type":"integer","title":"Session Count","default":0},"essay_count":{"type":"integer","title":"Essay Count","default":0},"deleted_at":{"type":"string","format":"date-time","title":"Deleted At"}},"type":"object","required":["id","classroom_name","deleted_at"],"title":"RestorableClassroom","description":"A class this teacher archived, which can be restored at any time."},"ReturnToPhase1Request":{"properties":{"draft_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Draft Text"},"silent":{"type":"boolean","title":"Silent","default":false}},"type":"object","title":"ReturnToPhase1Request","description":"POST /sessions/{id}/return-to-phase1 body."},"ReturnToPhase1Response":{"properties":{"session":{"$ref":"#/components/schemas/SessionRead"},"re_entry_text":{"type":"string","title":"Re Entry Text"}},"type":"object","required":["session","re_entry_text"],"title":"ReturnToPhase1Response"},"ReviewAlert":{"properties":{"essay_id":{"type":"string","title":"Essay Id"},"stage":{"type":"string","enum":["awaiting","pushed_back","accepted"],"title":"Stage"},"teacher_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Teacher Name"},"teacher_note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Teacher Note"},"comment_count":{"type":"integer","title":"Comment Count","default":0},"accepted_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Accepted At"},"pushed_back_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pushed Back At"},"revision_due":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Revision Due"},"revision_overdue":{"type":"boolean","title":"Revision Overdue","default":false}},"type":"object","required":["essay_id","stage"],"title":"ReviewAlert","description":"Where a student's submitted essay sits with their teacher, for the Lobby\ncard and the Intro Page. `stage` is the whole student-facing story:\n\n  awaiting     — submitted; the teacher hasn't sent it back or signed off\n  pushed_back  — sent back with comments; there is work to do\n  accepted     — done; the teacher's final comments are readable"},"RosterEntry":{"properties":{"student":{"$ref":"#/components/schemas/StudentRead"},"enrollment":{"$ref":"#/components/schemas/EnrollmentRead"},"code_masked":{"type":"boolean","title":"Code Masked","default":false},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"matched_existing":{"type":"boolean","title":"Matched Existing","default":false},"already_in":{"items":{"type":"string"},"type":"array","title":"Already In","default":[]}},"type":"object","required":["student","enrollment"],"title":"RosterEntry","description":"One row of a classroom's roster — the student plus their credential.\n\n`code_masked` is stated rather than inferred from `access_code is None`.\nA client that guessed would show \"no code issued\" for a withheld one, which\nis the opposite of the truth and would send an admin to reissue a code that\nwas working fine — locking the student out to answer a question nobody\nasked."},"RosterImportResult":{"properties":{"rows_processed":{"type":"integer","title":"Rows Processed","default":0},"rows_skipped":{"type":"integer","title":"Rows Skipped","default":0},"students_created":{"type":"integer","title":"Students Created","default":0},"students_updated":{"type":"integer","title":"Students Updated","default":0},"classrooms_created":{"type":"integer","title":"Classrooms Created","default":0},"enrollments_created":{"type":"integer","title":"Enrollments Created","default":0},"requests_created":{"type":"integer","title":"Requests Created","default":0},"errors":{"items":{"type":"string"},"type":"array","title":"Errors","default":[]}},"type":"object","title":"RosterImportResult"},"RosterLoginRequest":{"properties":{"teacher_id":{"type":"integer","title":"Teacher Id"},"code":{"type":"string","title":"Code"}},"additionalProperties":false,"type":"object","required":["teacher_id","code"],"title":"RosterLoginRequest"},"RosterLoginResponse":{"properties":{"student":{"$ref":"#/components/schemas/StudentRead"},"classroom":{"anyOf":[{"$ref":"#/components/schemas/ClassroomRead"},{"type":"null"}]},"student_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Student Token"}},"type":"object","required":["student"],"title":"RosterLoginResponse"},"RosterPolicyRead":{"properties":{"class_creation_mode":{"type":"string","title":"Class Creation Mode","default":"open"},"student_addition_mode":{"type":"string","title":"Student Addition Mode","default":"open"},"email_required":{"type":"boolean","title":"Email Required","default":false}},"type":"object","title":"RosterPolicyRead","description":"What a school lets its teachers do. Both fields default to today."},"RosterPolicyUpdate":{"properties":{"class_creation_mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Class Creation Mode"},"student_addition_mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Student Addition Mode"}},"additionalProperties":false,"type":"object","title":"RosterPolicyUpdate","description":"Partial. Only the settings present in the body change."},"RosterRequestDecide":{"properties":{"action":{"type":"string","enum":["approve","reject"],"title":"Action"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"}},"additionalProperties":false,"type":"object","required":["action"],"title":"RosterRequestDecide"},"RosterRequestRead":{"properties":{"id":{"type":"integer","title":"Id"},"school_id":{"type":"integer","title":"School Id"},"kind":{"type":"string","title":"Kind"},"status":{"type":"string","title":"Status"},"requested_by_teacher_id":{"type":"integer","title":"Requested By Teacher Id"},"classroom_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Classroom Id"},"classroom_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Classroom Name"},"student_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Student Id"},"payload":{"additionalProperties":true,"type":"object","title":"Payload","default":{}},"decided_by_teacher_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Decided By Teacher Id"},"decided_at":{"anyOf":[{"type":"null"},{"type":"string"}],"title":"Decided At"},"decision_note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Decision Note"},"created_classroom_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Created Classroom Id"},"created_student_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Created Student Id"},"created_enrollment_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Created Enrollment Id"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["id","school_id","kind","status","requested_by_teacher_id","created_at"],"title":"RosterRequestRead","description":"A pending or decided roster request.\n\nThis is what a governed endpoint answers with instead of the row it would\nhave created — see the 202 in POST /classrooms/{id}/students.\n\nTimestamps are serialized with an explicit UTC offset. The database columns\nare naive datetime.utcnow(), and an ISO string with no offset is parsed by\nJavaScript as LOCAL time — so a request filed a minute ago read as \"3h ago\"\nto anyone west of UTC, and would read as \"in 9 hours\" to somebody in Tokyo.\nSaying UTC on the wire is what makes the same row read correctly in every\ntimezone Spar is opened in."},"RosterRowRead":{"properties":{"student_id":{"type":"integer","title":"Student Id"},"student_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Student Name"},"logged":{"type":"number","title":"Logged","default":0},"target":{"type":"number","title":"Target","default":0},"unit":{"type":"string","enum":["hours","entries"],"title":"Unit","default":"entries"},"entries":{"type":"integer","title":"Entries","default":0},"last_entry_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Entry At"},"expected_by_now":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Expected By Now"},"status":{"type":"string","enum":["paused","behind_pace","on_track","capstone_ready","not_started"],"title":"Status","default":"on_track"}},"type":"object","required":["student_id"],"title":"RosterRowRead","description":"One student's line on the director's roster. Counts and dates only —\nnothing on this surface carries student prose."},"RosterStudentCreate":{"properties":{"name":{"type":"string","title":"Name"},"grade":{"type":"integer","title":"Grade","default":9},"age":{"type":"integer","title":"Age","default":14},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"}},"additionalProperties":false,"type":"object","required":["name"],"title":"RosterStudentCreate","description":"Teacher adds a new student to a classroom by name — creates the Student\nand enrolls them (minting the access code) in one call. Profile dimensions\nfill in during the student's onboarding."},"SafetyPromptAnswer":{"properties":{"wants_pause":{"type":"boolean","title":"Wants Pause"}},"type":"object","required":["wants_pause"],"title":"SafetyPromptAnswer"},"SafetyResponseContact":{"properties":{"label":{"type":"string","maxLength":400,"title":"Label","default":""},"phone":{"anyOf":[{"type":"string","maxLength":400},{"type":"null"}],"title":"Phone"},"text_number":{"anyOf":[{"type":"string","maxLength":400},{"type":"null"}],"title":"Text Number"},"url":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Url"},"note":{"anyOf":[{"type":"string","maxLength":400},{"type":"null"}],"title":"Note"},"shown":{"type":"string","maxLength":32,"title":"Shown","default":"both"}},"additionalProperties":false,"type":"object","title":"SafetyResponseContact","description":"A crisis contact as the school's staff edit it. Lengths and shapes are\nchecked in spar/safeguarding/messaging.py, which answers in sentences; the\nlimits here only stop an absurd body before it gets that far."},"SafetyResponseRead":{"properties":{"school_hours_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"School Hours Message"},"after_hours_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"After Hours Message"},"contacts":{"items":{"$ref":"#/components/schemas/SafetyResponseContact"},"type":"array","title":"Contacts"},"updated_at":{"anyOf":[{"type":"null"},{"type":"string"}],"title":"Updated At"},"updated_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated By"},"can_edit":{"type":"boolean","title":"Can Edit","default":false},"timezone_set":{"type":"boolean","title":"Timezone Set","default":false},"max_contacts":{"type":"integer","title":"Max Contacts"},"max_message_chars":{"type":"integer","title":"Max Message Chars"},"alert_initials_enabled":{"type":"boolean","title":"Alert Initials Enabled","default":false},"alert_initials_set_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Alert Initials Set By"},"alert_initials_set_at":{"anyOf":[{"type":"null"},{"type":"string"}],"title":"Alert Initials Set At"}},"type":"object","required":["max_contacts","max_message_chars"],"title":"SafetyResponseRead","description":"What a school has set for its paused students.\n\nOnly the part a school can change. The lines it cannot — that the teacher\nand counselor were told, that the work is not late, and 988 — are not\nstored anywhere and are not here: they live in SafeguardingPaused.jsx,\nwhich the editor's preview renders. A None message means Spar's default.\n\n`can_edit` is the server's answer for THIS caller, so the page never\noffers a save it would be refused.\n\n`timezone_set` is whether the school has a timezone saved, and nothing\nmore. Without one Spar cannot tell a student whether school is open, so it\nshows neither of the two messages here and all of the contacts; the editor\nsays so rather than letting a counselor find out from a student."},"SafetyResponseUpdate":{"properties":{"school_hours_message":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}],"title":"School Hours Message"},"after_hours_message":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}],"title":"After Hours Message"},"contacts":{"items":{"$ref":"#/components/schemas/SafetyResponseContact"},"type":"array","maxItems":50,"title":"Contacts"},"alert_initials_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Alert Initials Enabled"}},"additionalProperties":false,"type":"object","title":"SafetyResponseUpdate","description":"The whole of a school's safety response: saving replaces it. An empty\nmessage means \"use Spar's default\"."},"SaveThreadRequest":{"properties":{"summary":{"type":"string","minLength":1,"title":"Summary"},"captured_by":{"$ref":"#/components/schemas/CapturedBy"},"source_dialogue_turn_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Dialogue Turn Id"}},"additionalProperties":false,"type":"object","required":["summary","captured_by"],"title":"SaveThreadRequest"},"SchoolCreate":{"properties":{"name":{"type":"string","title":"Name"}},"additionalProperties":false,"type":"object","required":["name"],"title":"SchoolCreate"},"SchoolDeletionConfirm":{"properties":{"code":{"type":"string","title":"Code"}},"type":"object","required":["code"],"title":"SchoolDeletionConfirm","description":"The one-time code from the requester's email.\n\nA string, not an int: it is six digits with meaningful leading zeros, and\ncoercing to int would turn 042931 into 42931 and refuse a correct code."},"SchoolEmailResetConfirm":{"properties":{"code":{"type":"string","title":"Code"}},"type":"object","required":["code"],"title":"SchoolEmailResetConfirm"},"SchoolHoursRead":{"properties":{"timezone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Timezone"},"day_start":{"type":"string","title":"Day Start"},"day_end":{"type":"string","title":"Day End"},"school_days":{"type":"string","title":"School Days"},"is_default":{"type":"boolean","title":"Is Default","default":false}},"type":"object","required":["day_start","day_end","school_days"],"title":"SchoolHoursRead","description":"When a school is open. Defaults are filled in: a school that has set\nnothing reads as Monday to Friday, 08:00–16:00, with `is_default` true."},"SchoolHoursUpdate":{"properties":{"timezone":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Timezone"},"day_start":{"anyOf":[{"type":"string","maxLength":5},{"type":"null"}],"title":"Day Start"},"day_end":{"anyOf":[{"type":"string","maxLength":5},{"type":"null"}],"title":"Day End"},"school_days":{"anyOf":[{"type":"string","maxLength":7},{"type":"null"}],"title":"School Days"}},"additionalProperties":false,"type":"object","title":"SchoolHoursUpdate","description":"Partial. Only the settings present in the body change."},"SchoolRead":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","name","created_at"],"title":"SchoolRead"},"SchoolStaffRow":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"role":{"type":"string","title":"Role","default":"teacher"},"credential":{"type":"string","title":"Credential","default":"none"},"archived_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Archived At"},"classrooms":{"type":"integer","title":"Classrooms","default":0},"students":{"type":"integer","title":"Students","default":0},"assignments":{"type":"integer","title":"Assignments","default":0},"submissions_waiting":{"type":"integer","title":"Submissions Waiting","default":0},"invite_pending":{"type":"boolean","title":"Invite Pending","default":false},"invited_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invited To"},"has_email":{"type":"boolean","title":"Has Email","default":true}},"type":"object","required":["id","name"],"title":"SchoolStaffRow","description":"One teacher as their school admin sees them.\n\n`credential` is the field that earns its place. \"Never signed in\" is\nambiguous and the ambiguity is the whole problem: was this teacher never\nGIVEN a code, or given one they never used? Only the second is their doing,\nand only the first is the school's to fix.\n\n  none        no access code issued — nothing to sign in with\n  unused      code issued, never signed in\n  active      signed in at least once\n  former      they have left; the row is retained because their classes\n              hang off it, and deleting it would cascade them away\n\n`former` is checked FIRST and shadows the others. An archived teacher has\nhad their credentials cleared, so on the ladder below they would read as\n\"no access code issued\" — which is how a teacher who left in March would\nbe shown to their admin as somebody who never got started."},"SchoolTeacherCreate":{"properties":{"name":{"type":"string","title":"Name"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"role":{"type":"string","title":"Role","default":"teacher"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"}},"additionalProperties":false,"type":"object","required":["name"],"title":"SchoolTeacherCreate"},"SchoolTeacherCreated":{"properties":{"teacher":{"$ref":"#/components/schemas/TeacherRead"},"access_code":{"type":"string","title":"Access Code"},"invite":{"anyOf":[{"$ref":"#/components/schemas/StaffInviteSent"},{"type":"null"}]}},"type":"object","required":["teacher","access_code"],"title":"SchoolTeacherCreated"},"SchoolTeacherInvite":{"properties":{"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"}},"additionalProperties":false,"type":"object","title":"SchoolTeacherInvite","description":"Where to send the invite.\n\nOptional: left out, it goes to the address already on the account, which is\nthe \"it went to spam\" case. Given, it replaces that address — which is the\n\"I typed it wrong\" case, and the reason this takes a body at all."},"SchoolTeacherRoleChange":{"properties":{"role":{"type":"string","title":"Role"}},"additionalProperties":false,"type":"object","required":["role"],"title":"SchoolTeacherRoleChange"},"SchoolTeacherRoleChanged":{"properties":{"teacher":{"$ref":"#/components/schemas/TeacherRead"},"changed":{"type":"boolean","title":"Changed"},"was":{"type":"string","title":"Was"},"alert_recipient":{"type":"boolean","title":"Alert Recipient","default":false}},"type":"object","required":["teacher","changed","was"],"title":"SchoolTeacherRoleChanged"},"SessionCloseResponse":{"properties":{"session":{"$ref":"#/components/schemas/SessionRead"},"closing_text":{"type":"string","title":"Closing Text"},"summary_text":{"type":"string","title":"Summary Text"}},"type":"object","required":["session","closing_text","summary_text"],"title":"SessionCloseResponse"},"SessionDetailRead":{"properties":{"session_id":{"type":"integer","title":"Session Id"},"state":{"type":"string","title":"State"},"cycle_count":{"type":"integer","title":"Cycle Count"},"cycle_target":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cycle Target"},"assignment_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Assignment Id"},"assignment_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assignment Title"},"assignment_mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assignment Mode"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"summary":{"anyOf":[{"$ref":"#/components/schemas/SummaryRead"},{"type":"null"}]},"blocks_completed":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Blocks Completed"},"blocks_total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Blocks Total"}},"type":"object","required":["session_id","state","cycle_count","created_at","updated_at"],"title":"SessionDetailRead","description":"Per-session payload for the retrospective history view.\n\nPRIVACY: This response intentionally does NOT include analyzer outputs.\nThe analyzer JSON contains direct quotes from the student's braindump,\nwhich are private to the live Phase 3 synthesis moment. Retrospective\nviews (history, teacher dashboards) must consume the summary text only —\nthat text is generated by the session summary prompt, which is the\ndesignated privacy filter for downstream display."},"SessionMessage":{"properties":{"text":{"type":"string","maxLength":8000,"minLength":1,"title":"Text"}},"type":"object","required":["text"],"title":"SessionMessage"},"SessionRead":{"properties":{"id":{"type":"integer","title":"Id"},"student_id":{"type":"integer","title":"Student Id"},"assignment_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Assignment Id"},"state":{"type":"string","title":"State"},"cycle_count":{"type":"integer","title":"Cycle Count"},"config":{"title":"Config"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","student_id","state","cycle_count","created_at","updated_at"],"title":"SessionRead"},"SessionStart":{"properties":{"student_id":{"type":"integer","title":"Student Id"},"assignment_id":{"type":"integer","title":"Assignment Id"}},"type":"object","required":["student_id","assignment_id"],"title":"SessionStart"},"SessionStartResponse":{"properties":{"session":{"$ref":"#/components/schemas/SessionRead"},"opening_text":{"type":"string","title":"Opening Text"},"session_token":{"type":"string","title":"Session Token"},"prior_session_context":{"anyOf":[{"$ref":"#/components/schemas/PriorSessionContext"},{"type":"null"}]}},"type":"object","required":["session","opening_text","session_token"],"title":"SessionStartResponse"},"SessionStateRead":{"properties":{"id":{"type":"integer","title":"Id"},"state":{"type":"string","title":"State"},"cycle_count":{"type":"integer","title":"Cycle Count"},"cycle_target":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cycle Target"},"target_cycles":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Target Cycles"},"phase1_exchange_count":{"type":"integer","title":"Phase1 Exchange Count","default":0},"phase1_history_len":{"type":"integer","title":"Phase1 History Len","default":0},"phase3_history_len":{"type":"integer","title":"Phase3 History Len","default":0},"onboarding_history_len":{"type":"integer","title":"Onboarding History Len","default":0},"onboarding_exchange_count":{"type":"integer","title":"Onboarding Exchange Count","default":0},"analyzer_output_count":{"type":"integer","title":"Analyzer Output Count","default":0},"current_braindump_word_count":{"type":"integer","title":"Current Braindump Word Count","default":0}},"type":"object","required":["id","state","cycle_count"],"title":"SessionStateRead","description":"Lighter-weight state snapshot for GET /sessions/{id}/state."},"ShpAccessRequest":{"properties":{"code":{"type":"string","maxLength":64,"title":"Code"}},"type":"object","required":["code"],"title":"ShpAccessRequest","description":"POST /api/shp/access body. Loose on purpose: the route normalizes the\ncode, and a malformed one is a wrong code, not a validation error."},"ShpEventRequest":{"properties":{"section":{"type":"string","maxLength":32,"title":"Section"}},"type":"object","required":["section"],"title":"ShpEventRequest","description":"POST /api/shp/events body: a section of the page came into view."},"ShpOk":{"properties":{"ok":{"type":"boolean","title":"Ok","default":true}},"type":"object","title":"ShpOk"},"ShpQuestionRequest":{"properties":{"question":{"type":"string","maxLength":4000,"minLength":1,"title":"Question"},"email":{"anyOf":[{"type":"string","maxLength":254},{"type":"null"}],"title":"Email"}},"type":"object","required":["question"],"title":"ShpQuestionRequest","description":"POST /api/shp/questions body. The email is optional and usually absent."},"ShpSessionResponse":{"properties":{"ok":{"type":"boolean","title":"Ok"},"cohort":{"type":"string","title":"Cohort"}},"type":"object","required":["ok","cohort"],"title":"ShpSessionResponse"},"SignedArtifactRead":{"properties":{"essay_id":{"type":"string","title":"Essay Id"},"student_id":{"type":"integer","title":"Student Id"},"assignment_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Assignment Id"},"submitted_at":{"type":"string","format":"date-time","title":"Submitted At"},"spar_signed":{"type":"boolean","title":"Spar Signed"},"signature_label":{"type":"string","title":"Signature Label"},"spar_analysis":{"type":"string","title":"Spar Analysis"},"wellbeing_present":{"type":"boolean","title":"Wellbeing Present","default":false},"wellbeing_observation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wellbeing Observation"},"artifact":{"additionalProperties":true,"type":"object","title":"Artifact"}},"type":"object","required":["essay_id","student_id","submitted_at","spar_signed","signature_label","spar_analysis","artifact"],"title":"SignedArtifactRead","description":"Teacher-facing render of a submitted essay.\n\nComposed of the persisted JSON wrapper + the analyzer outputs +\nminimal student/assignment context for the dashboard. NEVER carries\nraw Phase 1 transcripts, raw braindump, raw mini-Volley transcripts,\nor raw editorial dialogue transcripts — privacy boundary per spec."},"SpreadIt":{"properties":{"keep":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Keep"},"pages_per_week":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Pages Per Week"}},"type":"object","title":"SpreadIt"},"StaffAdd":{"properties":{"teacher_id":{"type":"integer","title":"Teacher Id"},"level":{"type":"string","enum":["co_teacher","support"],"title":"Level"}},"type":"object","required":["teacher_id","level"],"title":"StaffAdd"},"StaffCandidate":{"properties":{"teacher_id":{"type":"integer","title":"Teacher Id"},"name":{"type":"string","title":"Name"}},"type":"object","required":["teacher_id","name"],"title":"StaffCandidate"},"StaffInviteSent":{"properties":{"sent_to":{"type":"string","title":"Sent To"},"expires_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expires At"},"dev":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Dev"}},"type":"object","required":["sent_to"],"title":"StaffInviteSent","description":"What the admin may be told about an invite they just sent.\n\nThe masked address and when it dies. NOT the token: they sent the invite,\nand the person who proves they hold the mailbox is the one who gets to use\nit. An admin holding a live link to a colleague's account is a credential\nnobody asked for.\n\n`dev` carries the token in local development only, on the same condition\nverification.issue uses — no root key, or the dev flag set."},"StaffMember":{"properties":{"teacher_id":{"type":"integer","title":"Teacher Id"},"name":{"type":"string","title":"Name"},"level":{"type":"string","title":"Level"},"added_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Added At"}},"type":"object","required":["teacher_id","name","level"],"title":"StaffMember"},"StaffRemovalConfirm":{"properties":{"code":{"type":"string","title":"Code"}},"additionalProperties":false,"type":"object","required":["code"],"title":"StaffRemovalConfirm","description":"The one-time code from the asker's email.\n\nA string, not an int: six digits with meaningful leading zeros, and\ncoercing to int would turn 042931 into 42931 and refuse a correct code."},"StaffRemovalRequestCreate":{"properties":{"action":{"type":"string","title":"Action"},"reassign_to_teacher_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Reassign To Teacher Id"}},"additionalProperties":false,"type":"object","required":["action"],"title":"StaffRemovalRequestCreate","description":"Ask for a code to remove a teacher.\n\nThe action is chosen HERE, not at confirm time: a code that authorised\n\"remove this person somehow\" would be a blank cheque — approve an archive\nby email, spend it on a reassign, and the account is gone for good."},"StandalonePhase4Response":{"properties":{"session":{"$ref":"#/components/schemas/SessionRead"},"essay":{"$ref":"#/components/schemas/EssayRead"}},"type":"object","required":["session","essay"],"title":"StandalonePhase4Response"},"StandalonePhase4Start":{"properties":{"student_id":{"type":"integer","title":"Student Id"},"assignment_id":{"type":"integer","title":"Assignment Id"}},"type":"object","required":["student_id","assignment_id"],"title":"StandalonePhase4Start","description":"Open a fresh standalone Phase 4 session for an existing assignment.\n\nThe assignment must allow standalone (`standalone_phase_4_allowed`).\nCreates the Session + Essay rows and lands the student directly in\nPHASE_4_COMPOSITION. Spec §State Machine — Standalone Phase 4 Sessions."},"StrongestThreadCount":{"properties":{"label":{"type":"string","title":"Label"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["label","count"],"title":"StrongestThreadCount"},"StudentAdminRead":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"sis_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sis Id"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"grade":{"type":"integer","title":"Grade"},"age":{"type":"integer","title":"Age"},"school_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"School Id"}},"type":"object","required":["id","name","grade","age"],"title":"StudentAdminRead","description":"Registrar view of a student — includes the identity keys StudentRead\ndeliberately hides."},"StudentArcCard":{"properties":{"code":{"type":"string","title":"Code"},"name":{"type":"string","title":"Name"},"sessions_count":{"type":"integer","title":"Sessions Count"},"distinct_moves":{"type":"integer","title":"Distinct Moves"},"arc_points":{"items":{"type":"integer"},"type":"array","title":"Arc Points"},"note":{"type":"string","title":"Note"},"notable":{"type":"boolean","title":"Notable"}},"type":"object","required":["code","name","sessions_count","distinct_moves","arc_points","note","notable"],"title":"StudentArcCard"},"StudentCoursePlanRead":{"properties":{"classroom_id":{"type":"integer","title":"Classroom Id"},"class_name":{"type":"string","title":"Class Name"},"term":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Term"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"outcomes_lead_in":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Outcomes Lead In"},"course_outcomes":{"items":{"$ref":"#/components/schemas/StudentOutcomeRead"},"type":"array","title":"Course Outcomes","default":[]},"units":{"items":{"$ref":"#/components/schemas/StudentUnitRead"},"type":"array","title":"Units","default":[]},"current_unit_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Current Unit Id"}},"type":"object","required":["classroom_id","class_name"],"title":"StudentCoursePlanRead","description":"The course plan a student can read.\n\nCarries no provenance and no coverage. Both are the teacher's business:\n\"drafted by spar — unreviewed\" teaches a student to discount their course's\ngoals, and \"nothing assigned against this\" reads as an accusation about\ntheir teacher."},"StudentCreate":{"properties":{"name":{"type":"string","title":"Name"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"grade":{"type":"integer","maximum":12.0,"minimum":1.0,"title":"Grade"},"age":{"type":"integer","maximum":22.0,"minimum":4.0,"title":"Age"},"primary_language":{"type":"string","title":"Primary Language","default":"English"},"school_language":{"type":"string","title":"School Language","default":"English"},"vocab_band":{"anyOf":[{"type":"string","enum":["basic","developing","intermediate","advanced"]},{"type":"null"}],"title":"Vocab Band"},"abstraction_tolerance":{"anyOf":[{"type":"string","enum":["concrete-anchored","concrete-leaning","mixed","abstract-comfortable"]},{"type":"null"}],"title":"Abstraction Tolerance"},"scaffolding_needs":{"anyOf":[{"type":"string","enum":["high","guided","moderate","low"]},{"type":"null"}],"title":"Scaffolding Needs"},"corridor_width":{"anyOf":[{"type":"string","enum":["narrow","bounded","moderate","wide"]},{"type":"null"}],"title":"Corridor Width"}},"type":"object","required":["name","grade","age"],"title":"StudentCreate"},"StudentCrisisContact":{"properties":{"label":{"type":"string","title":"Label"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"},"text_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text Number"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"}},"type":"object","required":["label"],"title":"StudentCrisisContact","description":"One of the school's crisis contacts, as a paused student is given it."},"StudentDevelopmentArc":{"properties":{"student_id":{"type":"integer","title":"Student Id"},"name":{"type":"string","title":"Name"},"sessions_total":{"type":"integer","title":"Sessions Total"},"narrative":{"type":"string","title":"Narrative"},"opportunities":{"items":{"type":"string"},"type":"array","title":"Opportunities","default":[]},"sessions":{"items":{"$ref":"#/components/schemas/SummaryRead"},"type":"array","title":"Sessions","default":[]}},"type":"object","required":["student_id","name","sessions_total","narrative"],"title":"StudentDevelopmentArc"},"StudentEmailRead":{"properties":{"student_id":{"type":"integer","title":"Student Id"},"email":{"type":"string","title":"Email"}},"type":"object","required":["student_id","email"],"title":"StudentEmailRead"},"StudentEmailSet":{"properties":{"email":{"type":"string","title":"Email"}},"additionalProperties":false,"type":"object","required":["email"],"title":"StudentEmailSet","description":"Put an address on a student who has none, or change the one they have."},"StudentEngagement":{"properties":{"student":{"$ref":"#/components/schemas/StudentRead"},"sessions_total":{"type":"integer","title":"Sessions Total"},"sessions_closed":{"type":"integer","title":"Sessions Closed"},"last_session_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Session At"},"avg_per_assignment":{"type":"number","title":"Avg Per Assignment","default":0.0},"tag":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tag"},"at_risk":{"type":"boolean","title":"At Risk","default":false}},"type":"object","required":["student","sessions_total","sessions_closed"],"title":"StudentEngagement"},"StudentEssayListItem":{"properties":{"id":{"type":"string","title":"Id"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"state":{"type":"string","enum":["composition","editorial_dialogue","pre_submit","submitted","submitted_revising"],"title":"State"},"entry_mode":{"type":"string","enum":["full_pedagogy","standalone"],"title":"Entry Mode"},"current_session_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Current Session Id"},"submitted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Submitted At"},"spar_signed":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Spar Signed"},"assignment_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Assignment Id"},"assignment_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assignment Title"},"assignment_mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assignment Mode"},"due_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Due Date"},"revision_due":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Revision Due"},"revision_overdue":{"type":"boolean","title":"Revision Overdue","default":false},"word_count":{"type":"integer","title":"Word Count"},"revision_count":{"type":"integer","title":"Revision Count"},"version_count":{"type":"integer","title":"Version Count"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"recommendations":{"items":{"$ref":"#/components/schemas/EssayRecommendation"},"type":"array","title":"Recommendations","default":[]},"latest_excerpt":{"type":"string","title":"Latest Excerpt","default":""}},"type":"object","required":["id","state","entry_mode","word_count","revision_count","version_count","updated_at"],"title":"StudentEssayListItem","description":"Compact row for the student's My Essays page."},"StudentFlag":{"properties":{"student_code":{"type":"string","title":"Student Code"},"student_name":{"type":"string","title":"Student Name"},"reason":{"type":"string","title":"Reason"},"signal_strength":{"type":"integer","title":"Signal Strength","default":0}},"type":"object","required":["student_code","student_name","reason"],"title":"StudentFlag","description":"One name on a Check In With or Star Students tile."},"StudentHoldRead":{"properties":{"held":{"type":"boolean","title":"Held"},"after_hours":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"After Hours"},"follow_up":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Follow Up"},"lead_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lead Message"},"contacts":{"items":{"$ref":"#/components/schemas/StudentCrisisContact"},"type":"array","title":"Contacts"}},"type":"object","required":["held"],"title":"StudentHoldRead","description":"Whether the signed-in student is paused, and whether school is open.\n\nDeliberately no tier, category, rationale or timestamp: what a student is\ntold about a hold is the words on the paused panel and nothing else."},"StudentMergeRequest":{"properties":{"keep_id":{"type":"integer","title":"Keep Id"},"drop_id":{"type":"integer","title":"Drop Id"}},"additionalProperties":false,"type":"object","required":["keep_id","drop_id"],"title":"StudentMergeRequest","description":"Fold `drop_id` into `keep_id`. Both must be students at the school in\nthe path. Cannot be undone."},"StudentMergeResult":{"properties":{"kept_student_id":{"type":"integer","title":"Kept Student Id"},"dropped_student_id":{"type":"integer","title":"Dropped Student Id"},"counts":{"additionalProperties":true,"type":"object","title":"Counts","default":{}}},"type":"object","required":["kept_student_id","dropped_student_id"],"title":"StudentMergeResult"},"StudentOutcomeRead":{"properties":{"id":{"type":"integer","title":"Id"},"text":{"type":"string","title":"Text"}},"type":"object","required":["id","text"],"title":"StudentOutcomeRead","description":"An outcome as a STUDENT may see it.\n\nA separate model rather than a filtered dict, so the omission is\nstructural and cannot be undone by someone adding a field to OutcomeRead.\n\n`source` is absent on purpose: \"drafted by spar — unreviewed\" under your\ncourse's goals teaches you to discount them, and it is the teacher's\nbookkeeping. `assignable` is absent because it only means anything to a\ncoverage view, which students do not get."},"StudentPatch":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"sis_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sis Id"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"grade":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Grade"},"age":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Age"}},"additionalProperties":false,"type":"object","title":"StudentPatch","description":"Registrar edit of a student's identity fields. All optional — only\nprovided fields change."},"StudentPreferencesUpdate":{"properties":{"tts_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Tts Enabled"},"stt_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Stt Enabled"},"tts_voice":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tts Voice"},"theme":{"anyOf":[{"type":"string","enum":["light","dark"]},{"type":"null"}],"title":"Theme"},"braindump_theme":{"anyOf":[{"type":"string","enum":["light","dark"]},{"type":"null"}],"title":"Braindump Theme"},"about_me":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"About Me"}},"type":"object","title":"StudentPreferencesUpdate","description":"Partial update of student preferences. Only sent fields are applied."},"StudentRead":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"school_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"School Name"},"mobile_enabled":{"type":"boolean","title":"Mobile Enabled","default":false},"grade":{"type":"integer","title":"Grade"},"age":{"type":"integer","title":"Age"},"primary_language":{"type":"string","title":"Primary Language"},"school_language":{"type":"string","title":"School Language"},"vocab_band":{"anyOf":[{"type":"string","enum":["basic","developing","intermediate","advanced"]},{"type":"null"}],"title":"Vocab Band"},"abstraction_tolerance":{"anyOf":[{"type":"string","enum":["concrete-anchored","concrete-leaning","mixed","abstract-comfortable"]},{"type":"null"}],"title":"Abstraction Tolerance"},"scaffolding_needs":{"anyOf":[{"type":"string","enum":["high","guided","moderate","low"]},{"type":"null"}],"title":"Scaffolding Needs"},"corridor_width":{"anyOf":[{"type":"string","enum":["narrow","bounded","moderate","wide"]},{"type":"null"}],"title":"Corridor Width"},"tts_enabled":{"type":"boolean","title":"Tts Enabled","default":false},"stt_enabled":{"type":"boolean","title":"Stt Enabled","default":true},"tts_voice":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tts Voice"},"theme":{"type":"string","title":"Theme","default":"light"},"braindump_theme":{"type":"string","title":"Braindump Theme","default":"dark"},"about_me":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"About Me"},"intro_seen_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Intro Seen At"},"tour_seen_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Tour Seen At"},"disclosure_owed":{"type":"boolean","title":"Disclosure Owed","default":false},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","name","grade","age","primary_language","school_language","created_at","updated_at"],"title":"StudentRead"},"StudentReflections":{"properties":{"student_id":{"type":"integer","title":"Student Id"},"name":{"type":"string","title":"Name"},"reflections":{"items":{"$ref":"#/components/schemas/ReflectionEntry"},"type":"array","title":"Reflections"}},"type":"object","required":["student_id","name","reflections"],"title":"StudentReflections"},"StudentRemoval":{"properties":{"confirm_name":{"type":"string","title":"Confirm Name"}},"additionalProperties":false,"type":"object","required":["confirm_name"],"title":"StudentRemoval","description":"The student's name, typed by the admin. Checked against the row, so a\nrequest aimed at the wrong id is refused rather than obeyed."},"StudentRemovalPreview":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"classes":{"items":{"type":"string"},"type":"array","title":"Classes","default":[]},"sessions":{"type":"integer","title":"Sessions","default":0},"essays":{"type":"integer","title":"Essays","default":0},"blocked":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Blocked"}},"type":"object","required":["id","name"],"title":"StudentRemovalPreview","description":"What removing one student would delete, for the admin's confirmation.\n`blocked` is the sentence saying why it cannot be done, or None."},"StudentSessionListItem":{"properties":{"id":{"type":"integer","title":"Id"},"student_id":{"type":"integer","title":"Student Id"},"assignment_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Assignment Id"},"state":{"type":"string","title":"State"},"cycle_count":{"type":"integer","title":"Cycle Count"},"config":{"title":"Config"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"takeaway":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Takeaway"},"step_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Step Title"},"is_reflection":{"type":"boolean","title":"Is Reflection","default":false}},"type":"object","required":["id","student_id","state","cycle_count","created_at","updated_at"],"title":"StudentSessionListItem","description":"One row of a student's own session history.\n\nSessionRead plus the three things the history page needs to say what a row\nIS, each computed for the list: the page was written against a `summary`\non every row that this endpoint never sent, so every row fell back to the\nassignment's title and five sessions on one assignment were five identical\nlines.\n\n`takeaway` is the student's own artifact from the summary and nothing else\nfrom it — the summary also holds the narration written for the teacher."},"StudentSubmissions":{"properties":{"student_id":{"type":"integer","title":"Student Id"},"name":{"type":"string","title":"Name"},"essays":{"items":{"$ref":"#/components/schemas/EssaySubmission"},"type":"array","title":"Essays"},"reflections":{"items":{"$ref":"#/components/schemas/ReflectionEntry"},"type":"array","title":"Reflections"},"summaries":{"items":{"$ref":"#/components/schemas/SummarySubmission"},"type":"array","title":"Summaries"},"has_work":{"type":"boolean","title":"Has Work","default":false}},"type":"object","required":["student_id","name"],"title":"StudentSubmissions"},"StudentThinkingSummary":{"properties":{"student_id":{"type":"integer","title":"Student Id"},"student_name":{"type":"string","title":"Student Name"},"detail":{"$ref":"#/components/schemas/SessionDetailRead"}},"type":"object","required":["student_id","student_name","detail"],"title":"StudentThinkingSummary"},"StudentTimelineResponse":{"properties":{"student_id":{"type":"integer","title":"Student Id"},"name":{"type":"string","title":"Name"},"narrative":{"type":"string","title":"Narrative"},"milestones":{"items":{"$ref":"#/components/schemas/TimelineMilestone"},"type":"array","title":"Milestones","default":[]},"sessions":{"items":{"$ref":"#/components/schemas/TimelineSession"},"type":"array","title":"Sessions","default":[]}},"type":"object","required":["student_id","name","narrative"],"title":"StudentTimelineResponse"},"StudentUnitRead":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"position":{"type":"integer","title":"Position"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary"},"weeks":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Weeks"},"strand":{"type":"boolean","title":"Strand","default":false},"outcomes":{"items":{"$ref":"#/components/schemas/StudentOutcomeRead"},"type":"array","title":"Outcomes","default":[]}},"type":"object","required":["id","name","position"],"title":"StudentUnitRead","description":"A unit as a student sees it.\n\nA separate model rather than a filtered UnitRead, so what is withheld is\nstructural: no `ckl_unit` (a grounding key is plumbing), and its outcomes\nare StudentOutcomeRead, which has no `source` and no `assignable`."},"StudentWorkClearResult":{"properties":{"mode":{"anyOf":[{"type":"string","enum":["exploration","essay_preparation","exam_study","concept_review","problem_sets","creative_writing","reflection"]},{"type":"null"}],"title":"Mode"},"deleted":{"additionalProperties":{"type":"integer"},"type":"object","title":"Deleted"}},"type":"object","required":["deleted"],"title":"StudentWorkClearResult"},"StudentWorkSummaryItem":{"properties":{"mode":{"type":"string","enum":["exploration","essay_preparation","exam_study","concept_review","problem_sets","creative_writing","reflection"],"title":"Mode"},"sessions":{"type":"integer","title":"Sessions"},"essays":{"type":"integer","title":"Essays"},"assignment_titles":{"items":{"type":"string"},"type":"array","title":"Assignment Titles"}},"type":"object","required":["mode","sessions","essays","assignment_titles"],"title":"StudentWorkSummaryItem"},"StudyDeleteConfirm":{"properties":{"code":{"type":"string","title":"Code"}},"type":"object","required":["code"],"title":"StudyDeleteConfirm","description":"The six digits mailed to the teacher. A string: leading zeros count."},"SubmissionStep":{"properties":{"block_id":{"type":"integer","title":"Block Id"},"position":{"type":"integer","title":"Position"},"title":{"type":"string","title":"Title"},"block_type":{"type":"string","title":"Block Type"},"kind":{"type":"string","title":"Kind"}},"type":"object","required":["block_id","position","title","block_type","kind"],"title":"SubmissionStep","description":"One step of the assignment, in order, and what it asks a student for.\n\n`kind` is what the step PRODUCES for a teacher to read:\n  essay       a Composition step\n  reflection  an Offline step, or a Discussion-shaped session\n  summary     a full Spar session — its Thinking Summary\n  none        nothing per student (a group discussion, an Offline step\n              with its reflection switched off)"},"SubmissionsOut":{"properties":{"waiting_on_you":{"type":"integer","title":"Waiting On You","default":0},"waiting_on_them":{"type":"integer","title":"Waiting On Them","default":0},"assignments":{"items":{"$ref":"#/components/schemas/SubmissionsOutRow"},"type":"array","title":"Assignments","default":[]}},"type":"object","title":"SubmissionsOut","description":"What is out right now, and the two directions it can be waiting in."},"SubmissionsOutRow":{"properties":{"assignment_id":{"type":"integer","title":"Assignment Id"},"title":{"type":"string","title":"Title"},"classroom_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Classroom Id"},"class_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Class Name"},"due_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Due Date"},"students_total":{"type":"integer","title":"Students Total","default":0},"handed_in":{"type":"integer","title":"Handed In","default":0},"waiting_on_you":{"type":"integer","title":"Waiting On You","default":0},"sent_back":{"type":"integer","title":"Sent Back","default":0}},"type":"object","required":["assignment_id","title"],"title":"SubmissionsOutRow","description":"One live assignment, and the three numbers the Submissions page needs.\n\n`students_total` is who it actually went TO, not the class roster: an\nassignment with per-student targets went to those students, and reporting\n\"4 of 24 in\" for a make-up sent to four people is a progress bar that is\nwrong by design."},"SubmitCheckItem":{"properties":{"id":{"type":"string","title":"Id"},"type":{"type":"string","title":"Type"},"body":{"type":"string","title":"Body"}},"type":"object","required":["id","type","body"],"title":"SubmitCheckItem","description":"A single active observation surfaced in the slow-down prompt."},"SubmitCheckResponse":{"properties":{"should_slow_down":{"type":"boolean","title":"Should Slow Down"},"items":{"items":{"$ref":"#/components/schemas/SubmitCheckItem"},"type":"array","title":"Items","default":[]},"current_word_count":{"type":"integer","title":"Current Word Count"},"word_count_at_latest_observation":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Word Count At Latest Observation"},"delta":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Delta"}},"type":"object","required":["should_slow_down","current_word_count"],"title":"SubmitCheckResponse","description":"Advisory the frontend reads BEFORE calling submit.\n\n`should_slow_down` indicates whether the slow-down prompt should\nshow. The student can still submit if they choose — the gate is\nadvisory, not blocking. `items` carries the specific active\nobservations (newest first, capped at 2) so the prompt can name\nthem concretely."},"SuggestedAssignment":{"properties":{"title":{"type":"string","title":"Title"},"mode":{"type":"string","title":"Mode"},"why":{"type":"string","title":"Why","default":""},"outcome_ids":{"items":{"type":"integer"},"type":"array","title":"Outcome Ids","default":[]}},"type":"object","required":["title","mode"],"title":"SuggestedAssignment","description":"One thing a teacher could set. Not saved, and not an assessment.\n\n`why` names the outcome or the text it serves, because the teacher is\ndeciding whether to keep it and \"develops critical thinking\" helps nobody\ndecide anything."},"SummaryRead":{"properties":{"id":{"type":"integer","title":"Id"},"session_id":{"type":"integer","title":"Session Id"},"content":{"additionalProperties":true,"type":"object","title":"Content"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"assignment_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Assignment Id"},"assignment_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assignment Title"}},"type":"object","required":["id","session_id","content","created_at"],"title":"SummaryRead"},"SummarySubmission":{"properties":{"block_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Block Id"},"detail":{"$ref":"#/components/schemas/SessionDetailRead"}},"type":"object","required":["detail"],"title":"SummarySubmission"},"SupportComment":{"properties":{"id":{"type":"integer","title":"Id"},"paragraph_id":{"type":"string","title":"Paragraph Id"},"author_id":{"type":"integer","title":"Author Id"},"author_display_name":{"type":"string","title":"Author Display Name","default":""},"author_role_word":{"type":"string","title":"Author Role Word","default":"Support"},"audience":{"type":"string","enum":["student","teacher"],"title":"Audience"},"body":{"type":"string","title":"Body"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"seen_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Seen At"}},"type":"object","required":["id","paragraph_id","author_id","audience","body","created_at"],"title":"SupportComment","description":"A margin comment from a colleague added to the class as Support."},"SupportCommentAlert":{"properties":{"essay_id":{"type":"string","title":"Essay Id"},"count":{"type":"integer","title":"Count","default":0},"from_names":{"items":{"type":"string"},"type":"array","title":"From Names"},"role_word":{"type":"string","title":"Role Word","default":"Support"}},"type":"object","required":["essay_id"],"title":"SupportCommentAlert","description":"For the lobby: Support comments the student has not opened yet."},"SupportCommentCreate":{"properties":{"paragraph_id":{"type":"string","title":"Paragraph Id"},"body":{"type":"string","title":"Body"},"audience":{"type":"string","enum":["student","teacher"],"title":"Audience"}},"type":"object","required":["paragraph_id","body","audience"],"title":"SupportCommentCreate"},"SyllabusAutofillResult":{"properties":{"description":{"type":"string","title":"Description","default":""},"units_created":{"items":{"type":"string"},"type":"array","title":"Units Created","default":[]}},"type":"object","title":"SyllabusAutofillResult","description":"What Spar pulled from a class's syllabus and created."},"SynthesizeRequest":{"properties":{"text":{"type":"string","minLength":1,"title":"Text"},"voice":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Voice"}},"type":"object","required":["text"],"title":"SynthesizeRequest"},"TagDistributionRow":{"properties":{"tag":{"type":"string","title":"Tag"},"label":{"type":"string","title":"Label"},"sublabel":{"type":"string","title":"Sublabel"},"count":{"type":"integer","title":"Count"},"pct":{"type":"integer","title":"Pct"},"is_rare":{"type":"boolean","title":"Is Rare"}},"type":"object","required":["tag","label","sublabel","count","pct","is_rare"],"title":"TagDistributionRow"},"TeacherAccessCodeIssued":{"properties":{"teacher_id":{"type":"integer","title":"Teacher Id"},"name":{"type":"string","title":"Name"},"access_code":{"type":"string","title":"Access Code"}},"type":"object","required":["teacher_id","name","access_code"],"title":"TeacherAccessCodeIssued","description":"A freshly minted teacher access code.\n\nThe ONLY response that ever contains it. It is not on TeacherRead and no\nread endpoint returns it — a credential you can look up is not a\ncredential, which is exactly what went wrong with `code`."},"TeacherAnnotation":{"properties":{"id":{"type":"integer","title":"Id"},"paragraph_id":{"type":"string","title":"Paragraph Id"},"author_id":{"type":"integer","title":"Author Id"},"author_display_name":{"type":"string","title":"Author Display Name","default":""},"body":{"type":"string","title":"Body"},"kind":{"type":"string","title":"Kind","default":"comment"},"char_start":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Char Start"},"char_end":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Char End"},"resolved":{"type":"boolean","title":"Resolved","default":false},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"response":{"anyOf":[{"$ref":"#/components/schemas/CommentResponse"},{"type":"null"}]}},"type":"object","required":["id","paragraph_id","author_id","body","created_at","updated_at"],"title":"TeacherAnnotation","description":"Per-paragraph annotation authored by a teacher. Anchored via\nparagraph_id to a stable paragraph UUID, so annotations survive across\nrevisions as long as the paragraph itself does."},"TeacherAnnotationCreate":{"properties":{"paragraph_id":{"type":"string","title":"Paragraph Id"},"body":{"type":"string","title":"Body"},"char_start":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Char Start"},"char_end":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Char End"}},"type":"object","required":["paragraph_id","body"],"title":"TeacherAnnotationCreate"},"TeacherAnnotationUpdate":{"properties":{"body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body"},"resolved":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Resolved"}},"type":"object","title":"TeacherAnnotationUpdate"},"TeacherCreate":{"properties":{"name":{"type":"string","title":"Name"},"code":{"type":"string","title":"Code"}},"type":"object","required":["name","code"],"title":"TeacherCreate"},"TeacherDeparture":{"properties":{"action":{"type":"string","title":"Action"},"reassign_to_teacher_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Reassign To Teacher Id"}},"additionalProperties":false,"type":"object","required":["action"],"title":"TeacherDeparture","description":"How a teacher leaves. The admin picks; the two answers differ in kind.\n\n  reassign  someone is taking the classes. They move first, students keep\n            their codes, and then the teacher row is genuinely deleted —\n            nothing points at it any more.\n\n  archive   nobody is ready. Codes go inactive, the classes are stamped\n            dormant, credentials are cleared, and THE ROW IS KEPT, because\n            deleting it is what would cascade the classes away.\n\n  remove    they have no classes, so there is nothing to decide: the\n            account goes (staff_lifecycle.remove_without_classes).\n\nreassign_to_teacher_id is required for 'reassign' and meaningless for\nthe others; the endpoint rejects the mismatch rather than guessing."},"TeacherDepartureResult":{"properties":{"action":{"type":"string","title":"Action"},"teacher_deleted":{"type":"boolean","title":"Teacher Deleted","default":false},"teacher_closed":{"type":"boolean","title":"Teacher Closed","default":false},"classrooms_reassigned":{"type":"integer","title":"Classrooms Reassigned","default":0},"classrooms_archived":{"type":"integer","title":"Classrooms Archived","default":0},"codes_deactivated":{"type":"integer","title":"Codes Deactivated","default":0},"reassigned_to_teacher_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Reassigned To Teacher Id"},"reassigned_to_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reassigned To Name"}},"type":"object","required":["action"],"title":"TeacherDepartureResult","description":"What actually happened, in the words the admin needs to read back."},"TeacherEssayListItem":{"properties":{"essay_id":{"type":"string","title":"Essay Id"},"student_id":{"type":"integer","title":"Student Id"},"student_name":{"type":"string","title":"Student Name"},"assignment_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Assignment Id"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"submitted_at":{"type":"string","format":"date-time","title":"Submitted At"},"spar_signed":{"type":"boolean","title":"Spar Signed"},"word_count":{"type":"integer","title":"Word Count"},"wellbeing_present":{"type":"boolean","title":"Wellbeing Present","default":false}},"type":"object","required":["essay_id","student_id","student_name","submitted_at","spar_signed","word_count"],"title":"TeacherEssayListItem","description":"Compact row for the teacher's \"submitted essays\" list view."},"TeacherInsightsResponse":{"properties":{"teacher_id":{"type":"integer","title":"Teacher Id"},"generated_at":{"type":"string","format":"date-time","title":"Generated At"},"engagement":{"items":{"$ref":"#/components/schemas/ClassEngagementRow"},"type":"array","title":"Engagement","default":[]},"coverage":{"items":{"$ref":"#/components/schemas/AssignmentCoverage"},"type":"array","title":"Coverage","default":[]},"behavioral_insights":{"items":{"$ref":"#/components/schemas/BehavioralInsight"},"type":"array","title":"Behavioral Insights","default":[]},"misconceptions":{"items":{"$ref":"#/components/schemas/MisconceptionCard"},"type":"array","title":"Misconceptions","default":[]}},"type":"object","required":["teacher_id","generated_at"],"title":"TeacherInsightsResponse"},"TeacherOverviewNoteUpdate":{"properties":{"body_text":{"type":"string","title":"Body Text"}},"type":"object","required":["body_text"],"title":"TeacherOverviewNoteUpdate"},"TeacherPublic":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"}},"type":"object","required":["id","name"],"title":"TeacherPublic","description":"Minimal teacher info for the student login picker (no code leakage)."},"TeacherRead":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"code":{"type":"string","title":"Code"},"ui_mode":{"type":"string","title":"Ui Mode","default":"pilot"},"role":{"type":"string","title":"Role","default":"teacher"},"school_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"School Id"},"school_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"School Name"},"mobile_enabled":{"type":"boolean","title":"Mobile Enabled","default":false},"has_email":{"type":"boolean","title":"Has Email","default":false},"intro_seen_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Intro Seen At"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","name","code","created_at"],"title":"TeacherRead"},"TeacherResponseCreate":{"properties":{"response_type":{"type":"string","enum":["handled","long_form"],"title":"Response Type"},"text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text"}},"type":"object","required":["response_type"],"title":"TeacherResponseCreate"},"TeacherResponsePatch":{"properties":{"text":{"type":"string","minLength":1,"title":"Text"}},"type":"object","required":["text"],"title":"TeacherResponsePatch"},"TeacherResponseRead":{"properties":{"id":{"type":"integer","title":"Id"},"response_type":{"type":"string","enum":["handled","noted","long_form"],"title":"Response Type"},"text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","response_type","created_at"],"title":"TeacherResponseRead","description":"A teacher's recorded response on a Dive Deeper observation.\n\n`response_type=handled` is idempotent — at most one per (teacher,\npattern_key); `text` is null. `response_type=long_form` accumulates;\nmultiple per (teacher, pattern_key) allowed and listed in time order.\n`noted` is reserved for a future \"saw it, not actionable\" UI and not\nexposed in any current endpoint."},"TeacherReviewEssayListItem":{"properties":{"id":{"type":"string","title":"Id"},"student_id":{"type":"integer","title":"Student Id"},"student_name":{"type":"string","title":"Student Name"},"assignment_id":{"type":"integer","title":"Assignment Id"},"assignment_title":{"type":"string","title":"Assignment Title"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"state":{"type":"string","enum":["composition","editorial_dialogue","pre_submit","submitted","submitted_revising"],"title":"State"},"teacher_review_status":{"anyOf":[{"type":"string","enum":["not_yet_reviewed","in_review","pushed_back","re_submitted","accepted"]},{"type":"null"}],"title":"Teacher Review Status"},"word_count":{"type":"integer","title":"Word Count","default":0},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"submitted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Submitted At"},"spar_signed":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Spar Signed"},"latest_excerpt":{"type":"string","title":"Latest Excerpt","default":""},"revision_due":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Revision Due"},"revision_overdue":{"type":"boolean","title":"Revision Overdue","default":false},"revision_late":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Revision Late"},"revision_days_late":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Revision Days Late"},"revision_round":{"type":"integer","title":"Revision Round","default":0}},"type":"object","required":["id","student_id","student_name","assignment_id","assignment_title","state","updated_at"],"title":"TeacherReviewEssayListItem","description":"Compact row for the teacher's per-assignment essay list."},"TeacherSignInRequest":{"properties":{"access_code":{"type":"string","title":"Access Code"}},"additionalProperties":false,"type":"object","required":["access_code"],"title":"TeacherSignInRequest"},"TeacherSignInResponse":{"properties":{"teacher":{"$ref":"#/components/schemas/TeacherRead"},"teacher_token":{"type":"string","title":"Teacher Token"}},"type":"object","required":["teacher","teacher_token"],"title":"TeacherSignInResponse","description":"A teacher, and the capability token that identifies them from here on.\n\nMirrors RosterLoginResponse. `teacher_token` is what makes a teacher's\nmodel calls attributable — the shared SPAR_TEACHER_TOKEN identifies nobody."},"TeacherToday":{"properties":{"teacher_name":{"type":"string","title":"Teacher Name"},"waiting_on_you":{"type":"integer","title":"Waiting On You"},"due_soon":{"items":{"$ref":"#/components/schemas/TodayDue"},"type":"array","title":"Due Soon","default":[]},"gone_quiet":{"items":{"$ref":"#/components/schemas/StudentFlag"},"type":"array","title":"Gone Quiet","default":[]},"class_count":{"type":"integer","title":"Class Count","default":0},"student_count":{"type":"integer","title":"Student Count","default":0},"assignments_live":{"type":"integer","title":"Assignments Live","default":0},"assignments_draft":{"type":"integer","title":"Assignments Draft","default":0},"unavailable":{"items":{"type":"string"},"type":"array","title":"Unavailable","default":[]},"last_seen_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Seen At"}},"type":"object","required":["teacher_name","waiting_on_you"],"title":"TeacherToday","description":"What a teacher is told when they arrive.\n\nThree sentences and the counts behind the three doors. Deliberately small:\nthis is read standing up, before the bell, and a dashboard that needs\nscrolling before it says anything has not said anything."},"TermArcPoint":{"properties":{"week_start":{"type":"string","format":"date-time","title":"Week Start"},"label":{"type":"string","title":"Label"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["week_start","label","count"],"title":"TermArcPoint","description":"One bucket on the term-arc sparkline (one per week)."},"TermCreate":{"properties":{"school_id":{"type":"integer","title":"School Id"},"name":{"type":"string","title":"Name"},"starts_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Starts On"},"ends_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Ends On"}},"additionalProperties":false,"type":"object","required":["school_id","name"],"title":"TermCreate"},"TermRead":{"properties":{"id":{"type":"integer","title":"Id"},"school_id":{"type":"integer","title":"School Id"},"name":{"type":"string","title":"Name"},"starts_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Starts On"},"ends_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Ends On"},"is_active":{"type":"boolean","title":"Is Active","default":true}},"type":"object","required":["id","school_id","name"],"title":"TermRead"},"Thread":{"properties":{"id":{"type":"string","title":"Id"},"session_id":{"type":"integer","title":"Session Id"},"source_dialogue_turn_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Dialogue Turn Id"},"summary":{"type":"string","title":"Summary"},"captured_by":{"$ref":"#/components/schemas/CapturedBy"},"captured_at":{"type":"string","format":"date-time","title":"Captured At"},"dismissed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Dismissed At"},"status":{"$ref":"#/components/schemas/ThreadStatus"}},"additionalProperties":false,"type":"object","required":["id","session_id","summary","captured_by","captured_at","status"],"title":"Thread","description":"A persisted thread. ``summary`` is braindump-equivalent private content —\nnever serialized to a teacher-facing surface."},"ThreadStatus":{"type":"string","enum":["active","dismissed"],"title":"ThreadStatus"},"TimelineMilestone":{"properties":{"date":{"type":"string","format":"date-time","title":"Date"},"kind":{"type":"string","enum":["first_counterargument","first_multi_causal","first_self_correction","first_multi_cycle","longest_session"],"title":"Kind"},"label":{"type":"string","title":"Label"}},"type":"object","required":["date","kind","label"],"title":"TimelineMilestone"},"TimelineSession":{"properties":{"session_id":{"type":"integer","title":"Session Id"},"date":{"type":"string","format":"date-time","title":"Date"},"assignment_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assignment Title"},"assignment_mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assignment Mode"},"cycles":{"type":"integer","title":"Cycles"},"engagement_level":{"type":"string","enum":["high","medium","low"],"title":"Engagement Level"},"topic":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Topic"},"takeaway":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Takeaway"}},"type":"object","required":["session_id","date","cycles","engagement_level"],"title":"TimelineSession"},"TodayDue":{"properties":{"assignment_id":{"type":"integer","title":"Assignment Id"},"title":{"type":"string","title":"Title"},"class_name":{"type":"string","title":"Class Name"},"due_date":{"type":"string","format":"date-time","title":"Due Date"},"not_started":{"type":"integer","title":"Not Started","default":0}},"type":"object","required":["assignment_id","title","class_name","due_date"],"title":"TodayDue","description":"One assignment with a deadline close enough to matter."},"TranscribeResponse":{"properties":{"raw_text":{"type":"string","title":"Raw Text"},"text":{"type":"string","title":"Text"}},"type":"object","required":["raw_text","text"],"title":"TranscribeResponse"},"UnitAssignmentDraft":{"properties":{"assignments":{"items":{"$ref":"#/components/schemas/SuggestedAssignment"},"type":"array","title":"Assignments","default":[]}},"type":"object","title":"UnitAssignmentDraft","description":"Spar's suggestions for one unit. Not saved — the teacher picks."},"UnitCreate":{"properties":{"name":{"type":"string","title":"Name"},"position":{"type":"integer","title":"Position","default":0},"ckl_unit":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ckl Unit"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary"},"weeks":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Weeks"},"strand":{"type":"boolean","title":"Strand","default":false}},"additionalProperties":false,"type":"object","required":["name"],"title":"UnitCreate"},"UnitOutcomeDraft":{"properties":{"outcomes":{"items":{"type":"string"},"type":"array","title":"Outcomes","default":[]}},"type":"object","title":"UnitOutcomeDraft","description":"Spar's suggestions for one unit. Not saved — the teacher picks."},"UnitRead":{"properties":{"id":{"type":"integer","title":"Id"},"classroom_id":{"type":"integer","title":"Classroom Id"},"name":{"type":"string","title":"Name"},"position":{"type":"integer","title":"Position"},"ckl_unit":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ckl Unit"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary"},"weeks":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Weeks"},"start_week":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Start Week"},"end_week":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"End Week"},"starts_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Starts On"},"ends_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Ends On"},"implied_term_start":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Implied Term Start"},"window_starts_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Window Starts On"},"window_ends_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Window Ends On"},"strand":{"type":"boolean","title":"Strand","default":false},"outcomes":{"items":{"$ref":"#/components/schemas/OutcomeRead"},"type":"array","title":"Outcomes","default":[]}},"type":"object","required":["id","classroom_id","name","position"],"title":"UnitRead"},"UnitUpdate":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary"},"weeks":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Weeks"},"start_week":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Start Week"},"end_week":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"End Week"},"starts_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Starts On"},"ends_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Ends On"},"strand":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Strand"}},"additionalProperties":false,"type":"object","title":"UnitUpdate","description":"What a teacher may change about a unit.\n\n`starts_on` / `ends_on` are the override: a parse of free text will be\nwrong sometimes, and the teacher correcting it must win over anything\nderived. Sending null for both hands the unit back to the derived window."},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"WaitlistEntry":{"properties":{"id":{"type":"integer","title":"Id"},"email":{"type":"string","title":"Email"},"source":{"type":"string","title":"Source"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"role":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Role"},"roles":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Roles"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["id","email","source","created_at"],"title":"WaitlistEntry","description":"A single row in the admin-only waitlist list response. Mirrors\nthe dbm.Waitlist columns we want to surface; `ip` and `user_agent`\nare omitted because they're internal telemetry, not outreach data."},"WaitlistJoinRequest":{"properties":{"email":{"type":"string","maxLength":254,"minLength":3,"title":"Email"},"source":{"type":"string","enum":["waitlist_cold","waitlist_post_demo","waitlist_mid_demo","waitlist_teacher"],"title":"Source"},"name":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Name"},"roles":{"anyOf":[{"items":{"type":"string","enum":["educator","student","researcher","parent","administrator","exploring"]},"type":"array"},{"type":"null"}],"title":"Roles"}},"type":"object","required":["email","source"],"title":"WaitlistJoinRequest","description":"POST /waitlist body. Source distinguishes lead temperature:\ncold (landing CTA, no demo), post-demo (cap wall after Volley),\nteacher (landing CTA with 'I'm a teacher' toggle active).\n\n`name` and `roles` are optional richer-audience metadata currently\nonly sent from the cap-wall capture form. Both are dropped silently\nif missing — only `email` and `source` are required.\n\n`roles` is a multi-select list — the cap-wall lets a visitor pick\nany subset of the known roles (e.g. someone teaching while\nstudying picks both educator and student). Empty list and null\nare equivalent; the server stores NULL for either."},"WaitlistJoinResponse":{"properties":{"ok":{"type":"boolean","title":"Ok","default":true},"source":{"type":"string","title":"Source"}},"type":"object","required":["source"],"title":"WaitlistJoinResponse"},"WaitlistListResponse":{"properties":{"total":{"type":"integer","title":"Total"},"count":{"type":"integer","title":"Count"},"entries":{"items":{"$ref":"#/components/schemas/WaitlistEntry"},"type":"array","title":"Entries"}},"type":"object","required":["total","count","entries"],"title":"WaitlistListResponse","description":"GET /waitlist/list response. Admin-only. `total` is the\nunfiltered row count so the caller can see total signups even\nwhen filtering by source."},"WellbeingNote":{"properties":{"observed_at":{"type":"string","format":"date-time","title":"Observed At"},"assignment_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assignment Title"},"marker":{"type":"string","title":"Marker"},"note":{"type":"string","title":"Note"}},"type":"object","required":["observed_at","marker","note"],"title":"WellbeingNote"},"WellbeingStudentDetail":{"properties":{"student_id":{"type":"integer","title":"Student Id"},"name":{"type":"string","title":"Name"},"wellbeing_notes":{"items":{"$ref":"#/components/schemas/WellbeingNote"},"type":"array","title":"Wellbeing Notes"},"wellbeing_summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wellbeing Summary"},"wellbeing_summary_generated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Wellbeing Summary Generated At"}},"type":"object","required":["student_id","name","wellbeing_notes"],"title":"WellbeingStudentDetail"},"WellbeingStudentList":{"properties":{"students":{"items":{"$ref":"#/components/schemas/WellbeingStudentRow"},"type":"array","title":"Students"},"school_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"School Name"}},"type":"object","required":["students"],"title":"WellbeingStudentList"},"WellbeingStudentRow":{"properties":{"student_id":{"type":"integer","title":"Student Id"},"name":{"type":"string","title":"Name"},"wellbeing_marker_counts":{"additionalProperties":{"additionalProperties":{"type":"integer"},"type":"object"},"type":"object","title":"Wellbeing Marker Counts"},"most_recent":{"type":"string","format":"date-time","title":"Most Recent"},"recurring":{"type":"boolean","title":"Recurring"},"recurring_markers":{"items":{"type":"string"},"type":"array","title":"Recurring Markers"}},"type":"object","required":["student_id","name","wellbeing_marker_counts","most_recent","recurring","recurring_markers"],"title":"WellbeingStudentRow"},"WorkshopCheck":{"properties":{"ok":{"type":"boolean","title":"Ok"},"name":{"type":"string","title":"Name"}},"type":"object","required":["ok","name"],"title":"WorkshopCheck"},"WorkshopJoinRequest":{"properties":{"code":{"type":"string","maxLength":64,"minLength":1,"title":"Code"},"name":{"type":"string","maxLength":60,"minLength":1,"title":"Name"}},"type":"object","required":["code","name"],"title":"WorkshopJoinRequest"},"WorkshopJoinResponse":{"properties":{"teacher":{"$ref":"#/components/schemas/TeacherRead"},"teacher_token":{"type":"string","title":"Teacher Token"},"teacher_access_code":{"type":"string","title":"Teacher Access Code"}},"type":"object","required":["teacher","teacher_token","teacher_access_code"],"title":"WorkshopJoinResponse"},"WorkshopStudentView":{"properties":{"student_id":{"type":"integer","title":"Student Id"},"student_token":{"type":"string","title":"Student Token"}},"type":"object","required":["student_id","student_token"],"title":"WorkshopStudentView"},"WriteAction":{"properties":{"kind":{"type":"string","title":"Kind"},"assignment_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Assignment Id"},"classroom_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Classroom Id"},"outcome_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Outcome Id"},"unit_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Unit Id"},"text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"weeks":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Weeks"},"chosen":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Chosen"}},"type":"object","required":["kind"],"title":"WriteAction"},"WriteChoice":{"properties":{"label":{"type":"string","title":"Label"},"action":{"$ref":"#/components/schemas/WriteAction"}},"type":"object","required":["label","action"],"title":"WriteChoice"},"WritePreview":{"properties":{"summary":{"type":"string","title":"Summary"},"consequences":{"items":{"type":"string"},"type":"array","title":"Consequences","default":[]},"reversible":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reversible"},"confirm_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Confirm Token"},"choices":{"items":{"$ref":"#/components/schemas/WriteChoice"},"type":"array","title":"Choices","default":[]},"type_to_confirm":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type To Confirm"}},"type":"object","required":["summary"],"title":"WritePreview","description":"What would happen, in our words and the database's counts."},"WriteResult":{"properties":{"done":{"type":"boolean","title":"Done"},"changed":{"type":"boolean","title":"Changed"},"summary":{"type":"string","title":"Summary"}},"type":"object","required":["done","changed","summary"],"title":"WriteResult"}}}}