{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"paths":{"/admin/allowlist":{"post":{"tags":["admin"],"summary":"Add To Allowlist","description":"Add an email address to the signup allowlist.","operationId":"add_to_allowlist_admin_allowlist_post","parameters":[{"name":"x-admin-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AllowlistAddRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AllowlistEntry"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["admin"],"summary":"List Allowlist","description":"Return all allowlist entries, newest first.","operationId":"list_allowlist_admin_allowlist_get","parameters":[{"name":"x-admin-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AllowlistEntry"},"title":"Response List Allowlist Admin Allowlist Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/allowlist/{email}":{"delete":{"tags":["admin"],"summary":"Remove From Allowlist","description":"Remove an email address from the allowlist.\n\nIf the slot was already used (the account exists), the account itself is\nnot touched — this only prevents that address from being re-used.","operationId":"remove_from_allowlist_admin_allowlist__email__delete","parameters":[{"name":"email","in":"path","required":true,"schema":{"type":"string","title":"Email"}},{"name":"x-admin-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/allowlist/{email}/reset":{"post":{"tags":["admin"],"summary":"Reset Allowlist Slot","description":"Clear used_at so the address can sign up again (e.g. after account deletion).","operationId":"reset_allowlist_slot_admin_allowlist__email__reset_post","parameters":[{"name":"email","in":"path","required":true,"schema":{"type":"string","title":"Email"}},{"name":"x-admin-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AllowlistEntry"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/safety-stops":{"get":{"tags":["admin"],"summary":"List Safety Stops","description":"Return every consultation stopped for safety, newest first.\n\nJoins onto `chats`/`users` for who the conversation belonged to — the\naudit row alone only identifies a chat, not a patient a clinician can\nfollow up with.","operationId":"list_safety_stops_admin_safety_stops_get","parameters":[{"name":"x-admin-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SafetyStopEntry"},"title":"Response List Safety Stops Admin Safety Stops Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/guard-firings":{"get":{"tags":["admin"],"summary":"List Guard Firings","description":"Count how often each outbound-guard rule fired, most frequent first.\n\nThe guard already logged every firing and already wrote it to the message\nit fired on, and nothing read either — so \"does the reassurance rule catch\nanything, or is it dead weight?\" was a question only a grep of production\nlogs could answer. This makes it a number.\n\n`Message.flags` is `JSON` rather than `JSONB`, so there is no operator to\naggregate on in the database. The counting happens here instead; the volume\nis one row per patient turn, which is small enough that this is cheaper\nthan a migration.","operationId":"list_guard_firings_admin_guard_firings_get","parameters":[{"name":"x-admin-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GuardFiringsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/register":{"post":{"tags":["auth"],"summary":"Register","description":"Register a new user and email them a confirmation link.","operationId":"register_auth_register_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/login":{"post":{"tags":["auth"],"summary":"Login","description":"Login user and return access token. Refused until the email is confirmed.","operationId":"login_auth_login_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_login_auth_login_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Token"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/verify-email":{"post":{"tags":["auth"],"summary":"Verify Email Route","description":"Confirm an email address from the link we sent at signup.","operationId":"verify_email_route_auth_verify_email_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyEmailRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/resend-verification":{"post":{"tags":["auth"],"summary":"Resend Verification Route","description":"Send a fresh confirmation link.","operationId":"resend_verification_route_auth_resend_verification_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/forgot-password":{"post":{"tags":["auth"],"summary":"Forgot Password Route","description":"Email a password-reset link.","operationId":"forgot_password_route_auth_forgot_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/reset-password":{"post":{"tags":["auth"],"summary":"Reset Password Route","description":"Set a new password using a reset link.","operationId":"reset_password_route_auth_reset_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasswordResetRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/me":{"get":{"tags":["auth"],"summary":"Me","description":"Get current user information.","operationId":"me_auth_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/user/onboarding":{"post":{"tags":["User"],"summary":"Onboarding","operationId":"onboarding_user_onboarding_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/user/consent":{"get":{"tags":["User"],"summary":"Consent Status","operationId":"consent_status_user_consent_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]},"post":{"tags":["User"],"summary":"Accept Consent","operationId":"accept_consent_user_consent_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/user/profile":{"get":{"tags":["User"],"summary":"User Profile","operationId":"user_profile_user_profile_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/doctor-recommendations":{"get":{"tags":["Doctor Recommendation"],"summary":"List Chats","description":"List doctor recommendation chats for the current user.","operationId":"list_chats_doctor_recommendations_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"type":"object"},"type":"array","title":"Response List Chats Doctor Recommendations Get"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/doctor-recommendations/by-share-token/{token}":{"get":{"tags":["Doctor Recommendation"],"summary":"Get Chat By Share Token Route","description":"Public route for a read-only shared doctor recommendation chat.","operationId":"get_chat_by_share_token_route_doctor_recommendations_by_share_token__token__get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SharedChatResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/doctor-recommendations/by-share-token/{token}/export/pdf":{"get":{"tags":["Doctor Recommendation"],"summary":"Export Pdf By Share Token","description":"Public route for exporting a shared recommendation chat as PDF.","operationId":"export_pdf_by_share_token_doctor_recommendations_by_share_token__token__export_pdf_get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}},{"name":"anonymize","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Anonymize"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/doctor-recommendations/{chat_id}/share":{"post":{"tags":["Doctor Recommendation"],"summary":"Create Share Link","description":"Create or reuse a share link for a completed recommendation chat.","operationId":"create_share_link_doctor_recommendations__chat_id__share_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","title":"Chat Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Create Share Link Doctor Recommendations  Chat Id  Share Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Doctor Recommendation"],"summary":"Revoke Share Link","description":"Revoke the share link for a recommendation chat.","operationId":"revoke_share_link_doctor_recommendations__chat_id__share_delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","title":"Chat Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"boolean"},"title":"Response Revoke Share Link Doctor Recommendations  Chat Id  Share Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/doctor-recommendations/{chat_id}/export/pdf":{"get":{"tags":["Doctor Recommendation"],"summary":"Export Pdf","description":"Export a doctor recommendation chat as PDF.","operationId":"export_pdf_doctor_recommendations__chat_id__export_pdf_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","title":"Chat Id"}},{"name":"anonymize","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Anonymize"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/doctor-recommendations/{chat_id}/messages":{"get":{"tags":["Doctor Recommendation"],"summary":"Messages","description":"Get all messages for a doctor recommendation chat.","operationId":"messages_doctor_recommendations__chat_id__messages_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","title":"Chat Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object"},"title":"Response Messages Doctor Recommendations  Chat Id  Messages Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Doctor Recommendation"],"summary":"Send Message","description":"Send a message and stream the doctor recommendation response as SSE.","operationId":"send_message_doctor_recommendations__chat_id__messages_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","title":"Chat Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendMessageBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/doctor-recommendations/{chat_id}/transcribe":{"post":{"tags":["Doctor Recommendation"],"summary":"Transcribe Voice Note","description":"Transcribe a voice note to text for the doctor recommendation feature.\n\nNo `db` dependency: transcription touches no chat row, and taking one\nopened a connection per voice note for nothing.","operationId":"transcribe_voice_note_doctor_recommendations__chat_id__transcribe_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","title":"Chat Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_transcribe_voice_note_doctor_recommendations__chat_id__transcribe_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Transcribe Voice Note Doctor Recommendations  Chat Id  Transcribe Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/doctor-recommendations/{chat_id}/welcome":{"post":{"tags":["Doctor Recommendation"],"summary":"Send Welcome Message","description":"Generate and stream the recommendation welcome message.","operationId":"send_welcome_message_doctor_recommendations__chat_id__welcome_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","title":"Chat Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/doctor-recommendations/create":{"post":{"tags":["Doctor Recommendation"],"summary":"Create New Chat","description":"Create a new doctor recommendation chat.\n\nA ``consent_version`` in the body means the notice was on the screen the\npatient started from, and starting was the affirmation — so the chat is\ncreated already affirmed, in the same request. It is held to the same rule\nas `POST /{chat_id}/consent`: a stale version is refused, and what is\nstored is this server's wording, never the caller's.","operationId":"create_new_chat_doctor_recommendations_create_post","requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/CreateChatBody"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Create New Chat Doctor Recommendations Create Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/doctor-recommendations/consent-notice":{"get":{"tags":["Doctor Recommendation"],"summary":"Get Consultation Notice","description":"The per-consultation notice, before any consultation exists.\n\nThe home screen shows it under the box the patient types their first\nmessage into, so it has to be readable without a chat to hang it on. Same\nwording and version as `GET /{chat_id}/consent`.","operationId":"get_consultation_notice_doctor_recommendations_consent_notice_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsultationConsentResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/doctor-recommendations/transcribe":{"post":{"tags":["Doctor Recommendation"],"summary":"Transcribe Opening Voice Note","description":"Transcribe a voice note recorded before a consultation exists.\n\nThe first thing a patient says can be spoken, and at that point there is\nno chat yet. Gated on the account consent like everything else that\nhandles what a patient says; nothing is stored.","operationId":"transcribe_opening_voice_note_doctor_recommendations_transcribe_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_transcribe_opening_voice_note_doctor_recommendations_transcribe_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Transcribe Opening Voice Note Doctor Recommendations Transcribe Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/doctor-recommendations/{chat_id}/consent":{"get":{"tags":["Doctor Recommendation"],"summary":"Get Consultation Consent Route","description":"The affirmation this consultation needs, and whether it has one yet.\n\nNot gated on the affirmation, obviously — this is how the client finds out\nwhat to show.","operationId":"get_consultation_consent_route_doctor_recommendations__chat_id__consent_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","title":"Chat Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsultationConsentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Doctor Recommendation"],"summary":"Accept Consultation Consent","description":"Record the affirmation for this consultation.\n\nA stale version is rejected rather than upgraded, exactly as\n`POST /user/consent` does: the client is showing wording this server no\nlonger serves, and storing today's copy against what the patient actually\nread would make the record say something untrue.\n\nWhat is stored is this server's copy constant, never the client's — the\nrecord has to be the wording we served, not the wording a caller claims to\nhave shown.","operationId":"accept_consultation_consent_doctor_recommendations__chat_id__consent_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","title":"Chat Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsultationConsentBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsultationConsentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/":{"get":{"summary":"Root","description":"Health-check / welcome endpoint.","operationId":"root__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Root  Get"}}}}}}}},"components":{"schemas":{"AllowlistAddRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"}},"type":"object","required":["email"],"title":"AllowlistAddRequest"},"AllowlistEntry":{"properties":{"email":{"type":"string","title":"Email"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"},"used_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Used At"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["email","note","used_at","created_at"],"title":"AllowlistEntry"},"Body_login_auth_login_post":{"properties":{"grant_type":{"anyOf":[{"type":"string","pattern":"password"},{"type":"null"}],"title":"Grant Type"},"username":{"type":"string","title":"Username"},"password":{"type":"string","title":"Password"},"scope":{"type":"string","title":"Scope","default":""},"client_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Id"},"client_secret":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Secret"}},"type":"object","required":["username","password"],"title":"Body_login_auth_login_post"},"Body_transcribe_opening_voice_note_doctor_recommendations_transcribe_post":{"properties":{"audio":{"type":"string","format":"binary","title":"Audio","description":"Audio file (e.g. webm, wav, mp3)"}},"type":"object","required":["audio"],"title":"Body_transcribe_opening_voice_note_doctor_recommendations_transcribe_post"},"Body_transcribe_voice_note_doctor_recommendations__chat_id__transcribe_post":{"properties":{"audio":{"type":"string","format":"binary","title":"Audio","description":"Audio file (e.g. webm, wav, mp3)"}},"type":"object","required":["audio"],"title":"Body_transcribe_voice_note_doctor_recommendations__chat_id__transcribe_post"},"ConsentRequest":{"properties":{"version":{"type":"string","maxLength":64,"minLength":1,"title":"Version"}},"type":"object","required":["version"],"title":"ConsentRequest"},"ConsentResponse":{"properties":{"version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Version"},"accepted_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Accepted At"},"required_version":{"type":"string","title":"Required Version"}},"type":"object","required":["required_version"],"title":"ConsentResponse"},"ConsultationConsentBody":{"properties":{"version":{"type":"string","maxLength":64,"minLength":1,"title":"Version"}},"type":"object","required":["version"],"title":"ConsultationConsentBody","description":"The per-consultation affirmation, as the client submits it."},"ConsultationConsentResponse":{"properties":{"required_version":{"type":"string","title":"Required Version"},"copy":{"type":"string","title":"Copy"},"accepted_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Accepted Version"}},"type":"object","required":["required_version","copy"],"title":"ConsultationConsentResponse","description":"What the client needs to render the affirmation and know its state.\n\n``copy`` is served rather than held in the frontend so there is one source\nof truth for the wording: the string the patient reads is the string that\ngets stored."},"CreateChatBody":{"properties":{"patient_context":{"anyOf":[{"$ref":"#/components/schemas/PatientContextBody"},{"type":"null"}]},"consent_version":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Consent Version"}},"type":"object","title":"CreateChatBody","description":"Request body for creating a doctor recommendation chat."},"EmailRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"}},"type":"object","required":["email"],"title":"EmailRequest","description":"Used by both resend-verification and forgot-password."},"GuardFiring":{"properties":{"label":{"type":"string","title":"Label"},"count":{"type":"integer","title":"Count"},"last_seen":{"type":"string","format":"date-time","title":"Last Seen"}},"type":"object","required":["label","count","last_seen"],"title":"GuardFiring","description":"How often one outbound-guard rule replaced or dropped something."},"GuardFiringsResponse":{"properties":{"firings":{"items":{"$ref":"#/components/schemas/GuardFiring"},"type":"array","title":"Firings"},"total":{"type":"integer","title":"Total"},"messages_scanned":{"type":"integer","title":"Messages Scanned"}},"type":"object","required":["firings","total","messages_scanned"],"title":"GuardFiringsResponse"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"MessageResponse":{"properties":{"message":{"type":"string","title":"Message"}},"type":"object","required":["message"],"title":"MessageResponse"},"OnboardingRequest":{"properties":{"age":{"type":"integer","maximum":120.0,"exclusiveMinimum":0.0,"title":"Age"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"},"gender":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gender"},"blood_group":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Blood Group"},"allergies":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Allergies"},"occupation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Occupation"}},"type":"object","required":["age"],"title":"OnboardingRequest","description":"The saved \"about you\" details.\n\nOnly age is required. Blood group and occupation used to be, which meant a\nsix-screen form stood between a patient and their first question; neither\nchanges which clinician someone should see, and the intake asks about work\nand allergies itself where they matter."},"OnboardingResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"}},"type":"object","required":["success","message"],"title":"OnboardingResponse"},"PasswordResetRequest":{"properties":{"token":{"type":"string","title":"Token"},"password":{"type":"string","minLength":8,"title":"Password"}},"type":"object","required":["token","password"],"title":"PasswordResetRequest"},"PatientContextBody":{"properties":{"patient_name":{"type":"string","maxLength":512,"minLength":1,"title":"Patient Name"},"patient_age":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Patient Age"},"gender":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Gender"},"blood_group":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Blood Group"},"allergies":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Allergies"},"occupation":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Occupation"}},"type":"object","required":["patient_name"],"title":"PatientContextBody","description":"Per-consultation patient information submitted when starting a new chat."},"ProfileResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"data":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Data"}},"type":"object","required":["success"],"title":"ProfileResponse"},"RegisterResponse":{"properties":{"user":{"$ref":"#/components/schemas/UserResponse"},"message":{"type":"string","title":"Message"}},"type":"object","required":["user","message"],"title":"RegisterResponse","description":"Signup deliberately returns no access token.\n\nLogin is refused until the address is confirmed, so a token issued here\nwould be rejected by every guarded endpoint. Handing one out would only\ninvite the frontend to route someone into an app they cannot use."},"SafetyStopEntry":{"properties":{"id":{"type":"integer","title":"Id"},"chat_id":{"type":"string","title":"Chat Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"source":{"type":"string","title":"Source"},"category":{"type":"string","title":"Category"},"trigger":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trigger"},"concern":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Concern"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"excerpt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Excerpt"},"turn_number":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Turn Number"},"patient_name":{"type":"string","title":"Patient Name"},"patient_email":{"type":"string","title":"Patient Email"}},"type":"object","required":["id","chat_id","created_at","source","category","trigger","concern","reason","excerpt","turn_number","patient_name","patient_email"],"title":"SafetyStopEntry"},"SendMessageBody":{"properties":{"message":{"type":"string","maxLength":50000,"minLength":1,"title":"Message"}},"type":"object","required":["message"],"title":"SendMessageBody","description":"Request body for sending a doctor recommendation chat message."},"SharedChatResponse":{"properties":{"id":{"type":"string","title":"Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"},"patient_context":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Patient Context"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"messages":{"items":{"type":"object"},"type":"array","title":"Messages"}},"type":"object","required":["id","name","state","patient_context","created_at","messages"],"title":"SharedChatResponse","description":"Public read-only shared doctor recommendation chat response."},"Token":{"properties":{"access_token":{"type":"string","title":"Access Token"},"token_type":{"type":"string","title":"Token Type","default":"bearer"}},"type":"object","required":["access_token"],"title":"Token"},"UserCreate":{"properties":{"user_name":{"type":"string","title":"User Name"},"email":{"type":"string","format":"email","title":"Email"},"password":{"type":"string","minLength":8,"title":"Password"}},"type":"object","required":["user_name","email","password"],"title":"UserCreate"},"UserResponse":{"properties":{"id":{"anyOf":[{"type":"string"},{"type":"integer"}],"title":"Id"},"user_name":{"type":"string","title":"User Name"},"email":{"type":"string","format":"email","title":"Email"},"onboarding_complete":{"type":"boolean","title":"Onboarding Complete","default":false},"email_verified":{"type":"boolean","title":"Email Verified","default":false}},"type":"object","required":["id","user_name","email"],"title":"UserResponse"},"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"},"VerifyEmailRequest":{"properties":{"token":{"type":"string","title":"Token"}},"type":"object","required":["token"],"title":"VerifyEmailRequest"}},"securitySchemes":{"OAuth2PasswordBearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"/auth/login"}}}}}}