{"openapi":"3.1.0","info":{"title":"ReadyCheck","version":"0.1.0"},"paths":{"/manager/modules/exam":{"post":{"summary":"Toggle Exam Module","description":"Owner-only. Deliberately NOT behind require_exam_module -- this is the\nroute that turns it on, so it must work while it is off.\n\nDisabling abandons in-flight runs and deletes nothing else. Re-enabling\nrestores every past result unchanged.","operationId":"toggle_exam_module_manager_modules_exam_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_toggle_exam_module_manager_modules_exam_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/manager/exams":{"get":{"summary":"Manager Exams","operationId":"manager_exams_manager_exams_get","parameters":[{"name":"msg","in":"query","required":false,"schema":{"type":"string","default":"","title":"Msg"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Create Exam","operationId":"create_exam_manager_exams_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_create_exam_manager_exams_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/manager/exams/{aid}/{action}":{"post":{"summary":"Set Exam Status","operationId":"set_exam_status_manager_exams__aid___action__post","parameters":[{"name":"aid","in":"path","required":true,"schema":{"type":"string","title":"Aid"}},{"name":"action","in":"path","required":true,"schema":{"type":"string","title":"Action"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/manager/exams/{aid}":{"get":{"summary":"Exam Results","operationId":"exam_results_manager_exams__aid__get","parameters":[{"name":"aid","in":"path","required":true,"schema":{"type":"string","title":"Aid"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/exam":{"get":{"summary":"Learner Exams","operationId":"learner_exams_exam_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/exam/{aid}/start":{"post":{"summary":"Start Exam","operationId":"start_exam_exam__aid__start_post","parameters":[{"name":"aid","in":"path","required":true,"schema":{"type":"string","title":"Aid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/exam/run/{run_id}":{"get":{"summary":"Sit Exam","operationId":"sit_exam_exam_run__run_id__get","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/exam/run/{run_id}/answer":{"post":{"summary":"Answer Exam","description":"Record an answer. Returns NO feedback -- not correctness, not the key.\n\nImmediate feedback would turn the sitting back into a drill and destroy\nthe score's meaning. Answers are persisted as they are given so a dropped\nconnection costs nothing.","operationId":"answer_exam_exam_run__run_id__answer_post","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}}],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_answer_exam_exam_run__run_id__answer_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/exam/run/{run_id}/submit":{"post":{"summary":"Submit Exam","operationId":"submit_exam_exam_run__run_id__submit_post","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/exam/result/{run_id}":{"get":{"summary":"Exam Result","operationId":"exam_result_exam_result__run_id__get","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/":{"get":{"summary":"Index","operationId":"index__get","parameters":[{"name":"next","in":"query","required":false,"schema":{"type":"string","default":"","title":"Next"}},{"name":"expired","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Expired"}},{"name":"reauth","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Reauth"}},{"name":"signed_out","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Signed Out"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/magic":{"post":{"summary":"Request Magic","operationId":"request_magic_auth_magic_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_request_magic_auth_magic_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/callback":{"get":{"summary":"Magic Callback","operationId":"magic_callback_auth_callback_get","parameters":[{"name":"token","in":"query","required":false,"schema":{"type":"string","default":"","title":"Token"}},{"name":"next","in":"query","required":false,"schema":{"type":"string","default":"","title":"Next"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/logout":{"post":{"summary":"Logout","operationId":"logout_auth_logout_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/auth/logout_all":{"post":{"summary":"Logout All","description":"Sign out of every device. The lost-phone button.\n\nNecessary because of the long windows: a learner session survives 14 days\nof silence, so \"I left it signed in on the shared workshop tablet\" needs an\nanswer that does not involve waiting two weeks. revoke_sessions_for already\nexisted for suspension; this points it at the caller's own sessions, which\nincludes the one making the request -- signing out here is the intent.\n\nNot gated on freshness: locking your account down must never be harder\nthan leaving it open.","operationId":"logout_all_auth_logout_all_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/invite/{token}":{"get":{"summary":"Invite Page","description":"The org is derived from the TOKEN, never from the URL path. See\nstore.create_invite for why invites are a top-level collection.","operationId":"invite_page_invite__token__get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Invite Accept","operationId":"invite_accept_invite__token__post","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_invite_accept_invite__token__post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/webhooks/resend":{"post":{"summary":"Resend Webhook","operationId":"resend_webhook_webhooks_resend_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/manager":{"get":{"summary":"Manager Home","operationId":"manager_home_manager_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/manager/learner/{user_id}":{"get":{"summary":"Manager Learner","operationId":"manager_learner_manager_learner__user_id__get","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/manager/people":{"get":{"summary":"Manager People","operationId":"manager_people_manager_people_get","parameters":[{"name":"msg","in":"query","required":false,"schema":{"type":"string","default":"","title":"Msg"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/manager/invite":{"post":{"summary":"Manager Invite","description":"Bulk by design. A manager onboarding 28 people will not use a\none-at-a-time form, and the first pilot dies on that friction.","operationId":"manager_invite_manager_invite_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_manager_invite_manager_invite_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/manager/member/{user_id}/resend_invite":{"post":{"summary":"Manager Resend Invite","description":"Email the invitation again, to the same address.\n\nThe gap this closes: /manager/invite skips anyone who is already a member,\nand an unaccepted invite IS a member row (seatStatus='invited'), so a\nmanager whose invitation bounced had no way to send another one. The copy\nlink existed, but that solves a different problem -- it assumes you have\nanother channel to the person. Retrying the mail is the obvious first move\nand it was simply missing.\n\nMints a NEW token rather than resending the old one, because the old one\nis unrecoverable by design (only its hash is stored). Both remain valid;\nconsume_invite is single-use, so whichever is clicked first wins.\n\nNo seat is consumed -- the member already holds an 'invited' seat, so this\ncannot be used to get around the seat limit.","operationId":"manager_resend_invite_manager_member__user_id__resend_invite_post","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/manager/member/{user_id}/invite_link":{"post":{"summary":"Manager Invite Link","description":"Mint a fresh invitation link and show it to the manager once.\n\nWhy MINT rather than reveal: create_invite stores only sha256(token), so\nthe original link genuinely cannot be recovered -- that is store.py's \"a\ndatabase read must never yield a live credential\" invariant working as\ndesigned, and it is not worth breaking for this. The previous token stays\nvalid until its TTL; both redeem to the same seat and consume_invite is\nsingle-use, so the duplicate is harmless.\n\nWhy it exists: an org whose mail system refuses unknown senders on policy\n(Curtin's IronPort, and every university and enterprise like it) cannot be\nreached by fixing our DNS -- SPF, DKIM and DMARC were all verified passing\nwhen that rejection happened. A link the MANAGER forwards from their own\nalready-trusted address is the only delivery path that does not depend on\nthe receiving org trusting readycheck.tech.\n\nRenders directly instead of redirecting: a 303 would put a live invite\ntoken in a URL, and therefore in browser history and in Cloud Run's request\nlog, where the whole point was to stop needing log access to get it.","operationId":"manager_invite_link_manager_member__user_id__invite_link_post","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/manager/member/{user_id}/{action}":{"post":{"summary":"Manager Member Action","operationId":"manager_member_action_manager_member__user_id___action__post","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"action","in":"path","required":true,"schema":{"type":"string","title":"Action"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/manager/billing":{"get":{"summary":"Manager Billing","operationId":"manager_billing_manager_billing_get","parameters":[{"name":"msg","in":"query","required":false,"schema":{"type":"string","default":"","title":"Msg"}},{"name":"err","in":"query","required":false,"schema":{"type":"string","default":"","title":"Err"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/manager/billing/change":{"post":{"summary":"Manager Billing Change","description":"SIMULATED. Writes two fields and an audit row; no money moves.\n\nCode decides, not the form: plans.validate() is the authority and the UI\nis only a convenience over it. A hand-crafted POST gets the same answer.","operationId":"manager_billing_change_manager_billing_change_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_manager_billing_change_manager_billing_change_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/manager/content":{"get":{"summary":"Manager Content","operationId":"manager_content_manager_content_get","parameters":[{"name":"msg","in":"query","required":false,"schema":{"type":"string","default":"","title":"Msg"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/manager/content/upload":{"post":{"summary":"Manager Upload","operationId":"manager_upload_manager_content_upload_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_manager_upload_manager_content_upload_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/manager/review/{qid}/{action}":{"post":{"summary":"Manager Review","operationId":"manager_review_manager_review__qid___action__post","parameters":[{"name":"qid","in":"path","required":true,"schema":{"type":"string","title":"Qid"}},{"name":"action","in":"path","required":true,"schema":{"type":"string","title":"Action"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/manager/export.csv":{"get":{"summary":"Manager Export","operationId":"manager_export_manager_export_csv_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/learn":{"get":{"summary":"Learn","operationId":"learn_learn_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/api/next":{"get":{"summary":"Next Question","operationId":"next_question_api_next_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/answer":{"post":{"summary":"Answer","operationId":"answer_api_answer_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_answer_api_answer_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/flag":{"post":{"summary":"Flag","description":"A learner flags a bad question; it stops being served pending review.\nBoth methodology notes promise customers this loop exists.\n\nRate-limited per learner per day -- unbounded, this endpoint could\nquarantine the whole bank and take the org's learners offline. The limit\nlives in orgstore because it is enforced with an org-plane counter; this\nhandler only turns the refusal into a status code.","operationId":"flag_api_flag_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_flag_api_flag_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/_health":{"get":{"summary":"Health","description":"NOT /healthz.\n\nMeasured 2026-08-04: on Cloud Run, Google's frontend intercepts /healthz\nand returns its own branded HTML 404 -- the request never reaches the\ncontainer. The route was registered (it appears in /openapi.json) and an\nunregistered path like /zzz correctly returned FastAPI's JSON 404, which\nis how the interception was isolated. Anything under a leading underscore\nis passed through untouched.","operationId":"health__health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"Body_answer_api_answer_post":{"properties":{"question_id":{"type":"string","title":"Question Id"},"choice":{"type":"integer","title":"Choice"},"time_ms":{"type":"integer","title":"Time Ms","default":0}},"type":"object","required":["question_id","choice"],"title":"Body_answer_api_answer_post"},"Body_answer_exam_exam_run__run_id__answer_post":{"properties":{"question_id":{"type":"string","title":"Question Id"},"choice":{"type":"integer","title":"Choice"}},"type":"object","required":["question_id","choice"],"title":"Body_answer_exam_exam_run__run_id__answer_post"},"Body_create_exam_manager_exams_post":{"properties":{"name":{"type":"string","title":"Name","default":""},"item_count":{"type":"integer","title":"Item Count","default":0},"time_limit_min":{"type":"integer","title":"Time Limit Min","default":0}},"type":"object","title":"Body_create_exam_manager_exams_post"},"Body_flag_api_flag_post":{"properties":{"question_id":{"type":"string","title":"Question Id"}},"type":"object","required":["question_id"],"title":"Body_flag_api_flag_post"},"Body_invite_accept_invite__token__post":{"properties":{"display_name":{"type":"string","title":"Display Name","default":""}},"type":"object","title":"Body_invite_accept_invite__token__post"},"Body_manager_billing_change_manager_billing_change_post":{"properties":{"plan_id":{"type":"string","title":"Plan Id"},"seats":{"type":"integer","title":"Seats"}},"type":"object","required":["plan_id","seats"],"title":"Body_manager_billing_change_manager_billing_change_post"},"Body_manager_invite_manager_invite_post":{"properties":{"emails":{"type":"string","title":"Emails"},"role":{"type":"string","title":"Role","default":"learner"},"cohort_id":{"type":"string","title":"Cohort Id","default":""}},"type":"object","required":["emails"],"title":"Body_manager_invite_manager_invite_post"},"Body_manager_upload_manager_content_upload_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"},"bank_name":{"type":"string","title":"Bank Name","default":""}},"type":"object","required":["file"],"title":"Body_manager_upload_manager_content_upload_post"},"Body_request_magic_auth_magic_post":{"properties":{"email":{"type":"string","title":"Email"},"next_url":{"type":"string","title":"Next Url","default":""}},"type":"object","required":["email"],"title":"Body_request_magic_auth_magic_post"},"Body_toggle_exam_module_manager_modules_exam_post":{"properties":{"enabled":{"type":"string","title":"Enabled","default":""}},"type":"object","title":"Body_toggle_exam_module_manager_modules_exam_post"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}