{"openapi":"3.1.0","info":{"title":"StudyCore API","description":"Active recall and spaced repetition tools for Nigerian students","version":"1.0.0"},"paths":{"/auth/login":{"get":{"tags":["authentication"],"summary":"Login","description":"Initiate Google OAuth login","operationId":"login_auth_login_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/auth/callback":{"get":{"tags":["authentication"],"summary":"Auth Callback","description":"Handle Google OAuth callback","operationId":"auth_callback_auth_callback_get","parameters":[{"name":"code","in":"query","required":true,"schema":{"type":"string","title":"Code"}},{"name":"state","in":"query","required":true,"schema":{"type":"string","title":"State"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/logout":{"get":{"tags":["authentication"],"summary":"Logout","description":"Log out user","operationId":"logout_auth_logout_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/schedules/create":{"post":{"tags":["schedules"],"summary":"Create Schedule","description":"Create a new spaced repetition schedule (internal tracking only).","operationId":"create_schedule_api_schedules_create_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateScheduleRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Create Schedule Api Schedules Create Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/schedules/my-schedules":{"get":{"tags":["schedules"],"summary":"Get My Schedules","description":"Get all schedules for the current user","operationId":"get_my_schedules_api_schedules_my_schedules_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/feedback":{"post":{"tags":["feedback"],"summary":"Submit Feedback","description":"Submit user feedback and notify admin via email","operationId":"submit_feedback_api_feedback_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/feedback/admin/list":{"get":{"tags":["feedback"],"summary":"List Feedback","description":"Get all feedback (admin only - add proper auth later)","operationId":"list_feedback_api_feedback_admin_list_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/analytics/stats":{"get":{"tags":["analytics"],"summary":"Get Stats","description":"Get user analytics and statistics","operationId":"get_stats_api_analytics_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/analytics/calibration":{"get":{"tags":["analytics"],"summary":"Get Calibration","description":"Return calibration data — the gap between student confidence\nand AI-measured coverage over time.\nThis is Cognitive Fitness Dimension 3: Calibration Accuracy.","operationId":"get_calibration_api_analytics_calibration_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/topics/create":{"post":{"tags":["topics"],"summary":"Create Topic","description":"Create a new topic with optional course and parent","operationId":"create_topic_api_topics_create_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTopicRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/topics/{topic_id}":{"put":{"tags":["topics"],"summary":"Update Topic","description":"Update an existing topic","operationId":"update_topic_api_topics__topic_id__put","parameters":[{"name":"topic_id","in":"path","required":true,"schema":{"type":"string","title":"Topic Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTopicRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["topics"],"summary":"Get Topic","description":"Get a specific topic","operationId":"get_topic_api_topics__topic_id__get","parameters":[{"name":"topic_id","in":"path","required":true,"schema":{"type":"string","title":"Topic Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["topics"],"summary":"Delete Topic","description":"Delete a topic (and all children if it has any)","operationId":"delete_topic_api_topics__topic_id__delete","parameters":[{"name":"topic_id","in":"path","required":true,"schema":{"type":"string","title":"Topic Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/topics/courses":{"get":{"tags":["topics"],"summary":"Get User Courses","description":"Get unique list of courses for current user","operationId":"get_user_courses_api_topics_courses_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/topics/list":{"get":{"tags":["topics"],"summary":"List Topics","description":"Get all topics for current user WITH MEMORY STRENGTH AND HIERARCHY","operationId":"list_topics_api_topics_list_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/topics/memory-stats":{"get":{"tags":["topics"],"summary":"Get Memory Stats","description":"Get memory strength statistics for dashboard.\nOnly includes active Memory Units (topics without children).","operationId":"get_memory_stats_api_topics_memory_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/topics/next-suggestion":{"get":{"tags":["topics"],"summary":"Get Next Topic Suggestion","description":"Suggest next topic to explain based on memory strength priority.\nOnly includes active Memory Units (topics without children).","operationId":"get_next_topic_suggestion_api_topics_next_suggestion_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/topics/daily-challenge":{"get":{"tags":["topics"],"summary":"Get Daily Challenge","description":"Unified ambient retrieval card.\nAuto-selects mode:\n- Synthesis: 3+ active topics with key_points in same course → Groq cross-topic question\n- Quick Recall: fallback → single key point question, no Groq call","operationId":"get_daily_challenge_api_topics_daily_challenge_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/topics/explain":{"post":{"tags":["topics"],"summary":"Save Explain Session","description":"Save explain session and AUTO-SCHEDULE next review","operationId":"save_explain_session_api_topics_explain_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateExplainSessionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/topics/{topic_id}/sessions":{"get":{"tags":["topics"],"summary":"Get Topic Sessions","description":"Get all explain sessions for a topic with reflections","operationId":"get_topic_sessions_api_topics__topic_id__sessions_get","parameters":[{"name":"topic_id","in":"path","required":true,"schema":{"type":"string","title":"Topic Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/topics/{topic_id}/followup":{"get":{"tags":["topics"],"summary":"Get Followup Question","description":"Get unseen follow-up question for a topic, if one exists.","operationId":"get_followup_question_api_topics__topic_id__followup_get","parameters":[{"name":"topic_id","in":"path","required":true,"schema":{"type":"string","title":"Topic Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/topics/{topic_id}/followup/{followup_id}/dismiss":{"post":{"tags":["topics"],"summary":"Dismiss Followup","description":"Mark follow-up as shown after the session completes.","operationId":"dismiss_followup_api_topics__topic_id__followup__followup_id__dismiss_post","parameters":[{"name":"topic_id","in":"path","required":true,"schema":{"type":"string","title":"Topic Id"}},{"name":"followup_id","in":"path","required":true,"schema":{"type":"string","title":"Followup Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/topics/eval-answer":{"post":{"tags":["topics"],"summary":"Evaluate Eval Answer","description":"Evaluate student's answer to the immediate evaluative question.\nCalled from the nudge modal when student submits their answer.","operationId":"evaluate_eval_answer_api_topics_eval_answer_post","requestBody":{"content":{"application/json":{"schema":{"type":"object","title":"Request"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/topics/{topic_id}/application-prompt":{"post":{"tags":["topics"],"summary":"Get Application Prompt","description":"Generate (or return cached) application challenge for a STRONG/AUTOMATIC topic.","operationId":"get_application_prompt_api_topics__topic_id__application_prompt_post","parameters":[{"name":"topic_id","in":"path","required":true,"schema":{"type":"string","title":"Topic Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["topics"],"summary":"Clear Application Prompt Cache","description":"Clear cached application prompt so a new one gets generated.","operationId":"clear_application_prompt_cache_api_topics__topic_id__application_prompt_delete","parameters":[{"name":"topic_id","in":"path","required":true,"schema":{"type":"string","title":"Topic Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/due-today":{"get":{"tags":["dashboard"],"summary":"Get Due Today","description":"Get schedules and topics due for review today (excludes System Nodes & non-active topics)","operationId":"get_due_today_api_due_today_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/push/subscribe":{"post":{"tags":["push"],"summary":"Subscribe","operationId":"subscribe_api_push_subscribe_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscribeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/push/vapid-public-key":{"get":{"tags":["push"],"summary":"Get Vapid Public Key","description":"Frontend fetches this to subscribe","operationId":"get_vapid_public_key_api_push_vapid_public_key_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/push/test-notify":{"post":{"tags":["push"],"summary":"Test Notification","description":"Send a test push to all subscriptions for the current user.","operationId":"test_notification_api_push_test_notify_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/guest/share/{topic_id}":{"post":{"tags":["guest"],"summary":"Create Share Token","operationId":"create_share_token_api_guest_share__topic_id__post","parameters":[{"name":"topic_id","in":"path","required":true,"schema":{"type":"string","title":"Topic Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/guest/topic/{token}":{"get":{"tags":["guest"],"summary":"Get Guest Topic","operationId":"get_guest_topic_api_guest_topic__token__get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/guest/explain":{"post":{"tags":["guest"],"summary":"Save Guest Explain","operationId":"save_guest_explain_api_guest_explain_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GuestExplainRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/":{"get":{"summary":"Home","description":"Landing page","operationId":"home__get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}},"head":{"summary":"Home","description":"Landing page","operationId":"home__get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/dashboard":{"get":{"summary":"Dashboard","description":"Dashboard - requires login","operationId":"dashboard_dashboard_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/guest/explain/{token}":{"get":{"summary":"Guest Explain Page","description":"Guest explain page — no auth required. Shareable link entry point.","operationId":"guest_explain_page_guest_explain__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"}}}}}}},"/demo":{"get":{"summary":"Demo Landing","description":"Demo mode landing - no auth required","operationId":"demo_landing_demo_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/demo/explain":{"get":{"summary":"Demo Explain","description":"Demo explain mode - no auth required","operationId":"demo_explain_demo_explain_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/demo/results":{"get":{"summary":"Demo Results","description":"Demo results page - prompts sign up","operationId":"demo_results_demo_results_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/topics":{"get":{"summary":"Topics Page","description":"Topics page - list and manage topics","operationId":"topics_page_topics_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/analytics":{"get":{"summary":"Analytics Page","description":"Analytics page","operationId":"analytics_page_analytics_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/explain/{topic_id}":{"get":{"summary":"Explain Mode","description":"Explain Mode page","operationId":"explain_mode_explain__topic_id__get","parameters":[{"name":"topic_id","in":"path","required":true,"schema":{"type":"string","title":"Topic Id"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/feedback":{"get":{"summary":"Feedback Page","description":"Feedback page","operationId":"feedback_page_feedback_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}},"head":{"summary":"Feedback Page","description":"Feedback page","operationId":"feedback_page_feedback_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/admin/feedback":{"get":{"summary":"Admin Feedback","description":"Admin feedback dashboard","operationId":"admin_feedback_admin_feedback_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/privacy":{"get":{"summary":"Privacy","description":"Privacy Policy","operationId":"privacy_privacy_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}},"head":{"summary":"Privacy","description":"Privacy Policy","operationId":"privacy_privacy_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/terms":{"get":{"summary":"Terms","description":"Terms of Service","operationId":"terms_terms_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}},"head":{"summary":"Terms","description":"Terms of Service","operationId":"terms_terms_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/health":{"get":{"summary":"Health Check","description":"Health check endpoint for monitoring","operationId":"health_check_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"head":{"summary":"Healthcheckhead","description":"HEAD method for health check endpoint","operationId":"healthcheckhead_health_head","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"CreateExplainSessionRequest":{"properties":{"topic_id":{"type":"string","title":"Topic Id"},"duration_seconds":{"type":"integer","title":"Duration Seconds"},"struggles":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Struggles"},"forgot":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Forgot"},"unclear":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Unclear"},"confidence":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Confidence"}},"type":"object","required":["topic_id","duration_seconds"],"title":"CreateExplainSessionRequest"},"CreateScheduleRequest":{"properties":{"topic":{"type":"string","maxLength":200,"minLength":1,"title":"Topic","description":"Topic or subject to review"},"start_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Date","description":"Start date in YYYY-MM-DD format"},"intervals":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Intervals","description":"Comma-separated intervals (e.g., '1,3,7,21')"},"topic_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Topic Id"}},"type":"object","required":["topic"],"title":"CreateScheduleRequest"},"CreateTopicRequest":{"properties":{"title":{"type":"string","title":"Title"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"course":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Course"},"parent_topic_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Topic Id"},"key_points":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Key Points"}},"type":"object","required":["title"],"title":"CreateTopicRequest"},"FeedbackRequest":{"properties":{"name":{"type":"string","title":"Name"},"email":{"type":"string","title":"Email"},"type":{"type":"string","title":"Type"},"message":{"type":"string","title":"Message"}},"type":"object","required":["name","email","type","message"],"title":"FeedbackRequest"},"GuestExplainRequest":{"properties":{"token":{"type":"string","title":"Token"},"duration_seconds":{"type":"integer","title":"Duration Seconds"},"struggles":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Struggles"},"forgot":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Forgot"},"unclear":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Unclear"},"confidence":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Confidence"}},"type":"object","required":["token","duration_seconds"],"title":"GuestExplainRequest"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"SubscribeRequest":{"properties":{"endpoint":{"type":"string","title":"Endpoint"},"keys":{"$ref":"#/components/schemas/SubscriptionKeys"}},"type":"object","required":["endpoint","keys"],"title":"SubscribeRequest"},"SubscriptionKeys":{"properties":{"p256dh":{"type":"string","title":"P256Dh"},"auth":{"type":"string","title":"Auth"}},"type":"object","required":["p256dh","auth"],"title":"SubscriptionKeys"},"UpdateTopicRequest":{"properties":{"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"course":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Course"},"parent_topic_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Topic Id"},"key_points":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Key Points"},"lifecycle":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lifecycle"}},"type":"object","title":"UpdateTopicRequest"},"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"}}}}