{"openapi":"3.1.0","info":{"title":"Clarys API","version":"1.2.0"},"paths":{"/v1/labs/panels/{panel_id}/date":{"patch":{"tags":["labs"],"summary":"Correct Panel Date","description":"Correct a panel date while clearing stale collection time evidence.","operationId":"correct_panel_date_v1_labs_panels__panel_id__date_patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"panel_id","in":"path","required":true,"schema":{"type":"string","title":"Panel Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PanelDateCorrection"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_PanelDateCorrectionResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/labs/uploads":{"post":{"tags":["labs"],"summary":"V1 Upload Lab Pdf","operationId":"v1_upload_lab_pdf_v1_labs_uploads_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"force","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Force"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_v1_upload_lab_pdf_v1_labs_uploads_post"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_UploadResponse_"}}}},"413":{"description":"Upload exceeds the maximum accepted size.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["labs"],"summary":"V1 Get Uploads List","operationId":"v1_get_uploads_list_v1_labs_uploads_get","security":[{"HTTPBearer":[]}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_UploadHistoryResponse_"}}}}}}},"/v1/labs/uploads/{upload_id}/status":{"get":{"tags":["labs"],"summary":"V1 Get Upload Status","operationId":"v1_get_upload_status_v1_labs_uploads__upload_id__status_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"upload_id","in":"path","required":true,"schema":{"type":"string","title":"Upload Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_UploadStatusResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/labs/uploads/{upload_id}/flagged":{"get":{"tags":["labs"],"summary":"V1 Get Flagged Markers","operationId":"v1_get_flagged_markers_v1_labs_uploads__upload_id__flagged_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"upload_id","in":"path","required":true,"schema":{"type":"string","title":"Upload Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_FlaggedMarkersResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/labs/uploads/{upload_id}/resolve":{"post":{"tags":["labs"],"summary":"V1 Resolve Flagged Markers","operationId":"v1_resolve_flagged_markers_v1_labs_uploads__upload_id__resolve_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"upload_id","in":"path","required":true,"schema":{"type":"string","title":"Upload Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolveMarkersRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ResolveMarkersResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/labs/catalog/markers":{"get":{"tags":["labs"],"summary":"V1 Get Marker Catalog","operationId":"v1_get_marker_catalog_v1_labs_catalog_markers_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_MarkerCatalogResponse_"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/labs/panels/count":{"get":{"tags":["labs"],"summary":"V1 Labs Panel Count","description":"Count of the user's lab_panels (replaces the FE direct-Supabase query).","operationId":"v1_labs_panel_count_v1_labs_panels_count_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_PanelCountResponse_"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/labs/panels/{panel_id}/insight":{"get":{"tags":["labs"],"summary":"V1 Patient Panel Insight","description":"Patient-facing master insight for a panel. Scoped to the caller's own user_id.\n\nStates: 'signed' (a doctor approved it), 'preliminary' (an unsigned AI reading, including the\ndoctor-owned regenerated draft before signature), 'generating' (the AI reading is being\nprepared), 'reviewing' (a doctor requested changes) and 'unavailable' (the AI reading could not\nbe generated and no doctor is in the loop -- never tell an organic user a doctor is reviewing).\nThe redacted view exposes ONLY patient_note/sections + disclaimer + urgency BANNER level +\ndoctor display name + dates — never clinical_note, evidence, PMIDs, raw_text, protocol or snapshot.","operationId":"v1_patient_panel_insight_v1_labs_panels__panel_id__insight_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"panel_id","in":"path","required":true,"schema":{"type":"string","title":"Panel Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_MasterInsightPatient_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/labs/result/{result_id}":{"patch":{"tags":["labs"],"summary":"V1 Edit Panel Marker","description":"Edit a panel marker value/unit under the /v1 envelope.","operationId":"v1_edit_panel_marker_v1_labs_result__result_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"result_id","in":"path","required":true,"schema":{"type":"string","title":"Result Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditPanelMarkerRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_EditPanelMarkerResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/labs/admin/telemetry":{"get":{"tags":["labs"],"summary":"V1 Get Extraction Telemetry","description":"Per-lab extraction-quality observability under the /v1 envelope.","operationId":"v1_get_extraction_telemetry_v1_labs_admin_telemetry_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":7,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ExtractionTelemetryResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/retrospective":{"get":{"tags":["overview"],"summary":"V1 Get Retrospective","description":"Return the retrospective entry for a date (or null if none).","operationId":"v1_get_retrospective_v1_retrospective_get","parameters":[{"name":"date","in":"query","required":true,"schema":{"type":"string","description":"YYYY-MM-DD","title":"Date"},"description":"YYYY-MM-DD"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_Union_RetrospectiveEntry__NoneType__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["overview"],"summary":"V1 Upsert Retrospective","description":"Upsert the retrospective entry for a date (user_id,date unique).","operationId":"v1_upsert_retrospective_v1_retrospective_put","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetrospectiveUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_RetrospectiveUpdateResult_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/peptide-experiments":{"get":{"tags":["protocols"],"summary":"V1 Get Peptide Experiments","description":"Active peptide experiments + their logs (frontend groups them client-side).","operationId":"v1_get_peptide_experiments_v1_peptide_experiments_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_PeptideExperimentsResponse_"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/peptide-experiments/logs":{"post":{"tags":["protocols"],"summary":"V1 Upsert Peptide Log","description":"Upsert a peptide log (unique on experiment_id, log_date).","operationId":"v1_upsert_peptide_log_v1_peptide_experiments_logs_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PeptideLogUpsert"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_PeptideLogResult_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/protocols/doses/{dose_id}":{"put":{"tags":["protocols"],"summary":"V1 Update Dose","description":"Update a dose log entry under the /v1 envelope.","operationId":"v1_update_dose_v1_protocols_doses__dose_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"dose_id","in":"path","required":true,"schema":{"type":"string","title":"Dose Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDoseRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_DoseUpdateResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["protocols"],"summary":"V1 Delete Dose","description":"Delete a dose log entry under the /v1 envelope.","operationId":"v1_delete_dose_v1_protocols_doses__dose_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"dose_id","in":"path","required":true,"schema":{"type":"string","title":"Dose Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_DoseDeleteResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/protocols":{"post":{"tags":["protocols"],"summary":"V1 Create Protocol","description":"Create a protocol under the /v1 envelope.","operationId":"v1_create_protocol_v1_protocols_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProtocolCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ProtocolRow_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["protocols"],"summary":"V1 List Protocols","operationId":"v1_list_protocols_v1_protocols_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ProtocolListResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/protocols/{protocol_id}":{"patch":{"tags":["protocols"],"summary":"V1 Update Protocol","description":"Update a protocol under the /v1 envelope.","operationId":"v1_update_protocol_v1_protocols__protocol_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"protocol_id","in":"path","required":true,"schema":{"type":"string","title":"Protocol Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProtocolUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ProtocolRow_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/protocols/compounds":{"get":{"tags":["protocols"],"summary":"V1 Get Compounds","operationId":"v1_get_compounds_v1_protocols_compounds_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_CompoundsResponse_"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/protocols/concentrations":{"get":{"tags":["protocols"],"summary":"V1 Get Concentrations","operationId":"v1_get_concentrations_v1_protocols_concentrations_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"start","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start"}},{"name":"end","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End"}},{"name":"resolution_minutes","in":"query","required":false,"schema":{"type":"integer","maximum":360,"minimum":15,"default":60,"title":"Resolution Minutes"}},{"name":"compound_ids","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Compound Ids"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ConcentrationsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/protocols/adherence":{"get":{"tags":["protocols"],"summary":"V1 Get Adherence","operationId":"v1_get_adherence_v1_protocols_adherence_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_AdherenceResponse_"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/protocols/{protocol_id}/schedule-history":{"get":{"tags":["protocols"],"summary":"V1 Get Schedule History","description":"Spec 024 PR3 (Model C): ordered titration history for a protocol.\n\nReturns every protocol_schedules version (oldest first); the version with\neffective_to == null is the one currently in effect. Per-user isolated —\nanother user's versions are never returned (ownership gate + user_id scope).\nGives PR4's titration timeline a stable contract.","operationId":"v1_get_schedule_history_v1_protocols__protocol_id__schedule_history_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"protocol_id","in":"path","required":true,"schema":{"type":"string","title":"Protocol Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ScheduleHistoryResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/protocols/doses":{"get":{"tags":["protocols"],"summary":"V1 Get Dose History","operationId":"v1_get_dose_history_v1_protocols_doses_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"compound_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Compound Id"}},{"name":"start","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start"}},{"name":"end","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}},{"name":"include_skipped","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Skipped"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_DoseHistoryResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["protocols"],"summary":"V1 Log Dose","operationId":"v1_log_dose_v1_protocols_doses_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogDoseRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_DoseLogResult_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/protocols/injection-sites":{"get":{"tags":["protocols"],"summary":"V1 Get Injection Sites","description":"Injection-zone rotation read model for the authenticated user.\n\nAll rotational compounds share one body pool, so this reads dose_log across\nall compounds. `injury_site` is intentionally excluded from rotation math.","operationId":"v1_get_injection_sites_v1_protocols_injection_sites_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"lookback_days","in":"query","required":false,"schema":{"type":"integer","maximum":365,"minimum":1,"default":90,"title":"Lookback Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_InjectionSitesResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/protocols/supply":{"get":{"tags":["protocols"],"summary":"V1 Get Protocol Supply","description":"Current-vial depletion read model for protocols with vial data.\n\nSpec 023 D3 Level A only: remaining mg is the starting vial amount minus\nmg-denominated dose logs for the same compound since the vial was opened.\nDose logs in non-mg units are ignored and counted in the response.","operationId":"v1_get_protocol_supply_v1_protocols_supply_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_VialSupplyResponse_"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/protocols/{protocol_id}/vial":{"post":{"tags":["protocols"],"summary":"V1 Reset Protocol Vial","description":"Open/reset the current vial baseline for a protocol.","operationId":"v1_reset_protocol_vial_v1_protocols__protocol_id__vial_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"protocol_id","in":"path","required":true,"schema":{"type":"string","title":"Protocol Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProtocolVialResetRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_VialResetResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/protocols/pause":{"post":{"tags":["protocols"],"summary":"V1 Pause Protocols","description":"Batch travel-pause primitive (D9): open ONE pause window per protocol and\nflip each to status='paused' (D10). Idempotent per protocol — a protocol that\nalready has an open window is returned in `already_open` and NOT re-opened, so\nthe one-open-window invariant is never violated.","operationId":"v1_pause_protocols_v1_protocols_pause_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProtocolPauseRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_PauseResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/protocols/{protocol_id}/resume":{"post":{"tags":["protocols"],"summary":"V1 Resume Protocol","description":"RESUME (D17/FR-010): set resumed_at on the open window and flip status back\nto 'active'. The historical paused gap STAYS excluded from adherence (contrast\ncancel-pause, which re-includes it).","operationId":"v1_resume_protocol_v1_protocols__protocol_id__resume_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"protocol_id","in":"path","required":true,"schema":{"type":"string","title":"Protocol Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ResumeResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/protocols/{protocol_id}/cancel-pause":{"post":{"tags":["protocols"],"summary":"V1 Cancel Protocol Pause","description":"CANCEL-PAUSE (D17/FR-012): DELETE the open window entirely and flip status\nback to 'active'. Those days go back to being expected/counted (un-excluded) —\nthis is NOT a resume.","operationId":"v1_cancel_protocol_pause_v1_protocols__protocol_id__cancel_pause_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"protocol_id","in":"path","required":true,"schema":{"type":"string","title":"Protocol Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_CancelPauseResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/protocols/stack":{"get":{"tags":["protocols"],"summary":"V1 Get Protocol Stack","description":"Active protocol stack for ProtocolPage: protocols + dual-horizon compound\ndetails + recent dose log in one call (protocol-stack-dual-horizon-v1).\nReplaces the frontend's direct Supabase reads of protocols/compounds/dose_log.","operationId":"v1_get_protocol_stack_v1_protocols_stack_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ProtocolStackResponse_"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/protocols/experiments":{"get":{"tags":["protocols"],"summary":"V1 Get Experiments","operationId":"v1_get_experiments_v1_protocols_experiments_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":"active","title":"Status"}},{"name":"include_completed","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Completed"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ExperimentsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/protocols/experiments/{experiment_id}":{"get":{"tags":["protocols"],"summary":"V1 Get Experiment Detail","operationId":"v1_get_experiment_detail_v1_protocols_experiments__experiment_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"experiment_id","in":"path","required":true,"schema":{"type":"string","title":"Experiment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ExperimentDetailResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/protocols/active":{"get":{"tags":["protocols"],"summary":"V1 List Active Protocols","operationId":"v1_list_active_protocols_v1_protocols_active_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ProtocolListResponse_"}}}}},"security":[{"HTTPBearer":[]}]}},"/health":{"get":{"summary":"Health","description":"Healthcheck endpoint (no auth). Verifies Supabase connection is configured.","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}}}}},"/v1/system/health":{"get":{"tags":["system"],"summary":"V1 Health","description":"Healthcheck (no auth) under the /v1 envelope.","operationId":"v1_health_v1_system_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_HealthResponse_"}}}}}}},"/v1/system/status":{"get":{"tags":["system"],"summary":"V1 Status","description":"Engine status under the /v1 envelope.","operationId":"v1_status_v1_system_status_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_StatusResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/system/refresh":{"post":{"tags":["system"],"summary":"V1 Refresh","description":"Full data refresh (dual-auth) under the /v1 envelope.","operationId":"v1_refresh_v1_system_refresh_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__schemas__envelope__Envelope_RefreshResponse___1"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/system/refresh/ui":{"post":{"tags":["system"],"summary":"V1 Api Refresh","description":"UI refresh button (JWT-only) under the /v1 envelope.","operationId":"v1_api_refresh_v1_system_refresh_ui_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__schemas__envelope__Envelope_RefreshResponse___1"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/system/ingest/hevy":{"post":{"tags":["system"],"summary":"V1 Ingest Hevy","description":"Delta-ingest ONLY the new tail of the user's Hevy workouts.\n\nThe cheap, focused alternative to the full /v1/system/refresh: it persists a\nnewly-completed workout into the SAME tables (`workouts`, `workout_sets`, plus\nthe lifting `activities.workout_type` correlation) using the SAME idempotent\nwriters, so `coach_facts.trained_today` and /v1/training reflect it immediately\n— without re-pulling every provider. Idempotent: a re-run with no new workout\nis a no-op (cursor unchanged).\n\nDual-auth (Supabase JWT or API_TOKEN), mirroring /v1/system/refresh. Hevy\ncredentials are read per-user from the vault, never from env.","operationId":"v1_ingest_hevy_v1_system_ingest_hevy_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_HevyIngestResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/labs":{"get":{"tags":["labs"],"summary":"V1 Labs","operationId":"v1_labs_v1_labs_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_LabsResponse_"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/training":{"get":{"tags":["training"],"summary":"V1 Training","operationId":"v1_training_v1_training_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_TrainingResponse_"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/overview":{"get":{"tags":["overview"],"summary":"V1 Overview","operationId":"v1_overview_v1_overview_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_OverviewResponse_"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/recovery":{"get":{"tags":["recovery"],"summary":"V1 Recovery","operationId":"v1_recovery_v1_recovery_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__schemas__envelope__Envelope_RecoveryResponse___1"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/body":{"get":{"tags":["body"],"summary":"V1 Body","operationId":"v1_body_v1_body_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__schemas__envelope__Envelope_BodyResponse___1"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/calendar":{"get":{"tags":["calendar"],"summary":"V1 Calendar","operationId":"v1_calendar_v1_calendar_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_CalendarResponse_"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/measurements":{"get":{"tags":["body"],"summary":"V1 Measurements","operationId":"v1_measurements_v1_measurements_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_MeasurementsResponse_"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/nutrition":{"get":{"tags":["nutrition"],"summary":"V1 Nutrition","operationId":"v1_nutrition_v1_nutrition_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_NutritionResponse_"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/labs/categories/{category_id}/interpretation":{"get":{"tags":["labs"],"summary":"V1 Lab Interpretation","operationId":"v1_lab_interpretation_v1_labs_categories__category_id__interpretation_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"category_id","in":"path","required":true,"schema":{"type":"string","title":"Category Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_LabInterpretationResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/nutrition/log":{"post":{"tags":["nutrition"],"summary":"V1 Nutrition Log","operationId":"v1_nutrition_log_v1_nutrition_log_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_NutritionLogResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/user-config":{"get":{"tags":["user-config"],"summary":"V1 Get User Config","operationId":"v1_get_user_config_v1_user_config_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_UserConfig_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["user-config"],"summary":"V1 Update User Config","operationId":"v1_update_user_config_v1_user_config_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ConfigUpdateResult_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/protocol-state":{"get":{"tags":["user-config"],"summary":"V1 Get Protocol State","operationId":"v1_get_protocol_state_v1_protocol_state_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ProtocolState_"}}}}},"security":[{"HTTPBearer":[]}]},"put":{"tags":["user-config"],"summary":"V1 Update Protocol State","operationId":"v1_update_protocol_state_v1_protocol_state_put","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ProtocolStateUpdateResult_"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/brief":{"get":{"tags":["overview"],"summary":"V1 Brief","description":"Morning briefing under the /v1 envelope (permissive — cron-written blob).","operationId":"v1_brief_v1_brief_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_BriefResponse_"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/brief/regenerate":{"post":{"tags":["overview"],"summary":"Regenerate Brief","description":"Regenerate ONLY the morning-brief narrative, on demand, off the hot path.\n\nOne Ollama call over whatever is ALREADY in the DB (the rows the last refresh\npersisted) — it does NOT sync providers or recompute fatigue/TDEE/ETL. UX-safe\nfail-close: the last-good brief is snapshotted first, so a failed/slow\ngeneration returns the PREVIOUS brief (state:'stale') and NEVER wipes it to\navailable:false or blocks. Guardrails: a per-user debounce, a per-user\nin-flight lock, and a material-change bypass (see BriefRegenerateResponse).\n\nDual-auth (JWT or API_TOKEN), tenant resolution mirrors POST\n/v1/system/ingest/hevy: a normal JWT caller regenerates ONLY its own brief;\nbody.user_id is honored solely for the service role. Deliberately stricter\nthan the Hevy path: there is NO SUPABASE_USER_ID env fallback here — an\nunresolved tenant is a 401 (never a silent write to the default tenant).","operationId":"regenerate_brief_v1_brief_regenerate_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BriefRegenerateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/health/body":{"get":{"tags":["body"],"summary":"V1 Health Body","operationId":"v1_health_body_v1_health_body_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":365,"minimum":1,"default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__schemas__envelope__Envelope_BodyResponse___2"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/health/recovery":{"get":{"tags":["recovery"],"summary":"V1 Health Recovery","operationId":"v1_health_recovery_v1_health_recovery_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":90,"minimum":1,"default":7,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__schemas__envelope__Envelope_RecoveryResponse___2"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/training/schedule":{"get":{"tags":["training"],"summary":"V1 Training Schedule","operationId":"v1_training_schedule_v1_training_schedule_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_TrainingScheduleResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/training/workouts":{"get":{"tags":["training"],"summary":"V1 Get Workouts","operationId":"v1_get_workouts_v1_training_workouts_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"pageSize","in":"query","required":false,"schema":{"type":"integer","maximum":20,"minimum":1,"default":10,"title":"Pagesize"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_WorkoutsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/training/activities":{"get":{"tags":["training"],"summary":"V1 Get Activities","operationId":"v1_get_activities_v1_training_activities_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":365,"minimum":1,"default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ActivitiesResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/training/recommendation":{"get":{"tags":["training"],"summary":"V1 Get Recommendation","operationId":"v1_get_recommendation_v1_training_recommendation_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_RecommendationResponse_"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/training/refresh":{"post":{"tags":["training"],"summary":"V1 Trigger Refresh","operationId":"v1_trigger_refresh_v1_training_refresh_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"force","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Force"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__schemas__envelope__Envelope_RefreshResponse___2"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/auth/refresh/{provider}":{"post":{"summary":"V1 Refresh Provider Token","description":"Refresh an OAuth provider token under the /v1 envelope.","operationId":"v1_refresh_provider_token_v1_auth_refresh__provider__post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string","pattern":"^(whoop|withings)$","title":"Provider"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_AuthRefreshResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/auth/connect/{provider}":{"post":{"tags":["system"],"summary":"V1 Connect Provider","description":"Mint a single-use link that re-authorizes `provider` in a browser.\n\nThis is the authenticated half of the flow. The returned `start_url` carries\na short-lived, single-use ticket bound to the caller's user_id, which is what\nlets the browser hit /start without an Authorization header while still\nbinding the resulting tokens to THIS user and no other.","operationId":"v1_connect_provider_v1_auth_connect__provider__post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string","pattern":"^(whoop|withings)$","title":"Provider"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_AuthConnectResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/auth/connect/{provider}/start":{"get":{"tags":["system"],"summary":"V1 Connect Start","description":"Consume the ticket and redirect the browser to the provider's authorize URL.\n\nDeliberately unauthenticated at the header level: the ticket IS the\ncredential. It is single-use, so this link cannot be replayed.","operationId":"v1_connect_start_v1_auth_connect__provider__start_get","parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string","pattern":"^(whoop|withings)$","title":"Provider"}},{"name":"ticket","in":"query","required":false,"schema":{"type":"string","description":"Single-use ticket from POST /v1/auth/connect/{provider}","default":"","title":"Ticket"},"description":"Single-use ticket from POST /v1/auth/connect/{provider}"}],"responses":{"307":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/auth/connect/{provider}/callback":{"head":{"tags":["system"],"summary":"V1 Connect Callback Probe","description":"Reachability probe for the provider's Registered URL. Runs no exchange logic.\n\nAnswers 200 with an empty body, needs no `code`/`state`, and touches neither\nthe state table nor the vault.","operationId":"v1_connect_callback_probe_v1_auth_connect__provider__callback_head","parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string","pattern":"^(whoop|withings)$","title":"Provider"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["system"],"summary":"V1 Connect Callback","description":"Exchange the authorization code and persist the tokens in the vault.\n\nThe `state` is the only thing that says which user this belongs to, so it is\nvalidated (existence, provider, kind, expiry, not-yet-consumed) before the\ncode is exchanged.","operationId":"v1_connect_callback_v1_auth_connect__provider__callback_get","parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string","pattern":"^(whoop|withings)$","title":"Provider"}},{"name":"code","in":"query","required":false,"schema":{"type":"string","description":"Authorization code returned by the provider","default":"","title":"Code"},"description":"Authorization code returned by the provider"},{"name":"state","in":"query","required":false,"schema":{"type":"string","description":"Single-use state minted at /start","default":"","title":"State"},"description":"Single-use state minted at /start"},{"name":"error","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Provider-side error, if the user declined","title":"Error"},"description":"Provider-side error, if the user declined"}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/admin/users/{user_id}/permissions":{"patch":{"tags":["admin"],"summary":"V1 Update User Permissions","operationId":"v1_update_user_permissions_v1_admin_users__user_id__permissions_patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PermissionUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_PermissionUpdateResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["admin"],"summary":"V1 Get User Permissions","operationId":"v1_get_user_permissions_v1_admin_users__user_id__permissions_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_PermissionUpdateResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/admin/doctors":{"get":{"tags":["admin"],"summary":"V1 List Doctors","description":"List every doctor (pending + active) for the approval screen. Admin-only.","operationId":"v1_list_doctors_v1_admin_doctors_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_AdminDoctorsResponse_"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/admin/doctors/{doctor_id}/cedula":{"patch":{"tags":["admin"],"summary":"V1 Update Doctor Cedula","description":"Set or correct a doctor's cedula and append its audit row atomically.\n\nThe database function owns both writes so an audit failure rolls back the\nidentity change instead of leaving an unaudited professional record.","operationId":"v1_update_doctor_cedula_v1_admin_doctors__doctor_id__cedula_patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"doctor_id","in":"path","required":true,"schema":{"type":"string","title":"Doctor Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminDoctorCedulaUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_AdminDoctorCedulaResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/admin/clinics":{"get":{"tags":["admin"],"summary":"V1 List Clinics","description":"List every clinic for the approval screen. Admin-only.","operationId":"v1_list_clinics_v1_admin_clinics_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_AdminClinicsResponse_"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/admin/leads":{"get":{"tags":["admin"],"summary":"V1 List Leads","description":"List every consult booking with acquisition + routing. Admin-only. Reads via the\nadmin_leads() SECURITY DEFINER function (the patient email lives in auth.users).","operationId":"v1_list_leads_v1_admin_leads_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_AdminLeadsResponse_"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/admin/patients":{"get":{"tags":["admin"],"summary":"V1 List Patients","description":"List every onboarded patient with goal, city, panel count + latest interpretation. Admin-only.\nReads via the admin_patients() SECURITY DEFINER function (the patient email lives in auth.users).","operationId":"v1_list_patients_v1_admin_patients_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_AdminPatientsResponse_"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/admin/patients/{user_id}/assign-doctor":{"post":{"tags":["admin"],"summary":"V1 Assign Doctor","description":"Assign (or re-assign) a patient to an ACTIVE doctor by upserting the booking link.\nCreates the row when missing — the orphan-patient case (intake without booking) that\ntwice required raw SQL. `acquired_by='admin'` only on insert: an existing acquisition\nsource is never clobbered. Emits `admin_doctor_assigned`.","operationId":"v1_assign_doctor_v1_admin_patients__user_id__assign_doctor_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignDoctorRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_AssignDoctorResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/admin/overview":{"get":{"tags":["admin"],"summary":"V1 Overview","description":"Aggregate counts across the funnel for the Resumen dashboard. Admin-only.","operationId":"v1_overview_v1_admin_overview_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_AdminOverview_"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/admin/waitlist":{"get":{"tags":["admin"],"summary":"V1 List Waitlist","description":"List every landing waitlist signup, newest first. Admin-only.","operationId":"v1_list_waitlist_v1_admin_waitlist_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_AdminWaitlistResponse_"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/admin/training/sync-profiles":{"post":{"tags":["admin"],"summary":"V1 Sync Training Profiles","description":"Trigger muscle-profile sync for all routines in a training block.\n\nFetches routines from Hevy API, computes muscle profiles, and upserts\nto `routine_profiles` only when the routine's exercise list has changed\n(hash comparison). With no `block_id` the sweep covers the block governing today\nAND the next prepared block (SPEC-035 FR-014), so a block prepared weeks ahead is\nnot profile-less on the day it takes over. An explicit `block_id` overrides the set.\n\nThe body is OPTIONAL (the nightly cron POSTs with no body at all);\na required body made the cron fail with 422 every night.\n\nAdmin-only. Returns summary: {updated, unchanged, errors}.","operationId":"v1_sync_training_profiles_v1_admin_training_sync_profiles_post","requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/SyncProfilesRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_SyncProfilesData_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/connected-accounts":{"get":{"tags":["system"],"summary":"V1 List Connected Accounts","description":"The authenticated user's connected third-party accounts (no secrets).","operationId":"v1_list_connected_accounts_v1_connected_accounts_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ConnectedAccountsResponse_"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/compounds":{"get":{"tags":["protocols"],"summary":"V1 List Compounds","description":"Full compounds catalog from public.compounds, ordered by name.\n\nGLOBAL read (not user-scoped): returns every compound row regardless of the\ncaller, gated only by the \"protocol\" permission. This is the catalog the\ncreate-protocol picker reads so a newly-seeded compound is selectable before\nany protocol references it — unlike GET /v1/protocols/compounds, which only\nsurfaces compounds in the caller's ACTIVE protocols.","operationId":"v1_list_compounds_v1_compounds_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_CompoundCatalogResponse_"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/compounds/{compound_id}":{"get":{"tags":["protocols"],"summary":"V1 Get Compound Detail","description":"Compound detail under the /v1 envelope (modeled as the handler emits).","operationId":"v1_get_compound_detail_v1_compounds__compound_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"compound_id","in":"path","required":true,"schema":{"type":"string","title":"Compound Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_CompoundDetailResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/compounds/{compound_id}/concentration":{"get":{"tags":["protocols"],"summary":"V1 Get Concentration","description":"Per-compound concentration curve under the /v1 envelope.","operationId":"v1_get_concentration_v1_compounds__compound_id__concentration_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"compound_id","in":"path","required":true,"schema":{"type":"string","title":"Compound Id"}},{"name":"resolution_minutes","in":"query","required":false,"schema":{"type":"integer","maximum":120,"minimum":15,"default":60,"title":"Resolution Minutes"}},{"name":"start","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ISO datetime, default 7 days ago","title":"Start"},"description":"ISO datetime, default 7 days ago"},{"name":"end","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ISO datetime, default now + 24h","title":"End"},"description":"ISO datetime, default now + 24h"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ConcentrationCurveResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/waitlist":{"post":{"tags":["waitlist","waitlist"],"summary":"Join Waitlist","operationId":"join_waitlist_v1_waitlist_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WaitlistRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_WaitlistAck_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/waitlist":{"post":{"tags":["waitlist"],"summary":"Join Waitlist Legacy","description":"Deprecated pre-/v1 alias. Remove once the landing posts to /v1/waitlist.","operationId":"join_waitlist_legacy_waitlist_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WaitlistRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Join Waitlist Legacy Waitlist Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"deprecated":true}},"/v1/onboarding/intake":{"post":{"tags":["intake","intake"],"summary":"Submit Intake","operationId":"submit_intake_v1_onboarding_intake_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntakeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_IntakeAck_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/onboarding/panel-recommendation":{"post":{"tags":["onboarding","onboarding"],"summary":"Panel Recommendation","operationId":"panel_recommendation_v1_onboarding_panel_recommendation_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_PanelRecoResponse_"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/onboarding/assigned-doctor":{"get":{"tags":["onboarding","onboarding"],"summary":"Assigned Doctor","description":"The doctor this patient is assigned to — explicit booking link first, then the intake\nreferral clinic_code. Lets \"Tu doctor\" show the assigned clinician BEFORE any panel is\nsigned. Returns assigned=false (200, not 404) when there is no match. Name + specialty +\ncedula are factual identity, not diagnostic claims (COFEPRIS-safe).","operationId":"assigned_doctor_v1_onboarding_assigned_doctor_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_AssignedDoctorResponse_"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/admin/panel-rules":{"post":{"tags":["onboarding","onboarding"],"summary":"Edit Panel Rules","description":"Upsert panel_rules rows — the live-edit path for the demo (admin only).","operationId":"edit_panel_rules_v1_admin_panel_rules_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PanelRulesEdit"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Edit Panel Rules V1 Admin Panel Rules Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/onboarding/booking-request":{"post":{"tags":["onboarding","onboarding"],"summary":"Booking Request","operationId":"booking_request_v1_onboarding_booking_request_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BookingRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_BookingAck_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/admin/clinic-roster":{"post":{"tags":["onboarding","onboarding"],"summary":"Edit Clinic Roster","description":"Upsert clinics + doctors so leads route to the referring doctor (admin only).","operationId":"edit_clinic_roster_v1_admin_clinic_roster_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClinicRosterEdit"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Edit Clinic Roster V1 Admin Clinic Roster Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/onboarding/doctor-apply":{"post":{"tags":["onboarding","onboarding"],"summary":"Doctor Apply","operationId":"doctor_apply_v1_onboarding_doctor_apply_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DoctorApply"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_DoctorApplyAck_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/admin/doctor-activate":{"post":{"tags":["onboarding","onboarding"],"summary":"Doctor Activate","description":"Approve or deactivate a doctor.\n\nOn approval (active=true) this provisions the doctor's portal login end to end:\nresolve/create their Supabase identity, bind auth_user_id, grant the 'doctor'\npermission, and email a sign-in link. Idempotent: a doctor already active AND bound\nis a no-op (no second email). Deactivation only flips the flag and keeps the binding.","operationId":"doctor_activate_v1_admin_doctor_activate_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DoctorActivate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_DoctorActivateResult_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/doctor/me":{"get":{"tags":["doctor"],"summary":"Doctor Me","description":"The calling doctor's own profile — name/cedula for display, referral_code for the\npatient-invite surface (app.claryshealth.com/start?dr=<referral_code>).","operationId":"doctor_me_v1_doctor_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_DoctorMeResponse_"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/doctor/patients":{"get":{"tags":["doctor"],"summary":"Doctor Patients","operationId":"doctor_patients_v1_doctor_patients_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_DoctorPatientsResponse_"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/doctor/pending-markers":{"get":{"tags":["doctor"],"summary":"Doctor Pending Markers","description":"One row per pending marker across ALL of the doctor's linked patients — the cross-patient\ntriage queue (Spec 026 FR-1/FR-2/FR-8). Batched queries (not the per-patient loop of\n`doctor_patients`), the entire historical backlog (no time window), keyset-paginated on\n`panel_date DESC, patient_id, result_id`. `meta.total_markers` / `meta.total_patients` are the\ncanonical counts after `patient_id` / `panel_id` / `flag` filters, but `result_id` is only an\naddressing filter for the returned page and never narrows those counts. No `pdf_url` in the\npayload — a signed PHI URL is minted on demand per panel by the existing panel-PDF route, never\nper row of a list.","operationId":"doctor_pending_markers_v1_doctor_pending_markers_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"patient_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Patient Id"}},{"name":"flag","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Flag"}},{"name":"panel_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Panel Id"}},{"name":"result_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Address one pending marker by lab_results.id for deep links. Intersected with the doctor's linked patients and pending set; unknown, foreign, and no-longer-pending ids return an empty page. This addressing filter does not narrow meta.total_markers or meta.total_patients.","title":"Result Id"},"description":"Address one pending marker by lab_results.id for deep links. Intersected with the doctor's linked patients and pending set; unknown, foreign, and no-longer-pending ids return an empty page. This addressing filter does not narrow meta.total_markers or meta.total_patients."},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_PendingMarkersResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/doctor/patients/{patient_id}/profile":{"get":{"tags":["doctor"],"summary":"Doctor Patient Profile","description":"Clinical context for the expediente header (spec 009 R5c): the patient's latest intake\nrow (protocol, goals, conditions, declared confounders, family history, age/sex). The\nauthorization boundary is the booking link — the patient chose this doctor at intake.\nNOTE: when the server-side art. 35 `share_with_doctor` consent gate lands (hub backlog\n§ 9b), this endpoint must honor the same gate.","operationId":"doctor_patient_profile_v1_doctor_patients__patient_id__profile_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"patient_id","in":"path","required":true,"schema":{"type":"string","title":"Patient Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_DoctorPatientProfile_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/doctor/patients/{patient_id}/labs":{"get":{"tags":["doctor"],"summary":"Doctor Patient Labs","operationId":"doctor_patient_labs_v1_doctor_patients__patient_id__labs_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"patient_id","in":"path","required":true,"schema":{"type":"string","title":"Patient Id"}},{"name":"panel_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Panel Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_LabsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/doctor/patients/{patient_id}/panels/{panel_id}/pdf":{"get":{"tags":["doctor"],"summary":"Doctor Panel Pdf","description":"A short-lived signed URL to the panel's source PDF, so the doctor can verify the extracted\nvalues against what's printed before confirming. Same authz boundary as the labs.","operationId":"doctor_panel_pdf_v1_doctor_patients__patient_id__panels__panel_id__pdf_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"patient_id","in":"path","required":true,"schema":{"type":"string","title":"Patient Id"}},{"name":"panel_id","in":"path","required":true,"schema":{"type":"string","title":"Panel Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_DoctorPanelPdfResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/doctor/patients/{patient_id}/markers/{result_id}/validate":{"post":{"tags":["doctor"],"summary":"Doctor Validate Marker","operationId":"doctor_validate_marker_v1_doctor_patients__patient_id__markers__result_id__validate_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"patient_id","in":"path","required":true,"schema":{"type":"string","title":"Patient Id"}},{"name":"result_id","in":"path","required":true,"schema":{"type":"string","title":"Result Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidateMarkerRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ValidateMarkerResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/doctor/patients/{patient_id}/markers/batch-validate":{"post":{"tags":["doctor"],"summary":"Doctor Batch Validate Markers","operationId":"doctor_batch_validate_markers_v1_doctor_patients__patient_id__markers_batch_validate_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"patient_id","in":"path","required":true,"schema":{"type":"string","title":"Patient Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchValidateMarkersRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_BatchValidateMarkersResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/doctor/patients/{patient_id}/markers/{result_id}/unconfirm":{"post":{"tags":["doctor"],"summary":"Doctor Unconfirm Marker","operationId":"doctor_unconfirm_marker_v1_doctor_patients__patient_id__markers__result_id__unconfirm_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"patient_id","in":"path","required":true,"schema":{"type":"string","title":"Patient Id"}},{"name":"result_id","in":"path","required":true,"schema":{"type":"string","title":"Result Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnconfirmMarkerRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ValidateMarkerResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/doctor/patients/{patient_id}/panels/{panel_id}/insight":{"get":{"tags":["doctor"],"summary":"Doctor Get Insight","description":"DB read only — never schedules an LLM call. Read-back survives unlink for the signing doctor.","operationId":"doctor_get_insight_v1_doctor_patients__patient_id__panels__panel_id__insight_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"patient_id","in":"path","required":true,"schema":{"type":"string","title":"Patient Id"}},{"name":"panel_id","in":"path","required":true,"schema":{"type":"string","title":"Panel Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_MasterInsightDraft_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["doctor"],"summary":"Doctor Patch Insight","description":"Per-section inline edit (zero LLM). content_original is never touched; returns the new\ncontent_hash so the client always signs exactly what it shows.","operationId":"doctor_patch_insight_v1_doctor_patients__patient_id__panels__panel_id__insight_patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"patient_id","in":"path","required":true,"schema":{"type":"string","title":"Patient Id"}},{"name":"panel_id","in":"path","required":true,"schema":{"type":"string","title":"Panel Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MasterInsightSectionPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_MasterInsightDraft_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/doctor/patients/{patient_id}/panels/{panel_id}/insight/generate":{"post":{"tags":["doctor"],"summary":"Doctor Generate Insight","description":"Explicit (re)generate / self-heal / stale-lease reclaim. One LLM call max; 409 if approved or\nthe panel is not fully reviewed. A write — requires CURRENT linkage.","operationId":"doctor_generate_insight_v1_doctor_patients__patient_id__panels__panel_id__insight_generate_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"patient_id","in":"path","required":true,"schema":{"type":"string","title":"Patient Id"}},{"name":"panel_id","in":"path","required":true,"schema":{"type":"string","title":"Panel Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_MasterInsightDraft_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/doctor/patients/{patient_id}/panels/{panel_id}/insight/approve":{"post":{"tags":["doctor"],"summary":"Doctor Approve Insight","description":"Sign the draft. Optimistic `content_hash` (409 on drift); signer stamped server-side; linkage\nre-checked here; the row is frozen by the DB trigger once approved. API_TOKEN/admin (no\nclarys_doctor profile) is rejected by `_my_doctor` — a real doctor must sign.","operationId":"doctor_approve_insight_v1_doctor_patients__patient_id__panels__panel_id__insight_approve_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"patient_id","in":"path","required":true,"schema":{"type":"string","title":"Patient Id"}},{"name":"panel_id","in":"path","required":true,"schema":{"type":"string","title":"Panel Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApproveInsightRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_MasterInsightDraft_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/doctor/patients/{patient_id}/panels/{panel_id}/insight/request-changes":{"post":{"tags":["doctor"],"summary":"Doctor Request Changes","description":"Reopen a draft for inline edits (zero LLM).","operationId":"doctor_request_changes_v1_doctor_patients__patient_id__panels__panel_id__insight_request_changes_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"patient_id","in":"path","required":true,"schema":{"type":"string","title":"Patient Id"}},{"name":"panel_id","in":"path","required":true,"schema":{"type":"string","title":"Panel Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestChangesRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_MasterInsightDraft_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/reports/{panel_id}":{"get":{"tags":["reports"],"summary":"Get Report","description":"The report artifact for one of the caller's own panels. 404 when the panel does not\nbelong to the caller. The tier (free by default) decides which sections are unlocked.","operationId":"get_report_v1_reports__panel_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"panel_id","in":"path","required":true,"schema":{"type":"string","title":"Panel Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ReportArtifact_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/reports/{panel_id}/pdf":{"get":{"tags":["reports"],"summary":"Get Report Pdf","description":"Server-generated, brand-faithful PDF of the caller's report (spec 006 PDF export).\n\nGated to PAID tiers OR a doctor-signed report (same gate as the share link): the PDF is the\ntangible $199 artifact and free tier has no export (spec.md tier matrix). 403 otherwise, 404\nwhen the panel is not the caller's. The artifact is persisted per analysis version and only\nregenerated on a new version (immutability).\n\nRate-limited per IP: a fresh render is a CPU-heavy WeasyPrint rasterization, and the per-version\ncache is bypassed while the analysis has no version yet (signature_state='pending'), so an\nauthenticated caller could otherwise hammer the renderer.","operationId":"get_report_pdf_v1_reports__panel_id__pdf_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"panel_id","in":"path","required":true,"schema":{"type":"string","title":"Panel Id"}}],"responses":{"200":{"description":"Report PDF","content":{"application/json":{"schema":{}},"application/pdf":{}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/reports/{panel_id}/share":{"post":{"tags":["reports"],"summary":"Create Share","description":"Mint a revocable read-only link for the caller's panel, or report that one is already active.\n\nGated to PAID tiers OR a doctor-signed report: a share link renders the full artifact, so\nallowing it on the free tier would leak content the owner did not pay for. 403 otherwise.\n\nStill idempotent in the sense that matters -- one active link per panel, a second POST never\nmints a second row and never invalidates the first -- but it can no longer HAND BACK an\nalready-active link: only the digest is stored, so there is nothing to re-display. That case\nreturns `state=\"existing\"` with `token` and `url` set to NULL (not \"\"); the owner revokes to\nmint a fresh one. The link is therefore shown exactly once, when it is created, in the single\nresponse carrying `state=\"created\"`.\n\nLinks expire after SHARE_TTL_DAYS by default. Pass `never_expires` for one that must not.","operationId":"create_share_v1_reports__panel_id__share_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"panel_id","in":"path","required":true,"schema":{"type":"string","title":"Panel Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ShareCreateRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ShareLink_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["reports"],"summary":"Revoke Share","description":"Revoke the active link for the caller's panel (soft delete; the link 410s afterward).\nIdempotent: revoking when there is no active link returns a revoked marker, not an error.","operationId":"revoke_share_v1_reports__panel_id__share_delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"panel_id","in":"path","required":true,"schema":{"type":"string","title":"Panel Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_ShareLink_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/reports/shared/{token}":{"get":{"tags":["reports"],"summary":"Get Shared Report","description":"Public, unauthenticated, read-only render of a shared report. Renders the OWNER's report\n(never the viewer's identity — there is none). 404 for an unknown token, 410 for a link that\nno longer works. `noindex` so the link never enters a search index. Doubles as the no-account\ndoctor view (backlog 7a).\n\nThe token is looked up by DIGEST: the table stores sha256(token), so the incoming token is\nhashed here before the comparison. A link that predates the hashing migration resolves the\nsame way -- the migration stored the digest of the token already in circulation.\n\nA revoked link and an expired one are the SAME 410 with the same detail: which of the two\nkilled it is the owner's business, not the holder's. A share link still keeps rendering if the\nowner later downgrades from a paid tier (the content was paid for when minted); it stops at\nrevoke or at `expires_at`. Throttled by IP: it is unauthenticated and each call fans out to\nseveral DB reads.","operationId":"get_shared_report_v1_reports_shared__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/Envelope_ReportArtifact_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/admin/events":{"get":{"tags":["telemetry"],"summary":"List Events","description":"Newest-first business events with optional exact-match filters.","operationId":"list_events_v1_admin_events_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"kind","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}],"title":"Kind"}},{"name":"email","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":320},{"type":"null"}],"title":"Email"}},{"name":"user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"User Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_EventsListData_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/market-intel/report":{"get":{"tags":["market-intel"],"summary":"Get Report","description":"Monthly market-intel report for one drug class. Doctor-gated. The\nregulatory allowlist is enforced during assembly (a disabled tier never\nserializes), so this endpoint cannot leak a controlled-substance price.","operationId":"get_report_v1_market_intel_report_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"month","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-(?:0[1-9]|1[0-2])$","description":"YYYY-MM","title":"Month"},"description":"YYYY-MM"},{"name":"class","in":"query","required":false,"schema":{"type":"string","default":"glp1","title":"Class"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_MarketIntelReport_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/market-intel/admin/price-observation":{"post":{"tags":["market-intel"],"summary":"Create Price Observation","description":"Append one observed price. Admin-only. This is the /v1 write surface the\ncapture script (spec 016) reuses. No scraper runs in-process.","operationId":"create_price_observation_v1_market_intel_admin_price_observation_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceObservationCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_PriceObservationResult_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/market-intel/admin/catalog":{"get":{"tags":["market-intel"],"summary":"Get Catalog","description":"The editable catalog (slugs the capture surface references). Admin-only.","operationId":"get_catalog_v1_market_intel_admin_catalog_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_CatalogResponse_"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/market-intel/admin/allowed-tiers":{"get":{"tags":["market-intel"],"summary":"Get Allowed Tiers","description":"Read-only view of the regulatory gate. Enabling a tier is a deliberate\nmigration-only act in v1 (NOT an API mutation), so a controlled class\ncannot be opened by a stray request.","operationId":"get_allowed_tiers_v1_market_intel_admin_allowed_tiers_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope_AllowedTiersResponse_"}}}}},"security":[{"HTTPBearer":[]}]}}},"components":{"schemas":{"ActivitiesResponse":{"properties":{"activities":{"items":{"$ref":"#/components/schemas/TrainingActivity"},"type":"array","title":"Activities"},"filtered_count":{"type":"integer","title":"Filtered Count"},"total_count":{"type":"integer","title":"Total Count"},"merged_count":{"type":"integer","title":"Merged Count"}},"type":"object","required":["activities","filtered_count","total_count","merged_count"],"title":"ActivitiesResponse"},"AdherenceResponse":{"properties":{"compounds":{"items":{"$ref":"#/components/schemas/AdherenceStats"},"type":"array","title":"Compounds"},"global":{"$ref":"#/components/schemas/GlobalAdherenceStats"},"window":{"$ref":"#/components/schemas/AdherenceWindow"},"generated_at":{"type":"string","title":"Generated At"}},"type":"object","required":["compounds","global","window","generated_at"],"title":"AdherenceResponse"},"AdherenceStats":{"properties":{"compound_id":{"type":"string","title":"Compound Id"},"on_time":{"type":"integer","title":"On Time"},"late":{"type":"integer","title":"Late"},"missed":{"type":"integer","title":"Missed"},"expected":{"type":"integer","title":"Expected"},"pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Pct","description":"Adherence percentage over the window: (on_time + late) / expected * 100. Late doses count as adherent; only missed doses lower this number. Null when expected is zero."}},"type":"object","required":["compound_id","on_time","late","missed","expected"],"title":"AdherenceStats"},"AdherenceWindow":{"properties":{"start":{"type":"string","title":"Start"},"end":{"type":"string","title":"End"},"days":{"type":"integer","title":"Days"}},"type":"object","required":["start","end","days"],"title":"AdherenceWindow"},"AdminClinic":{"properties":{"id":{"type":"string","title":"Id"},"slug":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Slug"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"active":{"type":"boolean","title":"Active","default":false}},"type":"object","required":["id"],"title":"AdminClinic"},"AdminClinicsResponse":{"properties":{"clinics":{"items":{"$ref":"#/components/schemas/AdminClinic"},"type":"array","title":"Clinics"}},"type":"object","required":["clinics"],"title":"AdminClinicsResponse"},"AdminDoctor":{"properties":{"id":{"type":"string","title":"Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"cedula":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cedula"},"cedula_claimed":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cedula Claimed"},"referral_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Referral Code"},"notify_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notify Email"},"active":{"type":"boolean","title":"Active","default":false},"clinic_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Clinic Id"},"clinic_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Clinic Name"},"linked":{"type":"boolean","title":"Linked","default":false}},"type":"object","required":["id"],"title":"AdminDoctor"},"AdminDoctorCedulaResponse":{"properties":{"doctor_id":{"type":"string","title":"Doctor Id"},"cedula":{"type":"string","title":"Cedula"}},"type":"object","required":["doctor_id","cedula"],"title":"AdminDoctorCedulaResponse"},"AdminDoctorCedulaUpdate":{"properties":{"cedula":{"type":"string","maxLength":40,"minLength":1,"pattern":"^[0-9]+$","title":"Cedula","description":"Numeric cedula format only; this does not verify issuance or ownership with Mexico's Registro Nacional de Profesionistas."}},"type":"object","required":["cedula"],"title":"AdminDoctorCedulaUpdate","description":"A cedula number in its local numeric representation.\n\nThis validates syntax only. It does not establish that SEP issued the\nnumber or that it belongs to the doctor."},"AdminDoctorsResponse":{"properties":{"doctors":{"items":{"$ref":"#/components/schemas/AdminDoctor"},"type":"array","title":"Doctors"}},"type":"object","required":["doctors"],"title":"AdminDoctorsResponse"},"AdminLead":{"properties":{"id":{"type":"string","title":"Id"},"patient_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Patient Email"},"patient_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Patient Name"},"acquired_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Acquired By"},"clinic_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Clinic Code"},"doctor_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Doctor Name"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["id"],"title":"AdminLead"},"AdminLeadsResponse":{"properties":{"leads":{"items":{"$ref":"#/components/schemas/AdminLead"},"type":"array","title":"Leads"}},"type":"object","required":["leads"],"title":"AdminLeadsResponse"},"AdminOverview":{"properties":{"patients":{"type":"integer","title":"Patients","default":0},"panels":{"type":"integer","title":"Panels","default":0},"leads_total":{"type":"integer","title":"Leads Total","default":0},"leads_forward":{"type":"integer","title":"Leads Forward","default":0},"leads_reverse":{"type":"integer","title":"Leads Reverse","default":0},"doctors_active":{"type":"integer","title":"Doctors Active","default":0},"doctors_pending":{"type":"integer","title":"Doctors Pending","default":0},"clinics":{"type":"integer","title":"Clinics","default":0},"waitlist":{"type":"integer","title":"Waitlist","default":0},"patients_no_doctor":{"type":"integer","title":"Patients No Doctor","default":0}},"type":"object","title":"AdminOverview"},"AdminPatient":{"properties":{"user_id":{"type":"string","title":"User Id"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"},"goals":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Goals"},"city":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"City"},"panels":{"type":"integer","title":"Panels","default":0},"latest_insight_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Latest Insight Status"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"doctor_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Doctor Id"},"doctor_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Doctor Name"},"has_booking":{"type":"boolean","title":"Has Booking","default":false}},"type":"object","required":["user_id"],"title":"AdminPatient"},"AdminPatientsResponse":{"properties":{"patients":{"items":{"$ref":"#/components/schemas/AdminPatient"},"type":"array","title":"Patients"}},"type":"object","required":["patients"],"title":"AdminPatientsResponse"},"AdminWaitlistEntry":{"properties":{"id":{"type":"string","title":"Id"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["id"],"title":"AdminWaitlistEntry"},"AdminWaitlistResponse":{"properties":{"entries":{"items":{"$ref":"#/components/schemas/AdminWaitlistEntry"},"type":"array","title":"Entries"}},"type":"object","required":["entries"],"title":"AdminWaitlistResponse"},"AlertRow":{"properties":{"titulo":{"type":"string","title":"Titulo"},"scope":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scope"},"ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ref"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"}},"type":"object","required":["titulo"],"title":"AlertRow"},"AllowedTier":{"properties":{"tier":{"type":"string","title":"Tier"},"enabled":{"type":"boolean","title":"Enabled","default":false}},"type":"object","required":["tier"],"title":"AllowedTier"},"AllowedTiersResponse":{"properties":{"tiers":{"items":{"$ref":"#/components/schemas/AllowedTier"},"type":"array","title":"Tiers","default":[]}},"type":"object","title":"AllowedTiersResponse"},"ApiStatus":{"properties":{"whoop":{"type":"boolean","title":"Whoop"},"hevy":{"type":"boolean","title":"Hevy"},"withings":{"type":"boolean","title":"Withings"},"supabase":{"type":"boolean","title":"Supabase"}},"type":"object","required":["whoop","hevy","withings","supabase"],"title":"ApiStatus"},"ApproveInsightRequest":{"properties":{"content_hash":{"type":"string","title":"Content Hash"},"justification":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Justification"}},"type":"object","required":["content_hash"],"title":"ApproveInsightRequest"},"AssignDoctorRequest":{"properties":{"doctor_id":{"type":"string","maxLength":64,"minLength":1,"title":"Doctor Id"}},"type":"object","required":["doctor_id"],"title":"AssignDoctorRequest"},"AssignDoctorResponse":{"properties":{"user_id":{"type":"string","title":"User Id"},"doctor_id":{"type":"string","title":"Doctor Id"},"doctor_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Doctor Name"},"created":{"type":"boolean","title":"Created"}},"type":"object","required":["user_id","doctor_id","created"],"title":"AssignDoctorResponse"},"AssignedDoctorResponse":{"properties":{"assigned":{"type":"boolean","title":"Assigned"},"doctor_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Doctor Name"},"specialty":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Specialty"},"cedula":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cedula"}},"type":"object","required":["assigned"],"title":"AssignedDoctorResponse","description":"The patient's assigned doctor, for the patient UI. Non-sensitive fields only —\nnever the doctor's notify_email / clinic_id / internal id."},"AuthConnectResponse":{"properties":{"provider":{"type":"string","title":"Provider"},"start_url":{"type":"string","title":"Start Url"},"expires_at":{"type":"string","title":"Expires At"},"scopes":{"items":{"type":"string"},"type":"array","title":"Scopes"},"redirect_uri":{"type":"string","title":"Redirect Uri"}},"type":"object","required":["provider","start_url","expires_at","scopes","redirect_uri"],"title":"AuthConnectResponse","description":"A minted re-auth link. Carries no token and no long-lived secret."},"AuthRefreshResponse":{"properties":{"provider":{"type":"string","title":"Provider"},"refreshed_at":{"type":"string","title":"Refreshed At"},"expires_in":{"type":"integer","title":"Expires In"}},"type":"object","required":["provider","refreshed_at","expires_in"],"title":"AuthRefreshResponse"},"BatchValidateMarkerItem":{"properties":{"value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Value"},"unit":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Unit"},"value_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Value Text"},"value_qualifier":{"anyOf":[{"type":"string","enum":["lt","lte","gt","gte",""]},{"type":"null"}],"title":"Value Qualifier"},"result_id":{"type":"string","title":"Result Id"},"prior":{"anyOf":[{"$ref":"#/components/schemas/MarkerPriorState"},{"type":"null"}]}},"type":"object","required":["result_id"],"title":"BatchValidateMarkerItem"},"BatchValidateMarkerResult":{"properties":{"result_id":{"type":"string","title":"Result Id"},"ok":{"type":"boolean","title":"Ok"},"status_code":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Status Code"},"detail":{"anyOf":[{},{"type":"null"}],"title":"Detail"},"marker":{"anyOf":[{"$ref":"#/components/schemas/ValidateMarkerResponse"},{"type":"null"}]}},"type":"object","required":["result_id","ok"],"title":"BatchValidateMarkerResult"},"BatchValidateMarkersRequest":{"properties":{"markers":{"items":{"$ref":"#/components/schemas/BatchValidateMarkerItem"},"type":"array","minItems":1,"title":"Markers"}},"type":"object","title":"BatchValidateMarkersRequest"},"BatchValidateMarkersResponse":{"properties":{"results":{"items":{"$ref":"#/components/schemas/BatchValidateMarkerResult"},"type":"array","title":"Results"}},"type":"object","required":["results"],"title":"BatchValidateMarkersResponse"},"BodyCurrent":{"properties":{"weight_kg":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Weight Kg"},"fat_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Fat Pct"},"muscle_kg":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Muscle Kg"}},"type":"object","title":"BodyCurrent"},"BodyMeasurement":{"properties":{"date":{"type":"string","title":"Date"},"weight_kg":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Weight Kg"},"fat_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Fat Pct"},"fat_mass_kg":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Fat Mass Kg"},"lean_mass_kg":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Lean Mass Kg"},"muscle_kg":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Muscle Kg"},"hydration_kg":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Hydration Kg"},"bone_kg":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Bone Kg"},"outlier":{"type":"boolean","title":"Outlier","default":false}},"type":"object","required":["date"],"title":"BodyMeasurement"},"BodyTrendPoint":{"properties":{"date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date"},"weight_kg":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Weight Kg"},"fat_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Fat Pct"},"muscle_kg":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Muscle Kg"}},"type":"object","title":"BodyTrendPoint"},"Body_v1_upload_lab_pdf_v1_labs_uploads_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"},"fasting":{"type":"string","title":"Fasting","default":"unknown"}},"type":"object","required":["file"],"title":"Body_v1_upload_lab_pdf_v1_labs_uploads_post"},"BookingAck":{"properties":{"status":{"type":"string","title":"Status","default":"ok"}},"type":"object","title":"BookingAck"},"BookingRequest":{"properties":{"phone":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Phone"},"contact_pref":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}],"title":"Contact Pref"},"note":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Note"}},"type":"object","title":"BookingRequest"},"BrandBrief":{"properties":{"slug":{"type":"string","title":"Slug"},"name":{"type":"string","title":"Name"},"is_generic":{"type":"boolean","title":"Is Generic","default":false},"indication_scope":{"type":"string","title":"Indication Scope","default":"approved"}},"type":"object","required":["slug","name"],"title":"BrandBrief"},"BriefRegenerateResponse":{"properties":{"state":{"type":"string","enum":["fresh","regenerating","stale","debounced"],"title":"State"},"generated_at":{"type":"string","title":"Generated At"},"material_change":{"type":"boolean","title":"Material Change"},"brief":{"additionalProperties":true,"type":"object","title":"Brief"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"additionalProperties":true,"type":"object","required":["state","generated_at","material_change","brief"],"title":"BriefRegenerateResponse","description":"POST /v1/brief/regenerate contract (the frontend builds against this shape).\n\n`state`:\n  - `fresh`        — just regenerated OK; `brief` is the new one.\n  - `regenerating` — an in-flight regen for this user was already running; `brief` is current.\n  - `stale`        — the Ollama call failed/timed out; `brief` is the PREVIOUS good one\n                     (NEVER wiped to available:false, NEVER blocked).\n  - `debounced`    — within the debounce window with no material change; `brief` is current.\n\n`brief` is the same permissive blob GET /v1/brief serves. `reason` is present only when\nthe state carries an explanation."},"BriefResponse":{"properties":{"available":{"type":"boolean","title":"Available","default":true}},"additionalProperties":true,"type":"object","title":"BriefResponse"},"CalendarEvent":{"properties":{"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"start_time":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Time"},"end_time":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Time"},"location":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Location"},"all_day":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"All Day"}},"additionalProperties":true,"type":"object","title":"CalendarEvent"},"CalendarResponse":{"properties":{"today":{"items":{"$ref":"#/components/schemas/CalendarEvent"},"type":"array","title":"Today"},"tomorrow":{"items":{"$ref":"#/components/schemas/CalendarEvent"},"type":"array","title":"Tomorrow"},"week":{"items":{"$ref":"#/components/schemas/CalendarEvent"},"type":"array","title":"Week"},"generated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Generated At"},"data_age_hours":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Data Age Hours"}},"additionalProperties":true,"type":"object","required":["today","tomorrow","week"],"title":"CalendarResponse"},"CancelPauseResponse":{"properties":{"protocol_id":{"type":"string","title":"Protocol Id"},"status":{"type":"string","title":"Status"},"cancelled":{"type":"boolean","title":"Cancelled"},"generated_at":{"type":"string","title":"Generated At"}},"type":"object","required":["protocol_id","status","cancelled","generated_at"],"title":"CancelPauseResponse"},"CardioLastSession":{"properties":{"date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date"},"sport":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sport"},"duration_min":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Duration Min"},"cardio_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cardio Type"},"strain":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Strain"},"days_since":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Days Since"}},"additionalProperties":false,"type":"object","title":"CardioLastSession"},"CatalogMarkerAlias":{"properties":{"alias":{"type":"string","title":"Alias","description":"The alias string"},"locale":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Locale","description":"Locale/language code for the alias","default":"es"}},"type":"object","required":["alias"],"title":"CatalogMarkerAlias","description":"Alias entry for a marker in the catalog.\n\nAttributes:\n    alias: The alias string (e.g., 'glucosa' for Glucose)\n    locale: Locale/language code for the alias (default: 'es' for Spanish)"},"CatalogMarkerItem":{"properties":{"id":{"type":"string","title":"Id","description":"Unique canonical marker ID"},"canonical_name":{"type":"string","title":"Canonical Name","description":"Standard name for the marker"},"aliases":{"items":{"$ref":"#/components/schemas/CatalogMarkerAlias"},"type":"array","title":"Aliases","description":"List of known aliases for the marker"},"category":{"type":"string","title":"Category","description":"Category the marker belongs to"},"unit":{"type":"string","title":"Unit","description":"Default unit of measurement"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Optional description of the marker"},"common_names":{"items":{"type":"string"},"type":"array","title":"Common Names","description":"List of common names/colloquial terms"}},"type":"object","required":["id","canonical_name","aliases","category","unit"],"title":"CatalogMarkerItem","description":"Single marker item in the catalog.\n\nAttributes:\n    id: Unique canonical marker ID\n    canonical_name: Standard name for the marker\n    aliases: List of known aliases for the marker\n    category: Category the marker belongs to\n    unit: Default unit of measurement\n    description: Optional description of the marker\n    common_names: List of common names/colloquial terms"},"CatalogResponse":{"properties":{"molecules":{"items":{"$ref":"#/components/schemas/MoleculeBrief"},"type":"array","title":"Molecules","default":[]},"brands":{"items":{"$ref":"#/components/schemas/BrandBrief"},"type":"array","title":"Brands","default":[]},"presentations":{"items":{"$ref":"#/components/schemas/PresentationBrief"},"type":"array","title":"Presentations","default":[]},"dose_options":{"items":{"$ref":"#/components/schemas/DoseOptionBrief"},"type":"array","title":"Dose Options","default":[]},"sources":{"items":{"$ref":"#/components/schemas/SourceBrief"},"type":"array","title":"Sources","default":[]}},"type":"object","title":"CatalogResponse"},"ClinicIn":{"properties":{"slug":{"type":"string","title":"Slug"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"active":{"type":"boolean","title":"Active","default":true}},"type":"object","required":["slug"],"title":"ClinicIn"},"ClinicRosterEdit":{"properties":{"clinics":{"items":{"$ref":"#/components/schemas/ClinicIn"},"type":"array","title":"Clinics","default":[]},"doctors":{"items":{"$ref":"#/components/schemas/DoctorIn"},"type":"array","title":"Doctors","default":[]}},"type":"object","title":"ClinicRosterEdit"},"CoachFacts":{"properties":{"doses_due_total":{"type":"integer","title":"Doses Due Total","default":0},"doses_remaining":{"type":"integer","title":"Doses Remaining","default":0},"doses_taken":{"type":"integer","title":"Doses Taken","default":0},"trained_today":{"type":"boolean","title":"Trained Today","default":false},"workout_type_today":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workout Type Today"},"latest_weight":{"anyOf":[{"$ref":"#/components/schemas/CoachFactsLatestWeight"},{"type":"null"}]},"nutrition":{"anyOf":[{"$ref":"#/components/schemas/CoachFactsNutrition"},{"type":"null"}]},"data_age":{"$ref":"#/components/schemas/CoachFactsDataAge"}},"additionalProperties":true,"type":"object","required":["data_age"],"title":"CoachFacts"},"CoachFactsDataAge":{"properties":{"recovery":{"anyOf":[{"$ref":"#/components/schemas/CoachFactsDataAgeEntry"},{"type":"null"}]},"sleep":{"anyOf":[{"$ref":"#/components/schemas/CoachFactsDataAgeEntry"},{"type":"null"}]},"training":{"anyOf":[{"$ref":"#/components/schemas/CoachFactsDataAgeEntry"},{"type":"null"}]},"body":{"anyOf":[{"$ref":"#/components/schemas/CoachFactsDataAgeEntry"},{"type":"null"}]},"nutrition":{"anyOf":[{"$ref":"#/components/schemas/CoachFactsDataAgeEntry"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"CoachFactsDataAge"},"CoachFactsDataAgeEntry":{"properties":{"date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date"},"start_time":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Time"},"age_hours":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Age Hours"}},"additionalProperties":true,"type":"object","title":"CoachFactsDataAgeEntry"},"CoachFactsLatestWeight":{"properties":{"value_kg":{"type":"number","title":"Value Kg"},"date":{"type":"string","title":"Date"}},"additionalProperties":true,"type":"object","required":["value_kg","date"],"title":"CoachFactsLatestWeight"},"CoachFactsNutrition":{"properties":{"kcal_target":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Kcal Target"},"kcal_consumed":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Kcal Consumed"},"kcal_remaining":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Kcal Remaining"},"protein_g_target":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Protein G Target"}},"additionalProperties":true,"type":"object","title":"CoachFactsNutrition"},"ComparativaMarker":{"properties":{"marker_id":{"type":"string","title":"Marker Id"},"name":{"type":"string","title":"Name"},"unit":{"type":"string","title":"Unit","default":""},"prior_value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Prior Value"},"current_value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Current Value"},"delta_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Delta Pct"},"beyond_rcv":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Beyond Rcv"},"narrative":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Narrative"}},"type":"object","required":["marker_id","name"],"title":"ComparativaMarker","description":"One marker compared against the most recent comparable prior panel. Deltas are computed\nin Python (the LLM never calculates). `narrative` is template-generated and RCV-gated:\nbelow RCV it is the neutral 'estable / dentro de variacion esperada' line and trajectory\nlanguage is forbidden; `beyond_rcv` is None when the marker has no RCV (values-only)."},"ComparativaSection":{"properties":{"available":{"type":"boolean","title":"Available","default":false},"locked":{"type":"boolean","title":"Locked","default":false},"count":{"type":"integer","title":"Count","default":0},"prior_panel_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prior Panel Date"},"markers":{"items":{"$ref":"#/components/schemas/ComparativaMarker"},"type":"array","title":"Markers","default":[]}},"type":"object","title":"ComparativaSection","description":"Two-panel comparativa (in $199). `available` is False when there is no comparable prior\npanel. When available and the tier is free: locked=True, count set, markers=[]."},"Compound":{"properties":{"compound_id":{"type":"string","title":"Compound Id"},"name":{"type":"string","title":"Name"},"class":{"type":"string","title":"Class"},"category":{"type":"string","title":"Category"},"route_type":{"type":"string","enum":["subcutaneous","intramuscular","oral","topical","intranasal"],"title":"Route Type"},"dose_unit":{"type":"string","title":"Dose Unit"},"typical_dose_min":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Typical Dose Min"},"typical_dose_max":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Typical Dose Max"},"typical_frequency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Typical Frequency"},"requires_reconstitution":{"type":"boolean","title":"Requires Reconstitution","default":false},"default_cycle_weeks":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Default Cycle Weeks"},"default_cycle_on_weeks":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Default Cycle On Weeks"},"default_cycle_off_weeks":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Default Cycle Off Weeks"}},"type":"object","required":["compound_id","name","class","category","route_type","dose_unit"],"title":"Compound"},"CompoundCatalogResponse":{"properties":{"compounds":{"items":{"$ref":"#/components/schemas/Compound"},"type":"array","title":"Compounds"}},"type":"object","required":["compounds"],"title":"CompoundCatalogResponse"},"CompoundDetailResponse":{"properties":{"compound_id":{"type":"string","title":"Compound Id"},"name":{"type":"string","title":"Name"},"compound_class":{"type":"string","title":"Compound Class"},"route_type":{"type":"string","title":"Route Type"},"t_half_hours":{"type":"number","title":"T Half Hours"},"pk_model":{"type":"string","title":"Pk Model"},"dose_unit":{"type":"string","title":"Dose Unit"},"category":{"type":"string","title":"Category"},"pk_data_available":{"type":"boolean","title":"Pk Data Available"},"t_half_confidence":{"type":"string","title":"T Half Confidence"},"bioavailability_note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bioavailability Note"},"t_half_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"T Half Source"},"warnings":{"items":{"type":"string"},"type":"array","title":"Warnings"}},"type":"object","required":["compound_id","name","compound_class","route_type","t_half_hours","pk_model","dose_unit","category","pk_data_available","t_half_confidence","warnings"],"title":"CompoundDetailResponse"},"CompoundWithConcentration":{"properties":{"compound_id":{"type":"string","title":"Compound Id"},"name":{"type":"string","title":"Name"},"class":{"type":"string","title":"Class"},"category":{"type":"string","title":"Category"},"route_type":{"anyOf":[{"type":"string","enum":["subcutaneous","intramuscular","oral","topical","intranasal"]},{"type":"null"}],"title":"Route Type"},"dose_amount":{"type":"number","title":"Dose Amount"},"dose_unit":{"type":"string","title":"Dose Unit"},"frequency":{"type":"string","title":"Frequency"},"scheduled_time":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scheduled Time"},"status":{"type":"string","title":"Status"},"current_concentration_pct":{"type":"number","title":"Current Concentration Pct"},"concentration_confidence":{"items":{"type":"number"},"type":"array","title":"Concentration Confidence"},"remaining_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Remaining Pct","description":"Percent of the MOST RECENT dose still in circulation, on the serum half-life: 100*2^(-(now-last_dose_at)/t_half_serum), clamped 0..100. Single most recent dose only (not summed accumulation). Null when there is no dose history. Distinct from current_concentration_pct, which is the chart shape (% of single-dose peak)."},"active_remaining_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Active Remaining Pct","description":"Percent of the most recent dose's biological EFFECT still present, on the effect horizon: 100*2^(-(now-last_dose_at)/t_effect_hours), clamped 0..100. Null when t_effect_hours is null or there is no dose history. Present != fully working: this can stay high after remaining_pct (circulation) has dropped (e.g. tesamorelin)."},"last_dose_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Dose At"},"next_dose_due":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Dose Due"},"days_at_steady_state":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Days At Steady State"},"model_notes":{"items":{"type":"string"},"type":"array","title":"Model Notes"}},"type":"object","required":["compound_id","name","class","category","dose_amount","dose_unit","frequency","status","current_concentration_pct","concentration_confidence","model_notes"],"title":"CompoundWithConcentration"},"CompoundsResponse":{"properties":{"compounds":{"items":{"$ref":"#/components/schemas/CompoundWithConcentration"},"type":"array","title":"Compounds"},"generated_at":{"type":"string","title":"Generated At"}},"type":"object","required":["compounds","generated_at"],"title":"CompoundsResponse"},"ConcentrationCurve":{"properties":{"compound_name":{"type":"string","title":"Compound Name"},"points":{"items":{"$ref":"#/components/schemas/ConcentrationPoint"},"type":"array","title":"Points"},"current":{"$ref":"#/components/schemas/ConcentrationPoint"},"model_notes":{"items":{"type":"string"},"type":"array","title":"Model Notes"},"model_approximated":{"type":"boolean","title":"Model Approximated","default":false},"absolute_available":{"type":"boolean","title":"Absolute Available","description":"True when points/current include a trustworthy absolute amount on board. Currently limited to two_compartment_subq compounds dosed in mg.","default":false},"remaining_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Remaining Pct","description":"Percent of the most recent dose still in circulation, on the serum half-life (100*2^(-Δt/t_half_serum), clamped 0..100). Null with no dose history. Not the chart shape — this is 'how much of your last dose is left'."},"active_remaining_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Active Remaining Pct","description":"Percent of the most recent dose's biological effect still present, on the effect horizon (100*2^(-Δt/t_effect_hours), clamped 0..100). Null when t_effect_hours is null or there is no dose history. Present != fully working."}},"type":"object","required":["compound_name","points","current","model_notes"],"title":"ConcentrationCurve"},"ConcentrationCurveResponse":{"properties":{"compound_id":{"type":"string","title":"Compound Id"},"compound_name":{"title":"Compound Name"},"points":{"items":{"$ref":"#/components/schemas/ConcentrationPointResponse"},"type":"array","title":"Points"},"current":{"anyOf":[{"$ref":"#/components/schemas/ConcentrationPointResponse"},{"type":"null"}]},"model_notes":{"title":"Model Notes"},"model_approximated":{"type":"boolean","title":"Model Approximated","default":false},"absolute_available":{"type":"boolean","title":"Absolute Available","description":"True when points/current include a trustworthy absolute amount on board. Currently limited to two_compartment_subq compounds dosed in mg.","default":false},"remaining_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Remaining Pct","description":"Percent of the most recent dose still in circulation, on the serum half-life (100*2^(-Δt/t_half_serum), clamped 0..100). Null with no dose history. 'How much of your last dose is left', not the chart shape."},"active_remaining_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Active Remaining Pct","description":"Percent of the most recent dose's biological effect still present, on the effect horizon (100*2^(-Δt/t_effect_hours), clamped 0..100). Null when t_effect_hours is null or there is no dose history. Present != fully working."},"warnings":{"items":{},"type":"array","title":"Warnings"},"time_range":{"additionalProperties":true,"type":"object","title":"Time Range"},"generated_at":{"type":"string","title":"Generated At"}},"type":"object","required":["compound_id","compound_name","points","model_notes","warnings","time_range","generated_at"],"title":"ConcentrationCurveResponse"},"ConcentrationPoint":{"properties":{"timestamp":{"type":"string","title":"Timestamp"},"concentration_pct":{"type":"number","title":"Concentration Pct"},"amount_on_board":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Amount On Board","description":"Absolute amount on board in amount_unit, populated only when the PK model already computes a trustworthy absolute value."},"amount_unit":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Amount Unit","description":"Unit for amount_on_board, e.g. 'mg'. Null when unavailable."},"confidence_lower":{"type":"number","title":"Confidence Lower"},"confidence_upper":{"type":"number","title":"Confidence Upper"},"phase":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phase"}},"type":"object","required":["timestamp","concentration_pct","confidence_lower","confidence_upper"],"title":"ConcentrationPoint"},"ConcentrationPointResponse":{"properties":{"timestamp":{"type":"string","title":"Timestamp"},"concentration_pct":{"type":"number","title":"Concentration Pct"},"amount_on_board":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Amount On Board","description":"Absolute amount on board in amount_unit, populated only when the PK model already computes a trustworthy absolute value."},"amount_unit":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Amount Unit","description":"Unit for amount_on_board, e.g. 'mg'. Null when unavailable."},"confidence_lower":{"type":"number","title":"Confidence Lower"},"confidence_upper":{"type":"number","title":"Confidence Upper"},"phase":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phase"}},"type":"object","required":["timestamp","concentration_pct","confidence_lower","confidence_upper"],"title":"ConcentrationPointResponse"},"ConcentrationsResponse":{"properties":{"curves":{"additionalProperties":{"$ref":"#/components/schemas/ConcentrationCurve"},"type":"object","title":"Curves"},"time_range":{"$ref":"#/components/schemas/TimeRange"},"generated_at":{"type":"string","title":"Generated At"}},"type":"object","required":["curves","time_range","generated_at"],"title":"ConcentrationsResponse"},"ConfigUpdateResult":{"properties":{"updated":{"items":{"type":"string"},"type":"array","title":"Updated"},"warnings":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Warnings"}},"type":"object","required":["updated"],"title":"ConfigUpdateResult"},"ConnectedAccountStatus":{"properties":{"provider":{"type":"string","title":"Provider"},"auth_type":{"type":"string","title":"Auth Type"},"status":{"type":"string","title":"Status"},"scopes":{"items":{"type":"string"},"type":"array","title":"Scopes","default":[]},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata","default":{}},"expires_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expires At"},"connected_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Connected At"},"last_used_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Used At"},"can_reconnect":{"type":"boolean","title":"Can Reconnect","default":false}},"type":"object","required":["provider","auth_type","status"],"title":"ConnectedAccountStatus"},"ConnectedAccountsResponse":{"properties":{"accounts":{"items":{"$ref":"#/components/schemas/ConnectedAccountStatus"},"type":"array","title":"Accounts"}},"type":"object","required":["accounts"],"title":"ConnectedAccountsResponse"},"ConsultSection":{"properties":{"locked":{"type":"boolean","title":"Locked","default":false},"count":{"type":"integer","title":"Count","default":0},"questions":{"items":{"type":"string"},"type":"array","title":"Questions","default":[]}},"type":"object","title":"ConsultSection","description":"'Para tu consulta': firewall-validated questions to bring to the doctor (the v3\n`que_platicar`). Free tier: locked=True, count set, questions=[]."},"DoctorActivate":{"properties":{"referral_code":{"type":"string","title":"Referral Code"},"active":{"type":"boolean","title":"Active","default":true}},"type":"object","required":["referral_code"],"title":"DoctorActivate"},"DoctorActivateResult":{"properties":{"status":{"type":"string","title":"Status","default":"ok"},"referral_code":{"type":"string","title":"Referral Code"},"active":{"type":"boolean","title":"Active"},"auth_user_id_bound":{"type":"boolean","title":"Auth User Id Bound","default":false},"permission_granted":{"type":"boolean","title":"Permission Granted","default":false},"notified":{"type":"boolean","title":"Notified","default":false}},"type":"object","required":["referral_code","active"],"title":"DoctorActivateResult"},"DoctorApply":{"properties":{"clinic_name":{"anyOf":[{"type":"string","maxLength":160},{"type":"null"}],"title":"Clinic Name"},"doctor_name":{"type":"string","maxLength":160,"title":"Doctor Name"},"specialty":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}],"title":"Specialty"},"cedula":{"anyOf":[{"type":"string","maxLength":40,"pattern":"^[0-9]+$"},{"type":"null"}],"title":"Cedula","description":"Cedula the applicant asserts. Recorded as an unverified claim; it never reaches the verified column, which only an admin may write. Numeric cedula format only; this does not verify issuance or ownership with Mexico's Registro Nacional de Profesionistas."},"notify_email":{"type":"string","maxLength":254,"title":"Notify Email"},"whatsapp":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}],"title":"Whatsapp"},"city":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}],"title":"City"},"referral_code":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}],"title":"Referral Code"}},"type":"object","required":["doctor_name","notify_email"],"title":"DoctorApply"},"DoctorApplyAck":{"properties":{"status":{"type":"string","title":"Status","default":"ok"},"referral_code":{"type":"string","title":"Referral Code"},"pending":{"type":"boolean","title":"Pending","default":true}},"type":"object","required":["referral_code"],"title":"DoctorApplyAck"},"DoctorIn":{"properties":{"referral_code":{"type":"string","title":"Referral Code"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"notify_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notify Email"},"clinic_slug":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Clinic Slug"},"active":{"type":"boolean","title":"Active","default":true}},"type":"object","required":["referral_code"],"title":"DoctorIn"},"DoctorMeResponse":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"cedula":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cedula"},"referral_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Referral Code"},"clinic_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Clinic Name"}},"type":"object","title":"DoctorMeResponse"},"DoctorPanelPdfResponse":{"properties":{"url":{"type":"string","title":"Url"},"expires_in":{"type":"integer","title":"Expires In"}},"type":"object","required":["url","expires_in"],"title":"DoctorPanelPdfResponse"},"DoctorPatient":{"properties":{"user_id":{"type":"string","title":"User Id"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"last_panel_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Panel Date"},"total_markers":{"type":"integer","title":"Total Markers","default":0},"markers_pending":{"type":"integer","title":"Markers Pending","default":0},"insight_status":{"type":"string","title":"Insight Status","default":"none"},"panels_count":{"type":"integer","title":"Panels Count","default":0}},"type":"object","required":["user_id"],"title":"DoctorPatient"},"DoctorPatientProfile":{"properties":{"has_intake":{"type":"boolean","title":"Has Intake","default":false},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"sex":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sex"},"age":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Age"},"protocol_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Protocol Status"},"protocol_classes":{"items":{"type":"string"},"type":"array","title":"Protocol Classes","default":[]},"goals":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Goals"},"conditions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conditions"},"current_meds":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Meds"},"confounders":{"items":{"type":"string"},"type":"array","title":"Confounders","default":[]},"family_history":{"items":{"type":"string"},"type":"array","title":"Family History","default":[]},"weight_kg":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Weight Kg"},"height_cm":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Height Cm"},"intake_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Intake Date"}},"type":"object","title":"DoctorPatientProfile","description":"Clinical context from the patient's intake, for the expediente header (spec 009 R5c).\nEvery field is optional: a legacy/sparse intake row renders gracefully. Age is derived\n(never the raw date_of_birth — data minimization toward the doctor surface)."},"DoctorPatientsResponse":{"properties":{"patients":{"items":{"$ref":"#/components/schemas/DoctorPatient"},"type":"array","title":"Patients"}},"type":"object","required":["patients"],"title":"DoctorPatientsResponse"},"DoseDeleteResponse":{"properties":{"id":{"type":"string","title":"Id"},"deleted":{"type":"boolean","title":"Deleted"}},"type":"object","required":["id","deleted"],"title":"DoseDeleteResponse"},"DoseHistoryFilters":{"properties":{"compound_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Compound Id"},"start":{"type":"string","title":"Start"},"end":{"type":"string","title":"End"},"limit":{"type":"integer","title":"Limit"},"include_skipped":{"type":"boolean","title":"Include Skipped"}},"type":"object","required":["start","end","limit","include_skipped"],"title":"DoseHistoryFilters"},"DoseHistoryResponse":{"properties":{"doses":{"items":{"$ref":"#/components/schemas/DoseLogEntry"},"type":"array","title":"Doses"},"total_count":{"type":"integer","title":"Total Count"},"filters":{"$ref":"#/components/schemas/DoseHistoryFilters"}},"type":"object","required":["doses","total_count","filters"],"title":"DoseHistoryResponse"},"DoseLogEntry":{"properties":{"id":{"type":"string","title":"Id"},"protocol_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Protocol Id"},"compound_id":{"type":"string","title":"Compound Id"},"compound_name":{"type":"string","title":"Compound Name"},"taken_at":{"type":"string","title":"Taken At"},"dose_amount":{"type":"number","title":"Dose Amount"},"dose_unit":{"type":"string","title":"Dose Unit"},"route_type":{"type":"string","title":"Route Type"},"injection_site":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Injection Site"},"lot_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lot Number"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"skipped":{"type":"boolean","title":"Skipped"},"skip_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Skip Reason"}},"type":"object","required":["id","compound_id","compound_name","taken_at","dose_amount","dose_unit","route_type","skipped"],"title":"DoseLogEntry"},"DoseLogResult":{"properties":{},"additionalProperties":true,"type":"object","title":"DoseLogResult"},"DoseOptionBrief":{"properties":{"presentation_id":{"type":"string","title":"Presentation Id"},"dose_value":{"type":"number","title":"Dose Value"},"dose_unit":{"type":"string","title":"Dose Unit"}},"type":"object","required":["presentation_id","dose_value","dose_unit"],"title":"DoseOptionBrief"},"DoseRow":{"properties":{"label":{"type":"string","title":"Label"},"brand":{"type":"string","title":"Brand"},"molecule":{"type":"string","title":"Molecule"},"forma":{"type":"string","title":"Forma"},"dose_value":{"type":"number","title":"Dose Value"},"dose_unit":{"type":"string","title":"Dose Unit"},"presentation_label":{"type":"string","title":"Presentation Label"},"quotes":{"items":{"$ref":"#/components/schemas/PriceQuote"},"type":"array","title":"Quotes","default":[]},"cheapest_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cheapest Source"},"cheapest_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cheapest Price"},"spread":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Spread"}},"type":"object","required":["label","brand","molecule","forma","dose_value","dose_unit","presentation_label"],"title":"DoseRow","description":"A deliverable dose the doctor filters on (e.g. 'Wegovy 2.4 mg'),\nwith the price at each pharmacy. Resolved via dose_option, never via the\nsellable presentation, so a dual-dose pen yields two rows, not duplicates."},"DoseUpdateResponse":{"properties":{"id":{"type":"string","title":"Id"},"updated":{"type":"boolean","title":"Updated"}},"type":"object","required":["id","updated"],"title":"DoseUpdateResponse"},"EditPanelMarkerRequest":{"properties":{"corrected_value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Corrected Value","description":"User-corrected numeric value."},"corrected_unit":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Corrected Unit","description":"User-corrected unit string."},"corrected_value_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Corrected Value Text","description":"User-corrected text value for categorical markers."},"corrected_value_qualifier":{"anyOf":[{"type":"string","enum":["lt","lte","gt","gte"]},{"type":"null"}],"title":"Corrected Value Qualifier","description":"User-corrected qualifier (lt|lte|gt|gte) for numeric detection-limit values."}},"type":"object","title":"EditPanelMarkerRequest","description":"clarys-needs-review (2026-05-25): correct an already-saved panel marker.\n\nPATCH /labs/panel/{panel_id}/marker/{marker_id} — applies user edits\nwith the same audit-trail semantics as POST /resolve, but targets a\nrow that's already in lab_results rather than one in lab_upload_queue\n.flagged_markers. Either field can be set independently; omitting\nboth is a 200 no-op."},"EditPanelMarkerResponse":{"properties":{"result_id":{"type":"string","title":"Result Id"},"value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Value"},"unit":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Unit"},"value_original":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Value Original"},"unit_original":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Unit Original"},"value_corrected_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Value Corrected At"},"confidence_flag":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Confidence Flag"},"value_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Value Text"},"value_qualifier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Value Qualifier"},"applied":{"type":"boolean","title":"Applied","description":"True if the PATCH wrote a correction; False for a no-op call.","default":false}},"type":"object","required":["result_id"],"title":"EditPanelMarkerResponse","description":"Returned by PATCH /labs/result/{result_id}."},"EnrichedCategory":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description","default":""},"markers":{"items":{"$ref":"#/components/schemas/EnrichedMarker"},"type":"array","title":"Markers"}},"type":"object","required":["id","name","markers"],"title":"EnrichedCategory"},"EnrichedMarker":{"properties":{"marker_id":{"type":"string","title":"Marker Id"},"canonical_name":{"type":"string","title":"Canonical Name"},"name_es":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name Es"},"original_name":{"type":"string","title":"Original Name","default":""},"panel_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Panel Id"},"panel_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Panel Date"},"panel_name":{"type":"string","title":"Panel Name","default":""},"lab_name":{"type":"string","title":"Lab Name","default":""},"value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Value"},"unit":{"type":"string","title":"Unit","default":""},"normalized_value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Normalized Value"},"normalized_unit":{"type":"string","title":"Normalized Unit"},"category":{"type":"string","title":"Category","default":"unknown"},"status":{"type":"string","enum":["optimal","borderline","out_of_range","not_assessed"],"title":"Status"},"trend":{"type":"string","enum":["positive","negative","stable","none"],"title":"Trend"},"trend_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Trend Pct"},"range_lab":{"$ref":"#/components/schemas/MarkerRange"},"range_optimal":{"$ref":"#/components/schemas/MarkerRange"},"history":{"items":{"$ref":"#/components/schemas/MarkerHistoryPoint"},"type":"array","title":"History"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"},"result_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Result Id"},"confidence_flag":{"anyOf":[{"type":"string","enum":["low_confidence","llm_resolved","user_resolved"]},{"type":"null"}],"title":"Confidence Flag"},"value_original":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Value Original"},"unit_original":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Unit Original"},"value_corrected_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Value Corrected At"},"value_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Value Text"},"value_qualifier":{"anyOf":[{"type":"string","enum":["lt","lte","gt","gte"]},{"type":"null"}],"title":"Value Qualifier"},"value_type":{"type":"string","title":"Value Type","default":"numeric"},"pdf_page":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Pdf Page"},"raw_snippet":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Raw Snippet"}},"type":"object","required":["marker_id","canonical_name","normalized_unit","status","trend","range_lab","range_optimal","history"],"title":"EnrichedMarker"},"EnrichedPanel":{"properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id"},"date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date"},"lab_name":{"type":"string","title":"Lab Name","default":""},"panel_name":{"type":"string","title":"Panel Name","default":""},"date_source":{"anyOf":[{"type":"string","enum":["collection","report","inferred_vision","inferred_filename","upload_fallback","manual"]},{"type":"null"}],"title":"Date Source"},"date_confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Date Confidence"},"date_is_collection":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Date Is Collection"},"collection_time":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Collection Time"},"collection_tz":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Collection Tz"},"collection_time_source":{"anyOf":[{"type":"string","enum":["lab_printed_text","lab_printed_vision","manual"]},{"type":"null"}],"title":"Collection Time Source"},"collection_tz_source":{"anyOf":[{"type":"string","enum":["lab_printed","lab_location","profile","manual"]},{"type":"null"}],"title":"Collection Tz Source"},"date_review_pending":{"type":"boolean","title":"Date Review Pending","default":false},"date_review_reasons":{"items":{"type":"string"},"type":"array","title":"Date Review Reasons"},"markers":{"items":{"$ref":"#/components/schemas/EnrichedMarker"},"type":"array","title":"Markers"}},"type":"object","required":["markers"],"title":"EnrichedPanel"},"Envelope_ActivitiesResponse_":{"properties":{"data":{"$ref":"#/components/schemas/ActivitiesResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[ActivitiesResponse]"},"Envelope_AdherenceResponse_":{"properties":{"data":{"$ref":"#/components/schemas/AdherenceResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[AdherenceResponse]"},"Envelope_AdminClinicsResponse_":{"properties":{"data":{"$ref":"#/components/schemas/AdminClinicsResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[AdminClinicsResponse]"},"Envelope_AdminDoctorCedulaResponse_":{"properties":{"data":{"$ref":"#/components/schemas/AdminDoctorCedulaResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[AdminDoctorCedulaResponse]"},"Envelope_AdminDoctorsResponse_":{"properties":{"data":{"$ref":"#/components/schemas/AdminDoctorsResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[AdminDoctorsResponse]"},"Envelope_AdminLeadsResponse_":{"properties":{"data":{"$ref":"#/components/schemas/AdminLeadsResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[AdminLeadsResponse]"},"Envelope_AdminOverview_":{"properties":{"data":{"$ref":"#/components/schemas/AdminOverview"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[AdminOverview]"},"Envelope_AdminPatientsResponse_":{"properties":{"data":{"$ref":"#/components/schemas/AdminPatientsResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[AdminPatientsResponse]"},"Envelope_AdminWaitlistResponse_":{"properties":{"data":{"$ref":"#/components/schemas/AdminWaitlistResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[AdminWaitlistResponse]"},"Envelope_AllowedTiersResponse_":{"properties":{"data":{"$ref":"#/components/schemas/AllowedTiersResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[AllowedTiersResponse]"},"Envelope_AssignDoctorResponse_":{"properties":{"data":{"$ref":"#/components/schemas/AssignDoctorResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[AssignDoctorResponse]"},"Envelope_AssignedDoctorResponse_":{"properties":{"data":{"$ref":"#/components/schemas/AssignedDoctorResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[AssignedDoctorResponse]"},"Envelope_AuthConnectResponse_":{"properties":{"data":{"$ref":"#/components/schemas/AuthConnectResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[AuthConnectResponse]"},"Envelope_AuthRefreshResponse_":{"properties":{"data":{"$ref":"#/components/schemas/AuthRefreshResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[AuthRefreshResponse]"},"Envelope_BatchValidateMarkersResponse_":{"properties":{"data":{"$ref":"#/components/schemas/BatchValidateMarkersResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[BatchValidateMarkersResponse]"},"Envelope_BookingAck_":{"properties":{"data":{"$ref":"#/components/schemas/BookingAck"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[BookingAck]"},"Envelope_BriefResponse_":{"properties":{"data":{"$ref":"#/components/schemas/BriefResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[BriefResponse]"},"Envelope_CalendarResponse_":{"properties":{"data":{"$ref":"#/components/schemas/CalendarResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[CalendarResponse]"},"Envelope_CancelPauseResponse_":{"properties":{"data":{"$ref":"#/components/schemas/CancelPauseResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[CancelPauseResponse]"},"Envelope_CatalogResponse_":{"properties":{"data":{"$ref":"#/components/schemas/CatalogResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[CatalogResponse]"},"Envelope_CompoundCatalogResponse_":{"properties":{"data":{"$ref":"#/components/schemas/CompoundCatalogResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[CompoundCatalogResponse]"},"Envelope_CompoundDetailResponse_":{"properties":{"data":{"$ref":"#/components/schemas/CompoundDetailResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[CompoundDetailResponse]"},"Envelope_CompoundsResponse_":{"properties":{"data":{"$ref":"#/components/schemas/CompoundsResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[CompoundsResponse]"},"Envelope_ConcentrationCurveResponse_":{"properties":{"data":{"$ref":"#/components/schemas/ConcentrationCurveResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[ConcentrationCurveResponse]"},"Envelope_ConcentrationsResponse_":{"properties":{"data":{"$ref":"#/components/schemas/ConcentrationsResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[ConcentrationsResponse]"},"Envelope_ConfigUpdateResult_":{"properties":{"data":{"$ref":"#/components/schemas/ConfigUpdateResult"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[ConfigUpdateResult]"},"Envelope_ConnectedAccountsResponse_":{"properties":{"data":{"$ref":"#/components/schemas/ConnectedAccountsResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[ConnectedAccountsResponse]"},"Envelope_DoctorActivateResult_":{"properties":{"data":{"$ref":"#/components/schemas/DoctorActivateResult"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[DoctorActivateResult]"},"Envelope_DoctorApplyAck_":{"properties":{"data":{"$ref":"#/components/schemas/DoctorApplyAck"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[DoctorApplyAck]"},"Envelope_DoctorMeResponse_":{"properties":{"data":{"$ref":"#/components/schemas/DoctorMeResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[DoctorMeResponse]"},"Envelope_DoctorPanelPdfResponse_":{"properties":{"data":{"$ref":"#/components/schemas/DoctorPanelPdfResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[DoctorPanelPdfResponse]"},"Envelope_DoctorPatientProfile_":{"properties":{"data":{"$ref":"#/components/schemas/DoctorPatientProfile"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[DoctorPatientProfile]"},"Envelope_DoctorPatientsResponse_":{"properties":{"data":{"$ref":"#/components/schemas/DoctorPatientsResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[DoctorPatientsResponse]"},"Envelope_DoseDeleteResponse_":{"properties":{"data":{"$ref":"#/components/schemas/DoseDeleteResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[DoseDeleteResponse]"},"Envelope_DoseHistoryResponse_":{"properties":{"data":{"$ref":"#/components/schemas/DoseHistoryResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[DoseHistoryResponse]"},"Envelope_DoseLogResult_":{"properties":{"data":{"$ref":"#/components/schemas/DoseLogResult"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[DoseLogResult]"},"Envelope_DoseUpdateResponse_":{"properties":{"data":{"$ref":"#/components/schemas/DoseUpdateResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[DoseUpdateResponse]"},"Envelope_EditPanelMarkerResponse_":{"properties":{"data":{"$ref":"#/components/schemas/EditPanelMarkerResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[EditPanelMarkerResponse]"},"Envelope_EventsListData_":{"properties":{"data":{"$ref":"#/components/schemas/EventsListData"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[EventsListData]"},"Envelope_ExperimentDetailResponse_":{"properties":{"data":{"$ref":"#/components/schemas/ExperimentDetailResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[ExperimentDetailResponse]"},"Envelope_ExperimentsResponse_":{"properties":{"data":{"$ref":"#/components/schemas/ExperimentsResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[ExperimentsResponse]"},"Envelope_ExtractionTelemetryResponse_":{"properties":{"data":{"$ref":"#/components/schemas/ExtractionTelemetryResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[ExtractionTelemetryResponse]"},"Envelope_FlaggedMarkersResponse_":{"properties":{"data":{"$ref":"#/components/schemas/FlaggedMarkersResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[FlaggedMarkersResponse]"},"Envelope_HealthResponse_":{"properties":{"data":{"$ref":"#/components/schemas/HealthResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[HealthResponse]"},"Envelope_HevyIngestResponse_":{"properties":{"data":{"$ref":"#/components/schemas/HevyIngestResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[HevyIngestResponse]"},"Envelope_InjectionSitesResponse_":{"properties":{"data":{"$ref":"#/components/schemas/InjectionSitesResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[InjectionSitesResponse]"},"Envelope_IntakeAck_":{"properties":{"data":{"$ref":"#/components/schemas/IntakeAck"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[IntakeAck]"},"Envelope_LabInterpretationResponse_":{"properties":{"data":{"$ref":"#/components/schemas/LabInterpretationResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[LabInterpretationResponse]"},"Envelope_LabsResponse_":{"properties":{"data":{"$ref":"#/components/schemas/LabsResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[LabsResponse]"},"Envelope_MarkerCatalogResponse_":{"properties":{"data":{"$ref":"#/components/schemas/MarkerCatalogResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[MarkerCatalogResponse]"},"Envelope_MarketIntelReport_":{"properties":{"data":{"$ref":"#/components/schemas/MarketIntelReport"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[MarketIntelReport]"},"Envelope_MasterInsightDraft_":{"properties":{"data":{"$ref":"#/components/schemas/MasterInsightDraft"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[MasterInsightDraft]"},"Envelope_MasterInsightPatient_":{"properties":{"data":{"$ref":"#/components/schemas/MasterInsightPatient"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[MasterInsightPatient]"},"Envelope_MeasurementsResponse_":{"properties":{"data":{"$ref":"#/components/schemas/MeasurementsResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[MeasurementsResponse]"},"Envelope_NutritionLogResponse_":{"properties":{"data":{"$ref":"#/components/schemas/NutritionLogResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[NutritionLogResponse]"},"Envelope_NutritionResponse_":{"properties":{"data":{"$ref":"#/components/schemas/NutritionResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[NutritionResponse]"},"Envelope_OverviewResponse_":{"properties":{"data":{"$ref":"#/components/schemas/OverviewResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[OverviewResponse]"},"Envelope_PanelCountResponse_":{"properties":{"data":{"$ref":"#/components/schemas/PanelCountResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[PanelCountResponse]"},"Envelope_PanelDateCorrectionResponse_":{"properties":{"data":{"$ref":"#/components/schemas/PanelDateCorrectionResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[PanelDateCorrectionResponse]"},"Envelope_PanelRecoResponse_":{"properties":{"data":{"$ref":"#/components/schemas/PanelRecoResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[PanelRecoResponse]"},"Envelope_PauseResponse_":{"properties":{"data":{"$ref":"#/components/schemas/PauseResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[PauseResponse]"},"Envelope_PendingMarkersResponse_":{"properties":{"data":{"$ref":"#/components/schemas/PendingMarkersResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[PendingMarkersResponse]"},"Envelope_PeptideExperimentsResponse_":{"properties":{"data":{"$ref":"#/components/schemas/PeptideExperimentsResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[PeptideExperimentsResponse]"},"Envelope_PeptideLogResult_":{"properties":{"data":{"$ref":"#/components/schemas/PeptideLogResult"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[PeptideLogResult]"},"Envelope_PermissionUpdateResponse_":{"properties":{"data":{"$ref":"#/components/schemas/PermissionUpdateResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[PermissionUpdateResponse]"},"Envelope_PriceObservationResult_":{"properties":{"data":{"$ref":"#/components/schemas/PriceObservationResult"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[PriceObservationResult]"},"Envelope_ProtocolListResponse_":{"properties":{"data":{"$ref":"#/components/schemas/ProtocolListResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[ProtocolListResponse]"},"Envelope_ProtocolRow_":{"properties":{"data":{"$ref":"#/components/schemas/ProtocolRow"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[ProtocolRow]"},"Envelope_ProtocolStackResponse_":{"properties":{"data":{"$ref":"#/components/schemas/ProtocolStackResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[ProtocolStackResponse]"},"Envelope_ProtocolStateUpdateResult_":{"properties":{"data":{"$ref":"#/components/schemas/ProtocolStateUpdateResult"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[ProtocolStateUpdateResult]"},"Envelope_ProtocolState_":{"properties":{"data":{"$ref":"#/components/schemas/ProtocolState"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[ProtocolState]"},"Envelope_RecommendationResponse_":{"properties":{"data":{"$ref":"#/components/schemas/RecommendationResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[RecommendationResponse]"},"Envelope_ReportArtifact_":{"properties":{"data":{"$ref":"#/components/schemas/ReportArtifact"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[ReportArtifact]"},"Envelope_ResolveMarkersResponse_":{"properties":{"data":{"$ref":"#/components/schemas/ResolveMarkersResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[ResolveMarkersResponse]"},"Envelope_ResumeResponse_":{"properties":{"data":{"$ref":"#/components/schemas/ResumeResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[ResumeResponse]"},"Envelope_RetrospectiveUpdateResult_":{"properties":{"data":{"$ref":"#/components/schemas/RetrospectiveUpdateResult"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[RetrospectiveUpdateResult]"},"Envelope_ScheduleHistoryResponse_":{"properties":{"data":{"$ref":"#/components/schemas/ScheduleHistoryResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[ScheduleHistoryResponse]"},"Envelope_ShareLink_":{"properties":{"data":{"$ref":"#/components/schemas/ShareLink"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[ShareLink]"},"Envelope_StatusResponse_":{"properties":{"data":{"$ref":"#/components/schemas/StatusResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[StatusResponse]"},"Envelope_SyncProfilesData_":{"properties":{"data":{"$ref":"#/components/schemas/SyncProfilesData"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[SyncProfilesData]"},"Envelope_TrainingResponse_":{"properties":{"data":{"$ref":"#/components/schemas/TrainingResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[TrainingResponse]"},"Envelope_TrainingScheduleResponse_":{"properties":{"data":{"$ref":"#/components/schemas/TrainingScheduleResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[TrainingScheduleResponse]"},"Envelope_Union_RetrospectiveEntry__NoneType__":{"properties":{"data":{"anyOf":[{"$ref":"#/components/schemas/RetrospectiveEntry"},{"type":"null"}]},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[Union[RetrospectiveEntry, NoneType]]"},"Envelope_UploadHistoryResponse_":{"properties":{"data":{"$ref":"#/components/schemas/UploadHistoryResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[UploadHistoryResponse]"},"Envelope_UploadResponse_":{"properties":{"data":{"$ref":"#/components/schemas/UploadResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[UploadResponse]"},"Envelope_UploadStatusResponse_":{"properties":{"data":{"$ref":"#/components/schemas/UploadStatusResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[UploadStatusResponse]"},"Envelope_UserConfig_":{"properties":{"data":{"$ref":"#/components/schemas/UserConfig"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[UserConfig]"},"Envelope_ValidateMarkerResponse_":{"properties":{"data":{"$ref":"#/components/schemas/ValidateMarkerResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[ValidateMarkerResponse]"},"Envelope_VialResetResponse_":{"properties":{"data":{"$ref":"#/components/schemas/VialResetResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[VialResetResponse]"},"Envelope_VialSupplyResponse_":{"properties":{"data":{"$ref":"#/components/schemas/VialSupplyResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[VialSupplyResponse]"},"Envelope_WaitlistAck_":{"properties":{"data":{"$ref":"#/components/schemas/WaitlistAck"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[WaitlistAck]"},"Envelope_WorkoutsResponse_":{"properties":{"data":{"$ref":"#/components/schemas/WorkoutsResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[WorkoutsResponse]"},"EventRow":{"properties":{"id":{"type":"string","title":"Id"},"created_at":{"type":"string","title":"Created At"},"kind":{"type":"string","title":"Kind"},"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"subject_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject Id"},"source":{"type":"string","title":"Source"},"payload":{"additionalProperties":true,"type":"object","title":"Payload"}},"type":"object","required":["id","created_at","kind","source","payload"],"title":"EventRow"},"EventsListData":{"properties":{"events":{"items":{"$ref":"#/components/schemas/EventRow"},"type":"array","title":"Events"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["events","count"],"title":"EventsListData"},"Exercise":{"properties":{"title":{"type":"string","title":"Title"},"exercise_template_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Exercise Template Id"},"sets":{"items":{"$ref":"#/components/schemas/SetDetail"},"type":"array","title":"Sets"},"volume_lbs":{"type":"number","title":"Volume Lbs"},"top_set_weight_lbs":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Top Set Weight Lbs"},"top_set_reps":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Top Set Reps"}},"type":"object","required":["title","sets","volume_lbs"],"title":"Exercise"},"ExperimentCorrelation":{"properties":{"marker_id":{"type":"string","title":"Marker Id"},"marker_name":{"type":"string","title":"Marker Name"},"data_points":{"items":{"$ref":"#/components/schemas/ExperimentCorrelationPoint"},"type":"array","title":"Data Points"},"pre_experiment_avg":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Pre Experiment Avg"},"during_experiment_avg":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"During Experiment Avg"},"change_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Change Pct"}},"type":"object","required":["marker_id","marker_name","data_points"],"title":"ExperimentCorrelation"},"ExperimentCorrelationPoint":{"properties":{"date":{"type":"string","title":"Date"},"value":{"type":"number","title":"Value"},"in_experiment":{"type":"boolean","title":"In Experiment"}},"type":"object","required":["date","value","in_experiment"],"title":"ExperimentCorrelationPoint"},"ExperimentDetailResponse":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"hypothesis":{"type":"string","title":"Hypothesis"},"start_date":{"type":"string","title":"Start Date"},"end_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Date"},"planned_duration_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Planned Duration Days"},"days_elapsed":{"type":"integer","title":"Days Elapsed"},"progress_pct":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Progress Pct"},"status":{"type":"string","title":"Status"},"compound_ids":{"items":{"type":"string"},"type":"array","title":"Compound Ids"},"protocol_changes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Protocol Changes"},"markers":{"items":{"$ref":"#/components/schemas/ExperimentMarkerDetail"},"type":"array","title":"Markers"},"correlations":{"items":{"$ref":"#/components/schemas/ExperimentCorrelation"},"type":"array","title":"Correlations"},"outcome":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Outcome"},"outcome_sentiment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Outcome Sentiment"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},"type":"object","required":["id","name","hypothesis","start_date","days_elapsed","status","compound_ids","markers","correlations"],"title":"ExperimentDetailResponse"},"ExperimentMarker":{"properties":{"marker_id":{"type":"string","title":"Marker Id"},"marker_name":{"type":"string","title":"Marker Name"},"marker_type":{"type":"string","title":"Marker Type"},"baseline_value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Baseline Value"},"current_value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Current Value"},"target_direction":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Direction"},"change_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Change Pct"},"on_track":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"On Track"}},"type":"object","required":["marker_id","marker_name","marker_type"],"title":"ExperimentMarker"},"ExperimentMarkerDetail":{"properties":{"marker_id":{"type":"string","title":"Marker Id"},"marker_name":{"type":"string","title":"Marker Name"},"marker_type":{"type":"string","title":"Marker Type"},"baseline_value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Baseline Value"},"current_value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Current Value"},"target_direction":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Direction"},"target_value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Target Value"},"target_threshold_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Target Threshold Pct"},"change_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Change Pct"},"met_target":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Met Target"}},"type":"object","required":["marker_id","marker_name","marker_type"],"title":"ExperimentMarkerDetail"},"ExperimentWithMarkers":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"hypothesis":{"type":"string","title":"Hypothesis"},"start_date":{"type":"string","title":"Start Date"},"end_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Date"},"planned_duration_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Planned Duration Days"},"days_elapsed":{"type":"integer","title":"Days Elapsed"},"progress_pct":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Progress Pct"},"status":{"type":"string","title":"Status"},"compound_ids":{"items":{"type":"string"},"type":"array","title":"Compound Ids"},"protocol_changes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Protocol Changes"},"markers":{"items":{"$ref":"#/components/schemas/ExperimentMarker"},"type":"array","title":"Markers"},"outcome":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Outcome"},"outcome_sentiment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Outcome Sentiment"}},"type":"object","required":["id","name","hypothesis","start_date","days_elapsed","status","compound_ids","markers"],"title":"ExperimentWithMarkers"},"ExperimentsResponse":{"properties":{"experiments":{"items":{"$ref":"#/components/schemas/ExperimentWithMarkers"},"type":"array","title":"Experiments"},"generated_at":{"type":"string","title":"Generated At"}},"type":"object","required":["experiments","generated_at"],"title":"ExperimentsResponse"},"ExtractionTelemetryResponse":{"properties":{"window_days":{"type":"integer","title":"Window Days"},"by_lab":{"additionalProperties":true,"type":"object","title":"By Lab","default":{}},"recent_uploads":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Recent Uploads","default":[]}},"additionalProperties":true,"type":"object","required":["window_days"],"title":"ExtractionTelemetryResponse"},"FlaggedMarkerDetail":{"properties":{"original_name":{"type":"string","title":"Original Name","description":"Original marker name as extracted from PDF"},"value":{"type":"number","title":"Value","description":"Numeric value of the marker"},"unit":{"type":"string","title":"Unit","description":"Unit of measurement"},"confidence":{"type":"number","maximum":100.0,"minimum":0.0,"title":"Confidence","description":"Confidence score (0-100)"},"canonical_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Canonical Id","description":"Canonical marker ID (if matched to catalog)"},"canonical_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Canonical Name","description":"Canonical marker name (if matched)"},"range_min":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Range Min","description":"Reference range minimum (if available)"},"range_max":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Range Max","description":"Reference range maximum (if available)"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category","description":"Marker category (e.g., 'metabolic', 'lipid')"},"already_resolved":{"type":"boolean","title":"Already Resolved","description":"Whether this marker has already been resolved","default":false},"value_anomaly":{"anyOf":[{"type":"string","enum":["out_of_range","history_drift","both"]},{"type":"null"}],"title":"Value Anomaly","description":"Auto-detected value anomaly. 'out_of_range' = value > 3x the optimal-range width outside the optimal range. 'history_drift' = value differs >50% from the user's previous reading. 'both' = both apply. None = no anomaly or no reference available."}},"type":"object","required":["original_name","value","unit","confidence"],"title":"FlaggedMarkerDetail","description":"Detail for a single flagged marker requiring review.\n\nAttributes:\n    original_name: Original marker name as extracted from PDF\n    value: Numeric value of the marker\n    unit: Unit of measurement\n    confidence: Confidence score (0-100)\n    canonical_id: Canonical marker ID (if matched to catalog)\n    canonical_name: Canonical marker name (if matched)\n    range_min: Reference range minimum (if available)\n    range_max: Reference range maximum (if available)\n    category: Marker category (e.g., 'metabolic', 'lipid')\n    already_resolved: Whether this marker has already been resolved"},"FlaggedMarkersResponse":{"properties":{"upload_id":{"type":"string","title":"Upload Id","description":"ID of the upload being reviewed"},"panel_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Panel Id","description":"ID of the associated lab panel (if created)"},"lab_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lab Name","description":"Name of the lab"},"panel_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Panel Date","description":"Date of the lab panel"},"flagged_markers":{"items":{"$ref":"#/components/schemas/FlaggedMarkerDetail"},"type":"array","title":"Flagged Markers","description":"List of markers requiring review"},"existing_panel_markers":{"items":{"type":"string"},"type":"array","title":"Existing Panel Markers","description":"Canonical IDs already in the panel"}},"type":"object","required":["upload_id","flagged_markers","existing_panel_markers"],"title":"FlaggedMarkersResponse","description":"Response model for flagged markers endpoint.\n\nAttributes:\n    upload_id: ID of the upload being reviewed\n    panel_id: ID of the associated lab panel (if created)\n    lab_name: Name of the lab\n    panel_date: Date of the lab panel\n    flagged_markers: List of markers requiring review\n    existing_panel_markers: Canonical IDs already in the panel"},"GenericsRow":{"properties":{"molecule":{"type":"string","title":"Molecule"},"has_generic":{"type":"boolean","title":"Has Generic","default":false},"note":{"type":"string","title":"Note","default":""}},"type":"object","required":["molecule"],"title":"GenericsRow"},"GlobalAdherenceStats":{"properties":{"on_time":{"type":"integer","title":"On Time"},"late":{"type":"integer","title":"Late"},"missed":{"type":"integer","title":"Missed"},"expected":{"type":"integer","title":"Expected"},"pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Pct","description":"Expected-weighted global adherence percentage across compounds. Null when there are no expected doses in the window."}},"type":"object","required":["on_time","late","missed","expected"],"title":"GlobalAdherenceStats"},"GoldMetricTrend":{"properties":{"current":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Current"},"date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date"},"change_7d":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Change 7D"},"change_30d":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Change 30D"},"weekly_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Weekly Rate"}},"additionalProperties":true,"type":"object","title":"GoldMetricTrend"},"GoldRecoveryScore":{"properties":{"avg_7d":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg 7D"},"avg_30d":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg 30D"},"low_recovery_days_7d":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Low Recovery Days 7D"},"red_recovery_days_7d":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Red Recovery Days 7D"}},"additionalProperties":true,"type":"object","title":"GoldRecoveryScore"},"GoldSleepHours":{"properties":{"avg_7d":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg 7D"},"avg_30d":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg 30D"},"data_days_7d":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Data Days 7D"}},"additionalProperties":true,"type":"object","title":"GoldSleepHours"},"GoldTrainingVolume":{"properties":{"sum_7d":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Sum 7D"},"workout_days_7d":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Workout Days 7D"}},"additionalProperties":true,"type":"object","title":"GoldTrainingVolume"},"GoldTrends":{"properties":{"weight_kg":{"anyOf":[{"$ref":"#/components/schemas/GoldMetricTrend"},{"type":"null"}]},"fat_pct":{"anyOf":[{"$ref":"#/components/schemas/GoldMetricTrend"},{"type":"null"}]},"muscle_kg":{"anyOf":[{"$ref":"#/components/schemas/GoldMetricTrend"},{"type":"null"}]},"recovery_score":{"anyOf":[{"$ref":"#/components/schemas/GoldRecoveryScore"},{"type":"null"}]},"sleep_hours":{"anyOf":[{"$ref":"#/components/schemas/GoldSleepHours"},{"type":"null"}]},"training_volume_lbs":{"anyOf":[{"$ref":"#/components/schemas/GoldTrainingVolume"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"GoldTrends"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HealthResponse":{"properties":{"status":{"type":"string","title":"Status"},"supabase":{"type":"boolean","title":"Supabase"},"jwt_configured":{"type":"boolean","title":"Jwt Configured"}},"type":"object","required":["status","supabase","jwt_configured"],"title":"HealthResponse"},"HevyIngestResponse":{"properties":{"status":{"type":"string","title":"Status"},"count":{"type":"integer","title":"Count"},"changed_dates":{"items":{"type":"string"},"type":"array","title":"Changed Dates"},"new_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"New Cursor"},"pages_fetched":{"type":"integer","title":"Pages Fetched"}},"type":"object","required":["status","count","changed_dates","pages_fetched"],"title":"HevyIngestResponse","description":"POST /v1/system/ingest/hevy result.\n\nThe delta ingest's outcome: how many new workouts were persisted this call,\nwhich dates changed (so a caller can invalidate day-scoped caches), the\nadvanced cursor (newest ingested workout's start_time), and how many Hevy\npages were fetched. A no-op ingest returns count=0 with the cursor unchanged."},"InfeasibilityWarning":{"properties":{"scheduled_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scheduled Type"},"trainable_coverage":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Trainable Coverage"},"threshold":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Threshold"},"overtrained_muscles":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Overtrained Muscles"},"suggested_substitute":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Suggested Substitute"}},"additionalProperties":false,"type":"object","title":"InfeasibilityWarning","description":"FEAT-236 / ADR-015 F2: surfaced when the SCHEDULED split's muscle scope is\nheavily fatigued, and always about the scheduled split (never a substituted\none). It offers a substitute so the user can decide.\n\nP0b: the engine MAY act on this itself when the substitute is clearly better\n— that is reported by `type_override`, never silently."},"InjectionSitesResponse":{"properties":{"zones":{"items":{"$ref":"#/components/schemas/InjectionZoneRecency"},"type":"array","title":"Zones"},"suggested_next_zone":{"type":"string","enum":["abdomen_UL","abdomen_UC","abdomen_UR","abdomen_LL","abdomen_LC","abdomen_LR","thigh_L","thigh_R","glute_L","glute_R","delt_L","delt_R"],"title":"Suggested Next Zone"},"soft_ideal_rest_days":{"type":"integer","title":"Soft Ideal Rest Days","default":7},"generated_at":{"type":"string","title":"Generated At"}},"type":"object","required":["zones","suggested_next_zone","generated_at"],"title":"InjectionSitesResponse"},"InjectionZoneRecency":{"properties":{"zone":{"type":"string","enum":["abdomen_UL","abdomen_UC","abdomen_UR","abdomen_LL","abdomen_LC","abdomen_LR","thigh_L","thigh_R","glute_L","glute_R","delt_L","delt_R"],"title":"Zone"},"last_used_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Used At"},"days_since":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Days Since"}},"type":"object","required":["zone"],"title":"InjectionZoneRecency"},"InsightEvidence":{"properties":{"marker_id":{"type":"string","title":"Marker Id"},"label":{"type":"string","title":"Label"},"value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Value"},"unit":{"type":"string","title":"Unit","default":""},"context_string":{"type":"string","title":"Context String"},"pmid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pmid"},"doi":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Doi"}},"type":"object","required":["marker_id","label","context_string"],"title":"InsightEvidence"},"IntakeAck":{"properties":{"status":{"type":"string","title":"Status","default":"ok"},"next":{"type":"string","title":"Next","default":"recommend_panel"}},"type":"object","title":"IntakeAck"},"IntakeRequest":{"properties":{"consent":{"type":"boolean","title":"Consent","default":false},"clinic_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Clinic Code"},"questionnaire_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Questionnaire Version"},"answers":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Answers"},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"},"goals":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Goals"},"protocol_interest":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Protocol Interest"},"current_meds":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Meds"},"conditions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conditions"}},"type":"object","title":"IntakeRequest"},"LabInsight":{"properties":{"id":{"type":"string","title":"Id"},"rule_id":{"type":"string","title":"Rule Id"},"marker_ids":{"items":{"type":"string"},"type":"array","title":"Marker Ids"},"headline":{"type":"string","title":"Headline"},"body":{"type":"string","title":"Body"},"sentiment":{"type":"string","title":"Sentiment"},"priority":{"type":"integer","title":"Priority"},"evidence":{"items":{"$ref":"#/components/schemas/InsightEvidence"},"type":"array","title":"Evidence"},"action":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action"}},"type":"object","required":["id","rule_id","marker_ids","headline","body","sentiment","priority","evidence"],"title":"LabInsight"},"LabInterpretationResponse":{"properties":{"category_id":{"type":"string","title":"Category Id"},"interpretation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Interpretation"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"cached":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Cached"},"generated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Generated At"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["category_id"],"title":"LabInterpretationResponse"},"LabsResponse":{"properties":{"panels":{"items":{"$ref":"#/components/schemas/EnrichedPanel"},"type":"array","title":"Panels"},"categories":{"items":{"$ref":"#/components/schemas/EnrichedCategory"},"type":"array","title":"Categories"},"insights":{"items":{"$ref":"#/components/schemas/LabInsight"},"type":"array","title":"Insights"},"summary":{"$ref":"#/components/schemas/LabsSummary"},"protocol_context":{"$ref":"#/components/schemas/ProtocolContext"},"generated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Generated At"},"data_age_hours":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Data Age Hours"}},"type":"object","required":["panels","categories","insights","summary","protocol_context"],"title":"LabsResponse"},"LabsSummary":{"properties":{"last_panel_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Panel Date"},"total_markers":{"type":"integer","title":"Total Markers","default":0},"markers_optimal":{"type":"integer","title":"Markers Optimal","default":0},"markers_borderline":{"type":"integer","title":"Markers Borderline","default":0},"markers_out_of_range":{"type":"integer","title":"Markers Out Of Range","default":0},"markers_not_assessed":{"type":"integer","title":"Markers Not Assessed","default":0}},"type":"object","title":"LabsSummary"},"LogDoseRequest":{"properties":{"compound_id":{"type":"string","title":"Compound Id","description":"Compound identifier (e.g., 'tirzepatide')"},"taken_at":{"type":"string","title":"Taken At","description":"ISO datetime when dose was taken"},"dose_amount":{"type":"number","exclusiveMinimum":0.0,"title":"Dose Amount","description":"Dose amount"},"dose_unit":{"type":"string","title":"Dose Unit","description":"Dose unit (mg, mcg, IU)"},"route_type":{"type":"string","enum":["subcutaneous","intramuscular","oral","topical","intranasal"],"title":"Route Type"},"local_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Local Date","description":"Local date YYYY-MM-DD (America/Chicago)"},"injection_site":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Injection Site","description":"Injection site for SubQ/IM"},"injection_zone":{"anyOf":[{"type":"string","enum":["abdomen_UL","abdomen_UC","abdomen_UR","abdomen_LL","abdomen_LC","abdomen_LR","thigh_L","thigh_R","glute_L","glute_R","delt_L","delt_R","injury_site"]},{"type":"null"}],"title":"Injection Zone","description":"Normalized injection zone enum for SubQ/IM"},"injection_volume_ml":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Injection Volume Ml","description":"Injection volume in mL"},"lot_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lot Number","description":"Vial lot number"},"reconstitution_concentration_mg_per_ml":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Reconstitution Concentration Mg Per Ml","description":"Reconstitution concentration"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes","description":"Additional notes"}},"type":"object","required":["compound_id","taken_at","dose_amount","dose_unit","route_type"],"title":"LogDoseRequest","description":"Request body for logging a dose."},"MarkerCatalogResponse":{"properties":{"markers":{"items":{"$ref":"#/components/schemas/CatalogMarkerItem"},"type":"array","title":"Markers","description":"List of catalog marker items"},"total":{"type":"integer","minimum":0.0,"title":"Total","description":"Total number of markers in the catalog"},"categories":{"items":{"type":"string"},"type":"array","title":"Categories","description":"List of unique category names"}},"type":"object","required":["markers","total","categories"],"title":"MarkerCatalogResponse","description":"Response model for marker catalog endpoint.\n\nAttributes:\n    markers: List of catalog marker items\n    total: Total number of markers in the catalog\n    categories: List of unique category names"},"MarkerCategoryGroup":{"properties":{"category":{"type":"string","title":"Category"},"name_es":{"type":"string","title":"Name Es"},"markers":{"items":{"$ref":"#/components/schemas/ReportMarker"},"type":"array","title":"Markers","default":[]}},"type":"object","required":["category","name_es"],"title":"MarkerCategoryGroup","description":"Grid markers grouped by catalog category (metabolic, lipids, thyroid, ...)."},"MarkerHistoryPoint":{"properties":{"date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date"},"value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Value"},"panel_name":{"type":"string","title":"Panel Name","default":""}},"type":"object","title":"MarkerHistoryPoint"},"MarkerPriorState":{"properties":{"confidence_flag":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Confidence Flag"},"value_corrected_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Value Corrected At"}},"type":"object","title":"MarkerPriorState"},"MarkerRange":{"properties":{"min":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Min"},"max":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Max"}},"type":"object","title":"MarkerRange"},"MarkerResolution":{"properties":{"original_name":{"type":"string","title":"Original Name","description":"Original marker name as extracted from PDF (must match flagged_markers)"},"canonical_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Canonical Id","description":"Canonical marker ID to assign (null if dismissed)"},"action":{"type":"string","pattern":"^(mapped|dismissed)$","title":"Action","description":"Either 'mapped' (add to panel) or 'dismissed' (ignore)"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes","description":"Optional notes about the resolution"},"corrected_value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Corrected Value","description":"User-corrected numeric value. When set and different from the flagged value, the resolve endpoint writes it as the primary value and stores the original in value_original."},"corrected_unit":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Corrected Unit","description":"User-corrected unit. Same audit-trail semantics as corrected_value."},"corrected_value_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Corrected Value Text","description":"User-corrected text value for categorical markers."},"corrected_value_qualifier":{"anyOf":[{"type":"string","enum":["lt","lte","gt","gte"]},{"type":"null"}],"title":"Corrected Value Qualifier","description":"User-corrected qualifier (lt|lte|gt|gte) for numeric detection-limit values."}},"type":"object","required":["original_name","action"],"title":"MarkerResolution","description":"Single marker resolution entry.\n\nUsed when resolving flagged markers - identifies a marker by its original_name\nand maps it to a canonical marker ID or marks it as dismissed.\n\nAttributes:\n    original_name: Original marker name as extracted from PDF (must match flagged_markers)\n    canonical_id: Canonical marker ID to assign (null if dismissed)\n    action: Either 'mapped' (add to panel) or 'dismissed' (ignore)\n    notes: Optional notes about the resolution"},"MarketIntelReport":{"properties":{"drug_class":{"type":"string","title":"Drug Class"},"month":{"type":"string","title":"Month"},"cut_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cut Date"},"doses":{"items":{"$ref":"#/components/schemas/DoseRow"},"type":"array","title":"Doses","default":[]},"spreads":{"items":{"$ref":"#/components/schemas/SpreadRow"},"type":"array","title":"Spreads","default":[]},"alerts":{"items":{"$ref":"#/components/schemas/AlertRow"},"type":"array","title":"Alerts","default":[]},"generics":{"items":{"$ref":"#/components/schemas/GenericsRow"},"type":"array","title":"Generics","default":[]},"disclaimer":{"type":"string","title":"Disclaimer","default":"Reporte de inteligencia de mercado. Uso exclusivo para profesionales de la salud. Informacion agregada de precios privados (no incluye IMSS/ISSSTE/ISSSFAM); precios al corte indicado, pueden variar. No constituye recomendacion de tratamiento ni publicidad de marca."}},"type":"object","required":["drug_class","month"],"title":"MarketIntelReport","description":"The monthly market-intel report read-model (the five blocks)."},"MasterInsightContent":{"properties":{"schema_version":{"type":"integer","title":"Schema Version","default":1},"sections":{"$ref":"#/components/schemas/MasterInsightSections"},"disclaimer":{"type":"string","title":"Disclaimer","default":""},"markers_referenced":{"items":{"type":"string"},"type":"array","title":"Markers Referenced","default":[]},"evidence":{"items":{"$ref":"#/components/schemas/MasterInsightEvidence"},"type":"array","title":"Evidence","default":[]},"raw_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Raw Text"},"goal_frame":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Goal Frame"},"findings":{"items":{"$ref":"#/components/schemas/MasterInsightFinding"},"type":"array","title":"Findings","default":[]},"que_platicar":{"items":{"type":"string"},"type":"array","title":"Que Platicar","default":[]},"hero":{"anyOf":[{"$ref":"#/components/schemas/MasterInsightFinding"},{"type":"null"}]}},"type":"object","required":["sections"],"title":"MasterInsightContent"},"MasterInsightDraft":{"properties":{"status":{"type":"string","title":"Status"},"origin":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Origin"},"pending_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Pending Count"},"version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Version"},"content":{"anyOf":[{"$ref":"#/components/schemas/MasterInsightContent"},{"type":"null"}]},"urgency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Urgency"},"urgency_fired":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"title":"Urgency Fired"},"content_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content Hash"},"markers_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Markers Hash"},"stale":{"type":"boolean","title":"Stale","default":false},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"generated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Generated At"},"approved_by_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Approved By Name"},"approved_by_cedula":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Approved By Cedula"},"approved_justification":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Approved Justification"},"approved_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Approved At"},"gen_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gen Error"}},"type":"object","required":["status"],"title":"MasterInsightDraft","description":"Doctor-facing: the full backbone to review, edit, and sign. Also carries the non-ready\nstates (pending_review / pending_generation / generating / generation_failed)."},"MasterInsightEvidence":{"properties":{"rule_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rule Id"},"marker_ids":{"items":{"type":"string"},"type":"array","title":"Marker Ids","default":[]},"headline":{"type":"string","title":"Headline","default":""},"sentiment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sentiment"},"priority":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Priority"},"pmid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pmid"},"doi":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Doi"}},"type":"object","title":"MasterInsightEvidence","description":"A rules-engine finding the narrative rests on (the deterministic, scalable backbone)."},"MasterInsightFinding":{"properties":{"title":{"type":"string","title":"Title","default":""},"marker_ids":{"items":{"type":"string"},"type":"array","title":"Marker Ids","default":[]},"patient_note":{"type":"string","title":"Patient Note","default":""},"clinical_note":{"type":"string","title":"Clinical Note","default":""},"counter_frame":{"type":"string","title":"Counter Frame","default":""},"evidence":{"items":{"$ref":"#/components/schemas/MasterInsightEvidence"},"type":"array","title":"Evidence","default":[]},"urgency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Urgency"}},"type":"object","title":"MasterInsightFinding","description":"Doctor-facing finding: BOTH voices. `clinical_note` is decision-support (never signed/patient-\nvisible); `patient_note` is the calm, signed text. `counter_frame` fights anchoring."},"MasterInsightPatient":{"properties":{"status":{"type":"string","title":"Status"},"sections":{"anyOf":[{"$ref":"#/components/schemas/MasterInsightSections"},{"type":"null"}]},"goal_frame":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Goal Frame"},"findings":{"items":{"$ref":"#/components/schemas/PatientFinding"},"type":"array","title":"Findings","default":[]},"disclaimer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Disclaimer"},"urgency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Urgency"},"doctor_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Doctor Name"},"approved_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Approved At"},"panel_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Panel Date"}},"type":"object","required":["status"],"title":"MasterInsightPatient","description":"Patient-facing: only the signed, public-safe view (never draft/evidence/protocol/PMIDs)."},"MasterInsightSectionPatch":{"properties":{"resumen_general":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resumen General"},"lo_mas_relevante":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lo Mas Relevante"},"que_platicar_en_consulta":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Que Platicar En Consulta"}},"type":"object","title":"MasterInsightSectionPatch","description":"Doctor inline per-section edit (zero LLM). Only the provided sections are overwritten in\n`content.sections`; `content_original` (the frozen model output) is never touched."},"MasterInsightSections":{"properties":{"resumen_general":{"type":"string","title":"Resumen General","default":""},"lo_mas_relevante":{"type":"string","title":"Lo Mas Relevante","default":""},"que_platicar_en_consulta":{"type":"string","title":"Que Platicar En Consulta","default":""}},"type":"object","title":"MasterInsightSections"},"MeasurementEntry":{"properties":{"date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date"},"weight_kg":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Weight Kg"},"fat_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Fat Pct"},"muscle_kg":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Muscle Kg"},"unit":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Unit"}},"additionalProperties":true,"type":"object","title":"MeasurementEntry"},"MeasurementsResponse":{"properties":{"entries":{"items":{"$ref":"#/components/schemas/MeasurementEntry"},"type":"array","title":"Entries"},"generated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Generated At"}},"type":"object","required":["entries"],"title":"MeasurementsResponse"},"Meta":{"properties":{"generated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Generated At"},"data_age_hours":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Data Age Hours"},"cache_age_sec":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Cache Age Sec"},"pagination":{"anyOf":[{"$ref":"#/components/schemas/Pagination"},{"type":"null"}]},"total_markers":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total Markers"},"total_patients":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total Patients"}},"type":"object","title":"Meta","description":"Response metadata. All fields optional — populate what applies."},"MetabolicAgeComponents":{"properties":{"vo2_age":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Vo2 Age"},"bmr_age":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Bmr Age"},"vascular_age":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Vascular Age"},"hrv_age":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Hrv Age"},"fat_age":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Fat Age"},"signals_used":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Signals Used"}},"additionalProperties":true,"type":"object","title":"MetabolicAgeComponents"},"MoleculeBrief":{"properties":{"slug":{"type":"string","title":"Slug"},"name":{"type":"string","title":"Name"},"drug_class":{"type":"string","title":"Drug Class"},"tier_base":{"type":"string","title":"Tier Base"}},"type":"object","required":["slug","name","drug_class","tier_base"],"title":"MoleculeBrief"},"MuscleGridEntry":{"properties":{"muscle":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Muscle"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"days_since":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Days Since"},"never_trained":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Never Trained"},"fatigue_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Fatigue Score"},"recovery_note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recovery Note"},"ready_in_hours":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Ready In Hours"},"prior_volume":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prior Volume"}},"additionalProperties":false,"type":"object","title":"MuscleGridEntry"},"NutritionLogResponse":{"properties":{"ok":{"type":"boolean","title":"Ok"},"date":{"type":"string","title":"Date"},"saved":{"type":"boolean","title":"Saved"},"calories":{"anyOf":[{},{"type":"null"}],"title":"Calories"},"protein_g":{"anyOf":[{},{"type":"null"}],"title":"Protein G"},"carbs_g":{"anyOf":[{},{"type":"null"}],"title":"Carbs G"},"fat_g":{"anyOf":[{},{"type":"null"}],"title":"Fat G"},"fiber_g":{"anyOf":[{},{"type":"null"}],"title":"Fiber G"},"debug":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Debug"}},"type":"object","required":["ok","date","saved"],"title":"NutritionLogResponse"},"NutritionResponse":{"properties":{"date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date"},"calories":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Calories"},"protein_g":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Protein G"},"carbs_g":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Carbs G"},"fat_g":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Fat G"},"received":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Received"},"tdee":{"anyOf":[{"$ref":"#/components/schemas/TdeeData"},{"type":"null"}]},"generated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Generated At"},"data_age_hours":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Data Age Hours"}},"additionalProperties":true,"type":"object","title":"NutritionResponse"},"NutritionSummary":{"properties":{"weekly_avg_calories":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Weekly Avg Calories"},"days_logged":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Days Logged"},"eta_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Eta Date"}},"type":"object","title":"NutritionSummary"},"OverviewBodyComp":{"properties":{"weight_kg":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Weight Kg"},"fat_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Fat Pct"},"muscle_kg":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Muscle Kg"},"rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Rate"},"eta_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Eta Date"},"change_7d":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Change 7D"},"change_30d":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Change 30D"}},"type":"object","title":"OverviewBodyComp"},"OverviewCalendar":{"properties":{"today":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"title":"Today"},"tomorrow":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"title":"Tomorrow"}},"additionalProperties":true,"type":"object","title":"OverviewCalendar"},"OverviewNutrition":{"properties":{"calories":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Calories"},"protein_g":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Protein G"},"carbs_g":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Carbs G"},"fat_g":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Fat G"}},"additionalProperties":true,"type":"object","title":"OverviewNutrition"},"OverviewRecovery":{"properties":{"score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Score"},"zone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Zone"},"hrv":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Hrv"},"rhr":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Rhr"}},"type":"object","title":"OverviewRecovery"},"OverviewResponse":{"properties":{"recovery":{"$ref":"#/components/schemas/OverviewRecovery"},"sleep":{"$ref":"#/components/schemas/OverviewSleep"},"body_comp":{"$ref":"#/components/schemas/OverviewBodyComp"},"gold_trends":{"$ref":"#/components/schemas/GoldTrends"},"nutrition":{"$ref":"#/components/schemas/OverviewNutrition"},"calendar":{"$ref":"#/components/schemas/OverviewCalendar"},"daily_strain":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Daily Strain"},"generated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Generated At"},"data_age_hours":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Data Age Hours"},"coach_facts":{"anyOf":[{"$ref":"#/components/schemas/CoachFacts"},{"type":"null"}]},"degraded":{"items":{"type":"string"},"type":"array","title":"Degraded"}},"additionalProperties":true,"type":"object","required":["recovery","sleep","body_comp","gold_trends","nutrition","calendar"],"title":"OverviewResponse"},"OverviewSleep":{"properties":{"total_hours":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Total Hours"},"efficiency_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Efficiency Pct"},"trend_7d_hrs":{"items":{"type":"number"},"type":"array","title":"Trend 7D Hrs"}},"type":"object","required":["trend_7d_hrs"],"title":"OverviewSleep"},"Pagination":{"properties":{"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total"}},"type":"object","required":["limit","offset"],"title":"Pagination","description":"Present in `meta` only for collection endpoints."},"PanelCountResponse":{"properties":{"count":{"type":"integer","title":"Count"}},"type":"object","required":["count"],"title":"PanelCountResponse"},"PanelDateCorrection":{"properties":{"date":{"type":"string","format":"date","title":"Date"},"confirmed_as_collection":{"type":"boolean","title":"Confirmed As Collection","default":false}},"type":"object","required":["date"],"title":"PanelDateCorrection","description":"Manual panel-date correction; confirmation is separate from the actor source."},"PanelDateCorrectionResponse":{"properties":{"panel_id":{"type":"string","title":"Panel Id"},"date":{"type":"string","title":"Date"},"date_source":{"type":"string","const":"manual","title":"Date Source","default":"manual"},"date_is_collection":{"type":"boolean","title":"Date Is Collection"},"date_corrected_at":{"type":"string","format":"date-time","title":"Date Corrected At"}},"type":"object","required":["panel_id","date","date_is_collection","date_corrected_at"],"title":"PanelDateCorrectionResponse"},"PanelRecoResponse":{"properties":{"ruleset_version":{"type":"string","title":"Ruleset Version"},"engine":{"type":"string","title":"Engine"},"route_to_doctor":{"type":"boolean","title":"Route To Doctor"},"groups":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Groups","default":[]},"recommended_markers":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Recommended Markers","default":[]},"suggested_panels":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Suggested Panels","default":[]},"panels_summary_es":{"type":"string","title":"Panels Summary Es","default":""},"draw_prep_es":{"items":{"type":"string"},"type":"array","title":"Draw Prep Es","default":[]},"rationale_es":{"type":"string","title":"Rationale Es","default":""},"disclaimer_es":{"type":"string","title":"Disclaimer Es","default":""}},"type":"object","required":["ruleset_version","engine","route_to_doctor"],"title":"PanelRecoResponse"},"PanelRulesEdit":{"properties":{"ruleset_version":{"type":"string","title":"Ruleset Version","default":"panel-rules-2026-06"},"rules":{"items":{"$ref":"#/components/schemas/RuleEdit"},"type":"array","title":"Rules"}},"type":"object","required":["rules"],"title":"PanelRulesEdit"},"PatientFinding":{"properties":{"title":{"type":"string","title":"Title","default":""},"marker_ids":{"items":{"type":"string"},"type":"array","title":"Marker Ids","default":[]},"patient_note":{"type":"string","title":"Patient Note","default":""},"urgency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Urgency"}},"type":"object","title":"PatientFinding","description":"Patient-facing finding: the patient_note ONLY. NEVER clinical_note / counter_frame / evidence."},"PauseResponse":{"properties":{"windows":{"items":{"$ref":"#/components/schemas/PauseWindow"},"type":"array","title":"Windows"},"paused_protocol_ids":{"items":{"type":"string"},"type":"array","title":"Paused Protocol Ids"},"already_open":{"items":{"type":"string"},"type":"array","title":"Already Open"},"generated_at":{"type":"string","title":"Generated At"}},"type":"object","required":["windows","paused_protocol_ids","already_open","generated_at"],"title":"PauseResponse","description":"Batch pause result (POST /v1/protocols/pause).\n\n`windows` carries the OPEN window for each protocol that is now paused —\nthe freshly-opened one, or the pre-existing open window when the call was\nidempotent (that protocol_id is also listed in `already_open`)."},"PauseWindow":{"properties":{"id":{"type":"string","title":"Id"},"protocol_id":{"type":"string","title":"Protocol Id"},"paused_from":{"type":"string","title":"Paused From"},"paused_until":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Paused Until"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"resumed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resumed At"},"freeze_cycle":{"type":"boolean","title":"Freeze Cycle","default":true},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["id","protocol_id","paused_from","created_at"],"title":"PauseWindow"},"PendingMarker":{"properties":{"result_id":{"type":"string","title":"Result Id"},"patient_id":{"type":"string","title":"Patient Id"},"patient_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Patient Name"},"marker_id":{"type":"string","title":"Marker Id"},"marker_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Marker Label"},"printed_name":{"type":"string","title":"Printed Name","default":""},"value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Value"},"value_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Value Text"},"value_qualifier":{"anyOf":[{"type":"string","enum":["lt","lte","gt","gte"]},{"type":"null"}],"title":"Value Qualifier"},"unit":{"type":"string","title":"Unit","default":""},"reference_range":{"$ref":"#/components/schemas/PendingMarkerRange"},"flag":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Flag"},"panel_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Panel Id"},"panel_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Panel Date"},"panel_name":{"type":"string","title":"Panel Name","default":""},"lab_name":{"type":"string","title":"Lab Name","default":""},"pdf_page":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Pdf Page"},"raw_snippet":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Raw Snippet"},"value_corrected_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Value Corrected At"}},"type":"object","required":["result_id","patient_id","marker_id"],"title":"PendingMarker","description":"One pending marker awaiting the doctor's review, flattened across all linked patients.\n\n`flag` is the *confidence disposition* that makes the marker pending (`low_confidence` /\n`llm_resolved`) — the queue's organizing flag and what `?flag=` filters — NOT the clinical\nhigh/low/normal range flag. `printed_name` is the existing `lab_results.original_name` (what\nthe lab printed), reused verbatim: no migration, 100% historical coverage.\n\n`pdf_page` (1-based) and `raw_snippet` are the marker's source provenance, populated by the\nprovenance-aware extractor as of PR-3 (Spec 026 FR-5). They stay null for markers extracted\nbefore PR-3 shipped (historical backfill is PR-3b) and whenever a path could not establish the\npage honestly — the queue renders that as \"sin datos de origen\" rather than sending the doctor\nto a guessed page."},"PendingMarkerRange":{"properties":{"min":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Min"},"max":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Max"}},"type":"object","title":"PendingMarkerRange","description":"Printed reference range for the marker (`lab_results.range_lab_min/max`). Object rather\nthan a string so the frontend formats it; either bound may be null (labs omit one side)."},"PendingMarkersResponse":{"properties":{"markers":{"items":{"$ref":"#/components/schemas/PendingMarker"},"type":"array","title":"Markers"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"}},"type":"object","required":["markers"],"title":"PendingMarkersResponse","description":"A page of pending markers in the deterministic total order\n`panel_date DESC, patient_id, result_id`. `next_cursor` is an opaque keyset token (never an\noffset) — pass it back as `?cursor=` for the next page; null means the last page.\n`meta.total_markers` / `meta.total_patients` are the canonical counts after `patient_id`,\n`panel_id` and `flag` filters. `result_id` is an addressing filter for a deep-link page and\nnever narrows those totals."},"PeptideExperiment":{"properties":{"id":{"type":"string","title":"Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"compound":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Compound"},"condition_treated":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Condition Treated"},"vendor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor"},"dose_mcg":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Dose Mcg"},"dose_unit":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dose Unit"},"frequency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Frequency"},"route":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Route"},"injection_site":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Injection Site"},"reconstitution_notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reconstitution Notes"},"cycle_on_weeks":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Cycle On Weeks"},"cycle_off_weeks":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Cycle Off Weeks"},"start_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Date"},"end_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Date"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},"additionalProperties":true,"type":"object","required":["id"],"title":"PeptideExperiment"},"PeptideExperimentsResponse":{"properties":{"experiments":{"items":{"$ref":"#/components/schemas/PeptideExperiment"},"type":"array","title":"Experiments"},"logs":{"items":{"$ref":"#/components/schemas/PeptideLog"},"type":"array","title":"Logs"}},"type":"object","required":["experiments","logs"],"title":"PeptideExperimentsResponse"},"PeptideLog":{"properties":{"id":{"type":"string","title":"Id"},"experiment_id":{"type":"string","title":"Experiment Id"},"log_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Log Date"},"week_number":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Week Number"},"pain_score":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Pain Score"},"pain_location":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pain Location"},"movements_improved":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Movements Improved"},"movements_limited":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Movements Limited"},"skin_texture_score":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Skin Texture Score"},"skin_areas_assessed":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Skin Areas Assessed"},"skin_firmness_score":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Skin Firmness Score"},"injection_site_reactions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Injection Site Reactions"},"subjective_energy":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Subjective Energy"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"photo_refs":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Photo Refs"}},"additionalProperties":true,"type":"object","required":["id","experiment_id"],"title":"PeptideLog"},"PeptideLogResult":{"properties":{"upserted":{"type":"boolean","title":"Upserted"},"experiment_id":{"type":"string","title":"Experiment Id"},"log_date":{"type":"string","title":"Log Date"}},"type":"object","required":["upserted","experiment_id","log_date"],"title":"PeptideLogResult"},"PeptideLogUpsert":{"properties":{"experiment_id":{"type":"string","title":"Experiment Id"},"log_date":{"type":"string","title":"Log Date"},"week_number":{"type":"integer","title":"Week Number"}},"additionalProperties":true,"type":"object","required":["experiment_id","log_date","week_number"],"title":"PeptideLogUpsert","description":"Upsert body — the log fields plus the keys the unique index needs."},"PermissionUpdateRequest":{"properties":{"permissions":{"items":{"type":"string"},"type":"array","title":"Permissions","description":"Full replacement set of permissions. Each string must be in ALL_PERMISSIONS. Empty list is allowed (revokes everything)."}},"type":"object","required":["permissions"],"title":"PermissionUpdateRequest","description":"Body shape for PATCH /admin/users/{user_id}/permissions."},"PermissionUpdateResponse":{"properties":{"user_id":{"type":"string","title":"User Id"},"permissions":{"items":{"type":"string"},"type":"array","title":"Permissions"}},"type":"object","required":["user_id","permissions"],"title":"PermissionUpdateResponse"},"PresentationBrief":{"properties":{"slug":{"type":"string","title":"Slug"},"brand_id":{"type":"string","title":"Brand Id"},"forma":{"type":"string","title":"Forma"},"unit_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Unit Count"}},"type":"object","required":["slug","brand_id","forma"],"title":"PresentationBrief"},"PriceObservationCreate":{"properties":{"presentation_slug":{"type":"string","title":"Presentation Slug"},"pharmacy_source_slug":{"type":"string","title":"Pharmacy Source Slug"},"precio_efectivo":{"type":"number","title":"Precio Efectivo"},"precio_lista":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Precio Lista"},"precio_promo":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Precio Promo"},"stock_status":{"type":"string","enum":["available","out_of_stock","unknown"],"title":"Stock Status","default":"available"},"canal":{"type":"string","enum":["online","in_store"],"title":"Canal","default":"online"},"captured_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Captured At"},"source_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Url"}},"type":"object","required":["presentation_slug","pharmacy_source_slug","precio_efectivo"],"title":"PriceObservationCreate","description":"Admin payload to load one observed price (the /v1 write surface the\ncapture script in spec 016 will also use)."},"PriceObservationResult":{"properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id"},"presentation_slug":{"type":"string","title":"Presentation Slug"},"pharmacy_source_slug":{"type":"string","title":"Pharmacy Source Slug"},"precio_efectivo":{"type":"number","title":"Precio Efectivo"}},"type":"object","required":["presentation_slug","pharmacy_source_slug","precio_efectivo"],"title":"PriceObservationResult"},"PriceQuote":{"properties":{"source":{"type":"string","title":"Source"},"precio_efectivo":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Precio Efectivo"},"precio_lista":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Precio Lista"},"precio_promo":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Precio Promo"},"price_per_unit":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Price Per Unit"},"stock_status":{"type":"string","title":"Stock Status","default":"unknown"},"canal":{"type":"string","title":"Canal","default":"online"},"captured_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Captured At"},"days_since_verified":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Days Since Verified"},"source_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Url"}},"type":"object","required":["source"],"title":"PriceQuote","description":"One pharmacy's most recent observed price for a presentation."},"PrimaryRecommendation":{"properties":{"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"workout_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workout Type"},"priority_muscles":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Priority Muscles"},"avoid_muscles":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Avoid Muscles"},"volume_modifier":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Volume Modifier"},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence"},"routine_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Routine Name"},"rationale":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rationale"},"equipment_needed":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Equipment Needed"},"muscle_profile":{"anyOf":[{"additionalProperties":{"type":"number"},"type":"object"},{"type":"null"}],"title":"Muscle Profile"}},"additionalProperties":false,"type":"object","title":"PrimaryRecommendation"},"Problem":{"properties":{"type":{"type":"string","title":"Type","default":"about:blank"},"title":{"type":"string","title":"Title"},"status":{"type":"integer","title":"Status"},"detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Detail"},"code":{"type":"string","title":"Code"}},"type":"object","required":["title","status","code"],"title":"Problem","description":"RFC 7807 problem detail."},"ProtocolContext":{"properties":{"gh_active":{"type":"boolean","title":"Gh Active"},"gh_washout":{"type":"boolean","title":"Gh Washout"},"gh_washout_day":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Gh Washout Day"},"glp1_active":{"type":"boolean","title":"Glp1 Active"},"glp1_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Glp1 Type"},"on_trt":{"type":"boolean","title":"On Trt","default":false},"trt_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trt Type"},"trt_start_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trt Start Date"},"on_statin":{"type":"boolean","title":"On Statin"},"statin_start_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Statin Start Date"},"on_metformin":{"type":"boolean","title":"On Metformin"},"on_creatine":{"type":"boolean","title":"On Creatine"},"on_ashwagandha":{"type":"boolean","title":"On Ashwagandha"},"ashwagandha_washout":{"type":"boolean","title":"Ashwagandha Washout"},"last_heavy_training_hours_ago":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Last Heavy Training Hours Ago"}},"type":"object","required":["gh_active","gh_washout","glp1_active","on_statin","on_metformin","on_creatine","on_ashwagandha","ashwagandha_washout"],"title":"ProtocolContext"},"ProtocolCreate":{"properties":{"compound_id":{"type":"string","title":"Compound Id"},"dose_amount":{"type":"number","title":"Dose Amount"},"dose_unit":{"type":"string","title":"Dose Unit"},"frequency":{"type":"string","title":"Frequency"},"scheduled_time":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scheduled Time"},"start_date":{"type":"string","format":"date","title":"Start Date"},"end_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"End Date"},"category":{"type":"string","title":"Category"},"reconstitution_vial_mg":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Reconstitution Vial Mg"},"reconstitution_volume_ml":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Reconstitution Volume Ml"},"injection_mode":{"anyOf":[{"type":"string","enum":["rotational","localized"]},{"type":"null"}],"title":"Injection Mode"},"cycle_number":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Cycle Number"},"has_loading_phase":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Has Loading Phase"},"loading_weeks":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Loading Weeks"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"formulation":{"anyOf":[{"type":"string","enum":["IR","XR"]},{"type":"null"}],"title":"Formulation"}},"type":"object","required":["compound_id","dose_amount","dose_unit","frequency","start_date","category"],"title":"ProtocolCreate"},"ProtocolListResponse":{"properties":{"protocols":{"items":{"$ref":"#/components/schemas/ProtocolRow"},"type":"array","title":"Protocols"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["protocols","count"],"title":"ProtocolListResponse"},"ProtocolPauseRequest":{"properties":{"protocol_ids":{"items":{"type":"string"},"type":"array","title":"Protocol Ids"},"paused_from":{"type":"string","format":"date","title":"Paused From"},"paused_until":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Paused Until"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"freeze_cycle":{"type":"boolean","title":"Freeze Cycle","default":true}},"type":"object","required":["protocol_ids","paused_from"],"title":"ProtocolPauseRequest","description":"Batch travel-pause primitive (POST /v1/protocols/pause).\n\nOpens ONE pause window per protocol_id (D9). `paused_until=None` is an\nopen-ended pause (manual resume); a date is a fixed window that auto-resumes\nin the nightly reconcile (D11)."},"ProtocolRow":{"properties":{"id":{"type":"string","title":"Id"},"compound_id":{"type":"string","title":"Compound Id"},"compound_name":{"type":"string","title":"Compound Name"},"compound_class":{"type":"string","title":"Compound Class"},"dose_amount":{"type":"number","title":"Dose Amount"},"dose_unit":{"type":"string","title":"Dose Unit"},"frequency":{"type":"string","title":"Frequency"},"scheduled_time":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scheduled Time"},"start_date":{"type":"string","title":"Start Date"},"end_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Date"},"status":{"type":"string","title":"Status"},"category":{"type":"string","title":"Category"},"reconstitution_vial_mg":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Reconstitution Vial Mg"},"reconstitution_volume_ml":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Reconstitution Volume Ml"},"reconstitution_concentration_mg_per_ml":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Reconstitution Concentration Mg Per Ml"},"cycle_number":{"type":"integer","title":"Cycle Number","default":1},"has_loading_phase":{"type":"boolean","title":"Has Loading Phase","default":true},"loading_weeks":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Loading Weeks"},"formulation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Formulation"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"}},"type":"object","required":["id","compound_id","compound_name","compound_class","dose_amount","dose_unit","frequency","scheduled_time","start_date","end_date","status","category","reconstitution_vial_mg","reconstitution_volume_ml","reconstitution_concentration_mg_per_ml","notes","created_at","updated_at"],"title":"ProtocolRow","description":"Protocol row joined with compound details."},"ProtocolStackResponse":{"properties":{"protocols":{"items":{"$ref":"#/components/schemas/StackProtocol"},"type":"array","title":"Protocols"},"recent_completed":{"items":{"$ref":"#/components/schemas/RecentCompletedProtocol"},"type":"array","title":"Recent Completed"},"compounds":{"items":{"$ref":"#/components/schemas/StackCompoundDetail"},"type":"array","title":"Compounds"},"doses":{"items":{"$ref":"#/components/schemas/StackDose"},"type":"array","title":"Doses"},"generated_at":{"type":"string","title":"Generated At"}},"type":"object","required":["protocols","compounds","doses","generated_at"],"title":"ProtocolStackResponse"},"ProtocolState":{"properties":{},"additionalProperties":true,"type":"object","title":"ProtocolState","description":"Protocol-state blob (dynamic)."},"ProtocolStateUpdateResult":{"properties":{"updated":{"items":{"type":"string"},"type":"array","title":"Updated"}},"type":"object","required":["updated"],"title":"ProtocolStateUpdateResult"},"ProtocolUpdate":{"properties":{"status":{"anyOf":[{"type":"string","enum":["active","paused","completed","discontinued"]},{"type":"null"}],"title":"Status"},"end_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"End Date"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"dose_amount":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Dose Amount"},"dose_unit":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dose Unit"},"frequency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Frequency"},"scheduled_time":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scheduled Time"},"category":{"anyOf":[{"type":"string","enum":["medication","peptide","supplement"]},{"type":"null"}],"title":"Category"},"reconstitution_vial_mg":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Reconstitution Vial Mg"},"reconstitution_volume_ml":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Reconstitution Volume Ml"},"injection_mode":{"anyOf":[{"type":"string","enum":["rotational","localized"]},{"type":"null"}],"title":"Injection Mode"},"cycle_number":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Cycle Number"},"formulation":{"anyOf":[{"type":"string","enum":["IR","XR"]},{"type":"null"}],"title":"Formulation"}},"type":"object","title":"ProtocolUpdate","description":"Editable fields for PATCH /v1/protocols/{id} (spec 013 — protocol editor).\n\nstatus/category are constrained to the DB CHECK values so a bad value is a 422,\nnot a 500 (and never corrupts the brief's category classification). Ending a\nprotocol uses status='discontinued' (or 'completed'); there is no 'ended' status.\nreconstitution_concentration_mg_per_ml is a GENERATED column — read-only, never\nwritten here. cycle_number mirrors ProtocolCreate and must be an integer >= 1."},"ProtocolVialResetRequest":{"properties":{"starting_vial_mg":{"type":"number","title":"Starting Vial Mg"}},"type":"object","required":["starting_vial_mg"],"title":"ProtocolVialResetRequest"},"ProviderError":{"properties":{"provider":{"type":"string","title":"Provider"},"error":{"type":"string","title":"Error"},"message":{"type":"string","title":"Message"},"can_reconnect":{"type":"boolean","title":"Can Reconnect","default":false}},"type":"object","required":["provider","error","message"],"title":"ProviderError","description":"ARCH-052 structured provider error inside a refresh response."},"Readiness":{"properties":{"score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Score"},"zone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Zone"},"volume_modifier":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Volume Modifier"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},"additionalProperties":false,"type":"object","title":"Readiness"},"RecentCompletedProtocol":{"properties":{"protocol_id":{"type":"string","title":"Protocol Id"},"compound_id":{"type":"string","title":"Compound Id"},"name":{"type":"string","title":"Name"},"formulation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Formulation"},"dose_amount":{"type":"number","title":"Dose Amount"},"dose_unit":{"type":"string","title":"Dose Unit"},"frequency":{"type":"string","title":"Frequency"},"start_date":{"type":"string","title":"Start Date"},"end_date":{"type":"string","title":"End Date"},"status":{"type":"string","title":"Status"}},"type":"object","required":["protocol_id","compound_id","name","dose_amount","dose_unit","frequency","start_date","end_date","status"],"title":"RecentCompletedProtocol"},"RecentWorkout":{"properties":{"date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"duration_min":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Duration Min"},"total_volume_lbs":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Total Volume Lbs"}},"additionalProperties":false,"type":"object","title":"RecentWorkout"},"RecommendationResponse":{"properties":{"available":{"type":"boolean","title":"Available"},"is_stale":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Stale"},"has_newer_workout":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Has Newer Workout"},"generated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Generated At"},"modality":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Modality"}},"additionalProperties":true,"type":"object","required":["available"],"title":"RecommendationResponse","description":"Response for GET /v1/training/recommendation.\n\nReturns {\"available\": false} when no recommendation exists, or the full\nrecommendation payload with dynamic fatigue/readiness fields."},"RecoveryAvg":{"properties":{"score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Score"},"hrv":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Hrv"},"rhr":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Rhr"}},"type":"object","title":"RecoveryAvg"},"RecoveryContext":{"properties":{"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"expected_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expected Date"},"recovery_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recovery Date"},"recovery_sleep_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recovery Sleep Id"},"latest_available_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Latest Available Date"}},"additionalProperties":false,"type":"object","title":"RecoveryContext","description":"Which recovery row graded `readiness` (shape_version >= 2).\n\nstatus: \"current\" = the expected local day's scored row; \"missing\" = no\nscored row for that day yet, so readiness is the no-recovery baseline (an\nearlier day's score is never used); \"unavailable\" = the read failed.\nreason: None when current; \"not_yet_scored\" / \"link_unavailable\" (the\nday's sleep carries no Whoop sleep id to link a recovery by) /\n\"link_ambiguous\" (the persisted rows cannot prove the link) when missing;\n\"read_failed\" when unavailable.\nrecovery_sleep_id: the Whoop sleep id the used recovery row is linked by\n(None unless current)."},"RecoveryDay":{"properties":{"date":{"type":"string","title":"Date"},"recovery":{"anyOf":[{"$ref":"#/components/schemas/RecoveryScore"},{"type":"null"}]},"sleep":{"anyOf":[{"$ref":"#/components/schemas/SleepMetrics"},{"type":"null"}]},"strain":{"anyOf":[{"$ref":"#/components/schemas/StrainMetrics"},{"type":"null"}]}},"type":"object","required":["date"],"title":"RecoveryDay"},"RecoveryHrvBaseline":{"properties":{"mean":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Mean"},"stdev":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Stdev"},"cv_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cv Pct"},"window_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Window Days"},"n":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"N"}},"type":"object","title":"RecoveryHrvBaseline","description":"ADDITIVE display metric (Lot A) — individual rolling HRV baseline + its\ncoefficient of variation over a window. METRIC ONLY: nothing here feeds the\nreadiness score or any training/recovery recommendation."},"RecoveryIllnessFlag":{"properties":{"elevated":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Elevated"},"skin_temp_elevated":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Skin Temp Elevated"},"respiratory_elevated":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Respiratory Elevated"},"hrv_suppressed":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Hrv Suppressed"},"signals":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Signals"},"evaluated_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Evaluated Date"},"unavailable_signals":{"items":{"type":"string"},"type":"array","title":"Unavailable Signals"}},"type":"object","title":"RecoveryIllnessFlag","description":"DISPLAY-ONLY, NON-GATING illness heuristic (Lot A). Nothing consumes this\nfor a training or recovery DECISION — it is a surfaced metric only. Sub-signals\nfire on skin_temp elevated vs baseline, respiratory_rate elevated vs baseline,\nand HRV suppressed vs baseline; `elevated` is a purely informational composite."},"RecoveryScore":{"properties":{"score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Score"},"hrv_rmssd_milli":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Hrv Rmssd Milli"},"resting_heart_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Resting Heart Rate"},"spo2_percentage":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Spo2 Percentage"},"skin_temp_celsius":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Skin Temp Celsius"},"zone":{"type":"string","title":"Zone","default":"unknown"}},"type":"object","title":"RecoveryScore"},"RecoverySkinRespCoDeviation":{"properties":{"status":{"type":"string","title":"Status"},"elevated":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Elevated"},"skin_temp_deviation_c":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Skin Temp Deviation C"},"respiratory_rate_deviation_rpm":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Respiratory Rate Deviation Rpm"},"skin_temp_baseline_n":{"type":"integer","title":"Skin Temp Baseline N"},"respiratory_rate_baseline_n":{"type":"integer","title":"Respiratory Rate Baseline N"},"window_days":{"type":"integer","title":"Window Days"},"minimum_baseline_days":{"type":"integer","title":"Minimum Baseline Days"},"evaluated_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Evaluated Date"}},"type":"object","required":["status","skin_temp_baseline_n","respiratory_rate_baseline_n","window_days","minimum_baseline_days"],"title":"RecoverySkinRespCoDeviation","description":"Strict, display-only skin-temperature + respiratory-rate co-deviation."},"RecoverySleep":{"properties":{"total_hours":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Total Hours"},"light_min":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Light Min"},"rem_min":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Rem Min"},"deep_min":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Deep Min"},"awake_min":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Awake Min"},"efficiency_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Efficiency Pct"},"rem_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Rem Pct"},"deep_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Deep Pct"},"rem_pct_avg_7d":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Rem Pct Avg 7D"},"deep_pct_avg_7d":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Deep Pct Avg 7D"},"respiratory_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Respiratory Rate"}},"type":"object","title":"RecoverySleep"},"RefreshIngestStatus":{"properties":{"whoop":{"$ref":"#/components/schemas/SourceIngestStatus"},"hevy":{"$ref":"#/components/schemas/SourceIngestStatus"},"withings":{"$ref":"#/components/schemas/SourceIngestStatus"}},"type":"object","required":["whoop","hevy","withings"],"title":"RefreshIngestStatus","description":"Source ingest outcomes keyed by provider."},"ReportArtifact":{"properties":{"tier":{"type":"string","title":"Tier"},"signature_state":{"type":"string","title":"Signature State"},"cta_state":{"type":"string","title":"Cta State","default":"checkout_pending"},"cover":{"$ref":"#/components/schemas/ReportCover"},"goal_frame":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Goal Frame"},"hero":{"anyOf":[{"$ref":"#/components/schemas/ReportFinding"},{"type":"null"}]},"secondary":{"$ref":"#/components/schemas/SecondaryFindingsSection","default":{"locked":false,"count":0,"findings":[]}},"comparativa":{"$ref":"#/components/schemas/ComparativaSection","default":{"available":false,"locked":false,"count":0,"markers":[]}},"grid":{"items":{"$ref":"#/components/schemas/MarkerCategoryGroup"},"type":"array","title":"Grid","default":[]},"por_verificar":{"items":{"$ref":"#/components/schemas/VerifyMarker"},"type":"array","title":"Por Verificar","default":[]},"consult":{"$ref":"#/components/schemas/ConsultSection","default":{"locked":false,"count":0,"questions":[]}},"upsell":{"anyOf":[{"$ref":"#/components/schemas/UpsellCard"},{"type":"null"}]},"disclaimer":{"type":"string","title":"Disclaimer","default":""},"folio":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Folio"},"analysis_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Analysis Version"},"generated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Generated At"}},"type":"object","required":["tier","signature_state","cover"],"title":"ReportArtifact","description":"The full sectioned read-model. `signature_state` mirrors the patient insight endpoint\n(signed | preliminary | reviewing | generating | unavailable | pending)."},"ReportCover":{"properties":{"panel_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Panel Date"},"lab_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lab Name"},"goal_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Goal Label"},"context":{"anyOf":[{"$ref":"#/components/schemas/ReportCoverContext"},{"type":"null"}]},"signed":{"type":"boolean","title":"Signed","default":false},"doctor_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Doctor Name"},"doctor_cedula":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Doctor Cedula"},"approved_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Approved At"}},"type":"object","title":"ReportCover","description":"Section 0. Signature fields are populated only for signed reports."},"ReportCoverContext":{"properties":{"sex_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sex Label"},"age_years":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Age Years"},"conditions":{"items":{"type":"string"},"type":"array","title":"Conditions","default":[]},"protocols":{"items":{"type":"string"},"type":"array","title":"Protocols","default":[]}},"type":"object","title":"ReportCoverContext","description":"The context this reading was INTERPRETED IN, for the clinical-handoff block on the cover.\n\nThe cover is the page a doctor reads in thirty seconds before deciding whether the\ninterpretation is worth anything, and the two things he needs first are who the patient is\n(reference ranges are sex-stratified -- `master_insight._resolve_optimal_range` takes sex and\nage precisely because of that) and what context the reading was made in.\n\nDECLARED, NOT VERIFIED. Every field here comes from what the patient answered at intake. It\nis not a prescription, not a chart and not a diagnosis somebody recorded, and the rendered\nblock says so in the word `Declarado:`. Same distinction as `cedula_claimed` vs `cedula`\n(PR #272): a self-declaration NAMES, it does not accredit. A client rendering this must keep\nthat marker; dropping it turns a self-report into a claim Clarys cannot support.\n\nFROZEN AT GENERATION. Sourced from `clarys_master_insight.context_snapshot`, written when the\nreading was generated. Never from the live intake -- see that column's migration for why a\nlive read cannot even be checked for staleness. Every field is therefore ABSENT rather than\nstale on a reading generated before the snapshot existed.\n\nLABELS, NOT TOKENS, and the closed vocabulary lives in `engine.declared_context`. A token\nwith no Spanish label is counted (\"otra condición\"), never printed as its English identifier."},"ReportFinding":{"properties":{"title":{"type":"string","title":"Title","default":""},"marker_ids":{"items":{"type":"string"},"type":"array","title":"Marker Ids","default":[]},"patient_note":{"type":"string","title":"Patient Note","default":""},"urgency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Urgency"}},"type":"object","title":"ReportFinding","description":"Patient voice ONLY (same redaction as PatientFinding): never clinical_note/evidence."},"ReportMarker":{"properties":{"marker_id":{"type":"string","title":"Marker Id"},"name":{"type":"string","title":"Name"},"value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Value"},"value_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Value Text"},"value_qualifier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Value Qualifier"},"unit":{"type":"string","title":"Unit","default":""},"status":{"type":"string","title":"Status","default":"not_assessed"},"range_optimal_min":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Range Optimal Min"},"range_optimal_max":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Range Optimal Max"}},"type":"object","required":["marker_id","name"],"title":"ReportMarker","description":"One trusted marker in the full grid (high-confidence or doctor-resolved)."},"RequestChangesRequest":{"properties":{"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"}},"type":"object","title":"RequestChangesRequest"},"ResolveMarkersRequest":{"properties":{"resolutions":{"items":{"$ref":"#/components/schemas/MarkerResolution"},"type":"array","title":"Resolutions","description":"List of marker resolutions"}},"type":"object","required":["resolutions"],"title":"ResolveMarkersRequest","description":"Request model for resolving flagged markers.\n\nAttributes:\n    resolutions: List of marker resolutions"},"ResolveMarkersResponse":{"properties":{"upload_id":{"type":"string","title":"Upload Id","description":"ID of the upload that was resolved"},"status":{"$ref":"#/components/schemas/UploadStatus","description":"Upload status (unchanged by /resolve post-redesign; typically 'completed')"},"markers_added":{"type":"integer","minimum":0.0,"title":"Markers Added","description":"Number of markers inserted into the panel"},"markers_dismissed":{"type":"integer","minimum":0.0,"title":"Markers Dismissed","description":"Number of markers dismissed"}},"type":"object","required":["upload_id","status","markers_added","markers_dismissed"],"title":"ResolveMarkersResponse","description":"Response model for marker resolution endpoint.\n\nAttributes:\n    upload_id: ID of the upload that was resolved\n    status: Upload status echo (unchanged by /resolve since the\n        redesign-clarys-upload-pipeline 2026-05-23 — typically 'completed')\n    markers_added: Number of markers inserted into the panel\n    markers_dismissed: Number of markers dismissed"},"ResumeResponse":{"properties":{"protocol_id":{"type":"string","title":"Protocol Id"},"status":{"type":"string","title":"Status"},"window":{"anyOf":[{"$ref":"#/components/schemas/PauseWindow"},{"type":"null"}]},"generated_at":{"type":"string","title":"Generated At"}},"type":"object","required":["protocol_id","status","generated_at"],"title":"ResumeResponse"},"RetrospectiveEntry":{"properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id"},"date":{"type":"string","title":"Date"},"recorded_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recorded At"},"mood":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Mood"},"stress":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Stress"},"energy":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Energy"},"mental_fatigue":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Mental Fatigue"},"anxiety":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Anxiety"},"body_pain":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Body Pain"},"diet_followed":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Diet Followed"},"trained":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trained"},"activity_level":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Activity Level"},"biggest_win":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Biggest Win"},"something_hard":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Something Hard"},"improve_tomorrow":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Improve Tomorrow"},"sleep_target":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sleep Target"},"highlight":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Highlight"}},"type":"object","required":["date"],"title":"RetrospectiveEntry","description":"A daily_retrospective row."},"RetrospectiveUpdate":{"properties":{"date":{"type":"string","title":"Date"},"mood":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Mood"},"stress":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Stress"},"energy":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Energy"},"mental_fatigue":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Mental Fatigue"},"anxiety":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Anxiety"},"body_pain":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Body Pain"},"diet_followed":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Diet Followed"},"trained":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trained"},"activity_level":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Activity Level"},"biggest_win":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Biggest Win"},"something_hard":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Something Hard"},"improve_tomorrow":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Improve Tomorrow"},"sleep_target":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sleep Target"},"highlight":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Highlight"}},"type":"object","required":["date"],"title":"RetrospectiveUpdate","description":"Upsert body — the date plus any subset of writable fields."},"RetrospectiveUpdateResult":{"properties":{"updated":{"items":{"type":"string"},"type":"array","title":"Updated"}},"type":"object","required":["updated"],"title":"RetrospectiveUpdateResult"},"RuleEdit":{"properties":{"trigger_kind":{"type":"string","title":"Trigger Kind"},"trigger_key":{"type":"string","title":"Trigger Key"},"marker_id":{"type":"string","title":"Marker Id"},"tier":{"type":"string","title":"Tier","default":"recommended"},"reason_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason Code"},"active":{"type":"boolean","title":"Active","default":true}},"type":"object","required":["trigger_kind","trigger_key","marker_id"],"title":"RuleEdit"},"ScheduleHistoryResponse":{"properties":{"protocol_id":{"type":"string","title":"Protocol Id"},"versions":{"items":{"$ref":"#/components/schemas/ScheduleVersion"},"type":"array","title":"Versions"},"generated_at":{"type":"string","title":"Generated At"}},"type":"object","required":["protocol_id","versions","generated_at"],"title":"ScheduleHistoryResponse"},"ScheduleVersion":{"properties":{"id":{"type":"string","title":"Id"},"protocol_id":{"type":"string","title":"Protocol Id"},"effective_from":{"type":"string","title":"Effective From"},"effective_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Effective To"},"dose_amount":{"type":"number","title":"Dose Amount"},"dose_unit":{"type":"string","title":"Dose Unit"},"frequency":{"type":"string","title":"Frequency"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["id","protocol_id","effective_from","dose_amount","dose_unit","frequency","created_at"],"title":"ScheduleVersion"},"SecondaryFindingsSection":{"properties":{"locked":{"type":"boolean","title":"Locked","default":false},"count":{"type":"integer","title":"Count","default":0},"findings":{"items":{"$ref":"#/components/schemas/ReportFinding"},"type":"array","title":"Findings","default":[]}},"type":"object","title":"SecondaryFindingsSection","description":"Findings beyond the hero. Free tier: locked=True, count set, findings=[]."},"SetDetail":{"properties":{"index":{"type":"integer","title":"Index"},"set_type":{"type":"string","title":"Set Type"},"weight_lbs":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Weight Lbs"},"reps":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Reps"},"rpe":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Rpe"},"duration_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Seconds"}},"type":"object","required":["index","set_type"],"title":"SetDetail"},"ShareCreateRequest":{"properties":{"expires_in_days":{"anyOf":[{"type":"integer","maximum":365.0,"minimum":1.0},{"type":"null"}],"title":"Expires In Days"},"never_expires":{"type":"boolean","title":"Never Expires","default":false}},"type":"object","title":"ShareCreateRequest","description":"Optional body for POST /v1/reports/{panel_id}/share. Omitted entirely (the common case)\nmeans the default TTL. `never_expires` is the explicit opt-out for a link that must outlive\nit; it is deliberately a separate flag rather than a magic `expires_in_days` value, so an\nunbounded link is always a stated intent and never a typo."},"ShareLink":{"properties":{"token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"revoked":{"type":"boolean","title":"Revoked","default":false},"active":{"type":"boolean","title":"Active","default":false},"state":{"type":"string","enum":["created","existing","revoked"],"title":"State","default":"created"},"expires_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expires At"}},"type":"object","title":"ShareLink","description":"A revocable read-only share link for a report (spec 006 phase 2). The token is opaque\nand high-entropy; `url` is the public viewer URL. `created_at` is when it was minted.\n\n`token`/`url` carry a value ONLY in the response that MINTS the link, and are NULL otherwise\n-- never an empty string, which a client would happily render as a broken \"/r/\" URL. The\nbackend stores a digest rather than the token, so an already-active link can never be\nre-displayed; the owner revokes to mint a fresh one.\n\n`state` says which of the three cases this is, because `active` alone cannot: it is True both\nfor a link just minted and for an existing one whose token is withheld.\n  created  -- minted by THIS request; `token`/`url` are populated, and this is the only\n              response that will ever carry them\n  existing -- a link was already active; token withheld\n  revoked  -- the link was just revoked\n`expires_at` is when the link stops rendering (None = never expires)."},"SleepMetrics":{"properties":{"id":{"anyOf":[{},{"type":"null"}],"title":"Id"},"start":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start"},"end":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End"},"duration_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Seconds"},"disturbance_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Disturbance Count"},"efficiency_percentage":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Efficiency Percentage"},"respiratory_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Respiratory Rate"},"stage_summary":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Stage Summary"},"is_nap":{"type":"boolean","title":"Is Nap","default":false}},"type":"object","title":"SleepMetrics"},"SleepTimingConsistencyProxy":{"properties":{"bedtime_mean_local":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bedtime Mean Local"},"bedtime_stdev_min":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Bedtime Stdev Min"},"waketime_mean_local":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Waketime Mean Local"},"waketime_stdev_min":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Waketime Stdev Min"},"window_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Window Days"},"n":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"N"}},"type":"object","title":"SleepTimingConsistencyProxy","description":"DISPLAY-ONLY, non-gating proxy for sleep regularity.\nDoes not feed readiness/training recommendations. Simplified timing variability, not the\nepoch-level regularity index; no mortality validation is claimed.\nDefault window: 21 local calendar days, minimum 5 valid nights.\nIncludes today and the preceding 20 days; excludes earlier and future dates."},"SourceBrief":{"properties":{"slug":{"type":"string","title":"Slug"},"name":{"type":"string","title":"Name"},"activo":{"type":"boolean","title":"Activo","default":true}},"type":"object","required":["slug","name"],"title":"SourceBrief"},"SourceIngestStatus":{"properties":{"status":{"type":"string","enum":["success","partial","failed","skipped"],"title":"Status"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"kind":{"anyOf":[{"type":"string","enum":["credential_rejected","refresh_token_lost","transient","token_expired","api_error"]},{"type":"null"}],"title":"Kind"}},"type":"object","required":["status"],"title":"SourceIngestStatus","description":"Per-source ingest outcome for the refresh response."},"SpreadRow":{"properties":{"molecule":{"type":"string","title":"Molecule"},"min_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Min Price"},"max_price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Max Price"},"spread":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Spread"}},"type":"object","required":["molecule"],"title":"SpreadRow"},"StackCompoundDetail":{"properties":{"compound_id":{"type":"string","title":"Compound Id"},"name":{"type":"string","title":"Name"},"pk_data_available":{"type":"boolean","title":"Pk Data Available"},"pk_confidence":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pk Confidence"},"pk_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pk Source"},"t_half_hours":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"T Half Hours"},"tmax_hours":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Tmax Hours"},"t_half_serum_hours":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"T Half Serum Hours"},"t_effect_hours":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"T Effect Hours"},"t_half_confidence":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"T Half Confidence"},"t_half_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"T Half Source"},"bioavailability_note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bioavailability Note"},"warnings":{"items":{"type":"string"},"type":"array","title":"Warnings"}},"type":"object","required":["compound_id","name","pk_data_available"],"title":"StackCompoundDetail"},"StackDose":{"properties":{"id":{"type":"string","title":"Id"},"protocol_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Protocol Id"},"compound_id":{"type":"string","title":"Compound Id"},"compound_name":{"type":"string","title":"Compound Name"},"taken_at":{"type":"string","title":"Taken At"},"dose_amount":{"type":"number","title":"Dose Amount"},"dose_unit":{"type":"string","title":"Dose Unit"},"route_type":{"type":"string","title":"Route Type","default":""},"injection_site":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Injection Site"},"lot_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lot Number"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"skipped":{"type":"boolean","title":"Skipped","default":false},"skip_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Skip Reason"}},"type":"object","required":["id","compound_id","compound_name","taken_at","dose_amount","dose_unit"],"title":"StackDose"},"StackProtocol":{"properties":{"protocol_id":{"type":"string","title":"Protocol Id"},"compound_id":{"type":"string","title":"Compound Id"},"dose_amount":{"type":"number","title":"Dose Amount"},"dose_unit":{"type":"string","title":"Dose Unit"},"frequency":{"type":"string","title":"Frequency"},"start_date":{"type":"string","title":"Start Date"},"end_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Date"},"status":{"type":"string","title":"Status"},"cycle_number":{"type":"integer","title":"Cycle Number","default":1},"has_loading_phase":{"type":"boolean","title":"Has Loading Phase","default":true},"loading_weeks":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Loading Weeks"},"formulation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Formulation"},"scheduled_today":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Scheduled Today"}},"type":"object","required":["protocol_id","compound_id","dose_amount","dose_unit","frequency","start_date","status"],"title":"StackProtocol"},"StatusResponse":{"properties":{"status":{"type":"string","title":"Status"},"last_refresh":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Last Refresh"},"apis":{"$ref":"#/components/schemas/ApiStatus"},"user_isolation_strict":{"type":"boolean","title":"User Isolation Strict","description":"True when a request that reaches the data layer without an established identity FAILS instead of falling back to the SUPABASE_USER_ID env var. Strict is the default; only setting STRICT_USER_ID to exactly \"0\" turns it off. This is the value of the same predicate engine/supabase_client.get_user_id() decides with, so it cannot drift from the control it describes. It reports that the guard is ARMED, not that isolation has been verified end to end. Never carries the env value itself, a user id, or any secret."}},"type":"object","required":["status","apis","user_isolation_strict"],"title":"StatusResponse","description":"GET /status.\n\n`last_refresh` is the stored RefreshResponse-shaped dict (or null). It\nis typed as a loose object so it passes through verbatim — wrapping it\nin RefreshResponse would re-add an `errors: null` key that the stored\nvalue omits, breaking byte-identical output. The key is always present\n(null when no refresh has run), matching the original handler.\n\n`user_isolation_strict` reports the live strict-mode predicate so the\nrunning container is the source of truth for it instead of prose in the\ndocs. It sits here (JWT-required) rather than on the public /health\npayload on purpose — see the handler comment in routers/system.py."},"StrainMetrics":{"properties":{"id":{"anyOf":[{},{"type":"null"}],"title":"Id"},"score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Score"},"avg_heart_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Heart Rate"},"max_heart_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Max Heart Rate"},"kilojoule":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Kilojoule"},"start":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start"},"end":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End"}},"type":"object","title":"StrainMetrics"},"SyncProfileErrorItem":{"properties":{"routine_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Routine Id"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"block_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Block Id"}},"type":"object","title":"SyncProfileErrorItem"},"SyncProfilesData":{"properties":{"updated":{"type":"integer","title":"Updated"},"unchanged":{"type":"integer","title":"Unchanged"},"errors":{"items":{"$ref":"#/components/schemas/SyncProfileErrorItem"},"type":"array","title":"Errors"}},"type":"object","required":["updated","unchanged","errors"],"title":"SyncProfilesData"},"SyncProfilesRequest":{"properties":{"block_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Block Id","description":"Optional training block ID to sync. Defaults to active block."}},"type":"object","title":"SyncProfilesRequest","description":"Optional body for POST /v1/admin/training/sync-profiles."},"TdeeCrossWindow":{"properties":{"available":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Available"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"current_window_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Current Window Days"},"trend_window_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Trend Window Days"},"current_window_kcal":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Current Window Kcal"},"trend_window_kcal":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Trend Window Kcal"},"trend_window_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trend Window Reason"},"disagreement_kcal":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Disagreement Kcal"},"prior_segment":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Prior Segment"}},"additionalProperties":true,"type":"object","title":"TdeeCrossWindow","description":"Spec 036 / FR-005 — cross-window empirical disagreement (ADDITIVE).\n\nA UI renders three distinct states from this block:\n  - AGREE     -> ``available is True`` and ``disagreement_kcal`` is small.\n  - DIVERGE   -> ``available is True`` and ``disagreement_kcal`` is large\n                 (fluid is moving; today's number does not mean what it looks\n                 like). ``disagreement_kcal = current_window_kcal -\n                 trend_window_kcal``; negative means the short window reads\n                 lower than the long one.\n  - UNAVAILABLE -> ``available is False`` (with a ``reason``) OR the whole\n                 block is absent. MUST be treated as explicitly unavailable,\n                 never silently degraded to \"agree\" — the engine withholds\n                 the number (``trend_window_kcal=None``) rather than publish\n                 a stand-in when the comparison could not be computed."},"TdeeCurrent":{"properties":{"logging_state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Logging State"},"logging":{"anyOf":[{"$ref":"#/components/schemas/TdeeLogging"},{"type":"null"}]},"cross_window":{"anyOf":[{"$ref":"#/components/schemas/TdeeCrossWindow"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"TdeeCurrent","description":"The ``current`` block of the TDEE payload — trust-signal leaves only.\n\n``tdee_kcal`` / ``uncertainty_kcal`` / ``confidence`` / ``method`` and every\nother engine field are deliberately NOT declared here: they pass through as\n``extra`` untouched, so this model can never alter their type or nullability."},"TdeeData":{"properties":{"current":{"anyOf":[{"$ref":"#/components/schemas/TdeeCurrent"},{"type":"null"}]},"generated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Generated At"}},"additionalProperties":true,"type":"object","title":"TdeeData","description":"The ``tdee`` block served on ``/v1/nutrition`` — the full engine blob.\n\nOnly ``current`` (and its trust-signal leaves) are deep-typed; everything\nelse (``targets``, ``by_day_type``, ``calibration``, ``weekly_history``, …)\npasses through as ``extra``. ``current`` is ``None`` when the engine returned\nthe ``insufficient_data`` sentinel."},"TdeeLogging":{"properties":{"state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"},"hold_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Hold Active"},"hold_recommended":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Hold Recommended"},"held_since":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Held Since"},"filter_tdee_kcal":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Filter Tdee Kcal"},"problem_days_7d":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Problem Days 7D"},"problem_window_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Problem Window Days"},"max_problem_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Problem Days"},"coverage_ratio":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Coverage Ratio"},"logged_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Logged Days"},"window_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Window Days"},"observation_weight":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Observation Weight"},"coverage_full_ratio":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Coverage Full Ratio"}},"additionalProperties":true,"type":"object","title":"TdeeLogging","description":"Spec 036 / FR-002 — partial-logging window evidence behind the HOLD state.\n\n``hold_active`` is the load-bearing flag: when True the published\n``tdee_kcal`` is FROZEN at the last high-confidence estimate\n(``held_since`` = the day it was anchored), and ``filter_tdee_kcal`` carries\nthe filter's own un-frozen output so the freeze is verifiable from the\npayload alone. A frozen number that renders identically to a fresh one is\nworse than not freezing it — a UI must surface ``hold_active``/``held_since``."},"TimeRange":{"properties":{"start":{"type":"string","title":"Start"},"end":{"type":"string","title":"End"},"resolution_minutes":{"type":"integer","title":"Resolution Minutes"}},"type":"object","required":["start","end","resolution_minutes"],"title":"TimeRange"},"TodayWorkout":{"properties":{"trained_today":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Trained Today"},"workout_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workout Title"},"muscles_worked":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Muscles Worked"},"volume_lbs":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Volume Lbs"},"sets_total":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Sets Total"},"top_fatigued":{"anyOf":[{"items":{"$ref":"#/components/schemas/TopFatiguedEntry"},"type":"array"},{"type":"null"}],"title":"Top Fatigued"},"verdict":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Verdict"},"verdict_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Verdict Label"},"recovery_tip":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recovery Tip"}},"additionalProperties":false,"type":"object","title":"TodayWorkout"},"TopFatiguedEntry":{"properties":{"muscle":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Muscle"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"fatigue_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Fatigue Score"}},"additionalProperties":false,"type":"object","title":"TopFatiguedEntry"},"TrainingActivity":{"properties":{"id":{"type":"string","title":"Id"},"date":{"type":"string","title":"Date"},"source":{"type":"string","title":"Source"},"title":{"type":"string","title":"Title"},"workout_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workout Type"},"sport_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Sport Id"},"sport_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sport Name"},"strain":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Strain"},"avg_hr":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Hr"},"max_hr":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Max Hr"},"duration_min":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Duration Min"},"start_time":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Time"},"end_time":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Time"}},"type":"object","required":["id","date","source","title"],"title":"TrainingActivity"},"TrainingAlternative":{"properties":{"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"workout_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workout Type"},"rationale":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rationale"},"equipment_needed":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Equipment Needed"}},"additionalProperties":false,"type":"object","title":"TrainingAlternative"},"TrainingCardioFatigue":{"properties":{"last_session":{"anyOf":[{"$ref":"#/components/schemas/CardioLastSession"},{"type":"null"}]},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"recovery_hours":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Recovery Hours"},"hours_since":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Hours Since"},"ready_in_hours":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Ready In Hours"}},"additionalProperties":false,"type":"object","title":"TrainingCardioFatigue"},"TrainingResponse":{"properties":{"recommendation":{"anyOf":[{"$ref":"#/components/schemas/PrimaryRecommendation"},{"type":"null"}]},"muscle_grid":{"anyOf":[{"items":{"$ref":"#/components/schemas/MuscleGridEntry"},"type":"array"},{"type":"null"}],"title":"Muscle Grid"},"cardio_fatigue":{"anyOf":[{"$ref":"#/components/schemas/TrainingCardioFatigue"},{"type":"null"}]},"today_workout":{"anyOf":[{"$ref":"#/components/schemas/TodayWorkout"},{"type":"null"}]},"trained_today":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Trained Today"},"readiness":{"anyOf":[{"$ref":"#/components/schemas/Readiness"},{"type":"null"}]},"recovery_context":{"anyOf":[{"$ref":"#/components/schemas/RecoveryContext"},{"type":"null"}]},"travel":{"anyOf":[{"$ref":"#/components/schemas/TravelContext"},{"type":"null"}]},"alternatives":{"anyOf":[{"items":{"$ref":"#/components/schemas/TrainingAlternative"},"type":"array"},{"type":"null"}],"title":"Alternatives"},"avoid":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Avoid"},"avoid_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avoid Reason"},"scheduled_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scheduled Type"},"split_history":{"anyOf":[{"additionalProperties":{"type":"number"},"type":"object"},{"type":"null"}],"title":"Split History"},"rationale":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rationale"},"infeasibility_warning":{"anyOf":[{"$ref":"#/components/schemas/InfeasibilityWarning"},{"type":"null"}]},"type_override":{"anyOf":[{"$ref":"#/components/schemas/TypeOverride"},{"type":"null"}]},"shape_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Shape Version"},"recent_workouts":{"anyOf":[{"items":{"$ref":"#/components/schemas/RecentWorkout"},"type":"array"},{"type":"null"}],"title":"Recent Workouts"},"workouts":{"anyOf":[{"items":{"$ref":"#/components/schemas/TrainingWorkout"},"type":"array"},{"type":"null"}],"title":"Workouts"},"activities":{"anyOf":[{"items":{"$ref":"#/components/schemas/TrainingResponseActivity"},"type":"array"},{"type":"null"}],"title":"Activities"},"daily_strain":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Daily Strain"},"generated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Generated At"},"data_age_hours":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Data Age Hours"}},"additionalProperties":true,"type":"object","title":"TrainingResponse"},"TrainingResponseActivity":{"properties":{"date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date"},"type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type"},"sport":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sport"},"sport_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Sport Id"},"workout_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workout Type"},"duration_min":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Duration Min"},"strain":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Strain"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"avg_hr":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Hr"},"max_hr":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Max Hr"},"kilojoules":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Kilojoules"},"distance_m":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Distance M"},"start_utc":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Utc"},"end_utc":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Utc"}},"additionalProperties":true,"type":"object","title":"TrainingResponseActivity"},"TrainingScheduleResponse":{"properties":{"block":{"type":"string","title":"Block"},"block_name":{"type":"string","title":"Block Name"},"block_valid_until":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Block Valid Until"},"block_window_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Block Window Status"},"block_days_out_of_window":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Block Days Out Of Window"},"computed_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Computed Active"},"block_data_issue":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Block Data Issue"},"block_governing_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Block Governing Days"},"block_over_expected_age":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Block Over Expected Age"},"today":{"type":"string","title":"Today"},"today_routine_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Today Routine Id"},"tomorrow":{"type":"string","title":"Tomorrow"},"tomorrow_routine_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tomorrow Routine Id"},"routine_map":{"additionalProperties":{"type":"string"},"type":"object","title":"Routine Map"},"generated_at":{"type":"string","title":"Generated At"}},"type":"object","required":["block","block_name","today","tomorrow","routine_map","generated_at"],"title":"TrainingScheduleResponse","description":"Response for GET /v1/training/schedule (CHORE-072 / SPEC-004)."},"TrainingWorkout":{"properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date"},"duration_min":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Duration Min"},"total_volume_lbs":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Total Volume Lbs"},"start_utc":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Utc"},"end_utc":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Utc"}},"additionalProperties":true,"type":"object","title":"TrainingWorkout"},"TravelContext":{"properties":{"is_travel_mode":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Travel Mode"},"gym_access":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gym Access"},"destination":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Destination"},"volume_modifier":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Volume Modifier"}},"additionalProperties":false,"type":"object","title":"TravelContext"},"TypeOverride":{"properties":{"emitted_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Emitted Type"},"scheduled_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scheduled Type"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"additionalProperties":false,"type":"object","title":"TypeOverride","description":"P0b: present (non-null) only when the engine emitted a workout type other\nthan the scheduled one. `scheduled_type` here is the CANONICAL split that was\ndisplaced; the raw schedule label stays on the response's own\n`scheduled_type`. `reason` names the muscle-coverage evidence."},"UnconfirmMarkerRequest":{"properties":{"prior":{"anyOf":[{"$ref":"#/components/schemas/MarkerPriorState"},{"type":"null"}]}},"type":"object","title":"UnconfirmMarkerRequest"},"UpdateDoseRequest":{"properties":{"taken_at":{"type":"string","title":"Taken At","description":"ISO datetime when dose was taken"},"dose_amount":{"type":"number","exclusiveMinimum":0.0,"title":"Dose Amount","description":"Dose amount"},"dose_unit":{"type":"string","title":"Dose Unit","description":"Dose unit (mg, mcg, IU)"},"route_type":{"type":"string","enum":["subcutaneous","intramuscular","oral","topical","intranasal"],"title":"Route Type"},"compound_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Compound Id","description":"Compound identifier (ignored in update)"},"injection_site":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Injection Site","description":"Injection site for SubQ/IM"},"injection_zone":{"anyOf":[{"type":"string","enum":["abdomen_UL","abdomen_UC","abdomen_UR","abdomen_LL","abdomen_LC","abdomen_LR","thigh_L","thigh_R","glute_L","glute_R","delt_L","delt_R","injury_site"]},{"type":"null"}],"title":"Injection Zone","description":"Normalized injection zone enum for SubQ/IM"},"lot_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lot Number","description":"Vial lot number"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes","description":"Additional notes"}},"type":"object","required":["taken_at","dose_amount","dose_unit","route_type"],"title":"UpdateDoseRequest","description":"Request body for updating an existing dose."},"UploadHistoryItem":{"properties":{"upload_id":{"type":"string","title":"Upload Id","description":"Unique identifier for the upload"},"status":{"$ref":"#/components/schemas/UploadStatus","description":"Current processing status"},"file_name":{"type":"string","title":"File Name","description":"Original filename of the uploaded PDF"},"lab_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lab Name","description":"Name of the lab (if extracted from PDF)"},"extraction_method":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Extraction Method","description":"Method used for PDF extraction"},"marker_count":{"type":"integer","minimum":0.0,"title":"Marker Count","description":"Number of markers extracted from the PDF"},"resolved_marker_count":{"type":"integer","minimum":0.0,"title":"Resolved Marker Count","description":"Number of markers that have been resolved/confirmed","default":0},"flagged_marker_count":{"type":"integer","minimum":0.0,"title":"Flagged Marker Count","description":"Number of low-confidence markers requiring review","default":0},"confidence_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence Score","description":"Overall confidence score for the extraction"},"panel_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Panel Id","description":"ID of the associated lab panel (if created)"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error","description":"Pipeline error message from error column"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Timestamp when the upload was created"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At","description":"Timestamp when processing completed (if applicable)"},"date_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date Source"},"date_confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Date Confidence"},"date_review_pending":{"type":"boolean","title":"Date Review Pending","default":false},"date_review_reasons":{"items":{"type":"string"},"type":"array","title":"Date Review Reasons"},"collection_time":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Collection Time"},"collection_tz":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Collection Tz"}},"type":"object","required":["upload_id","status","file_name","marker_count","created_at"],"title":"UploadHistoryItem","description":"Single upload history record.\n\nRepresents one upload entry in the user's upload history list.\n\nAttributes:\n    upload_id: Unique identifier for the upload (aliased from 'id')\n    status: Current processing status\n    file_name: Original filename of the uploaded PDF\n    lab_name: Name of the lab (if extracted from PDF)\n    extraction_method: Method used for PDF extraction (e.g., 'pdfplumber', 'ollama')\n    marker_count: Number of markers extracted from the PDF\n    resolved_count: Number of markers that have been resolved/confirmed\n    created_at: Timestamp when the upload was created\n    completed_at: Timestamp when processing completed (if applicable)"},"UploadHistoryResponse":{"properties":{"uploads":{"items":{"$ref":"#/components/schemas/UploadHistoryItem"},"type":"array","title":"Uploads","description":"List of upload history items"},"total":{"type":"integer","minimum":0.0,"title":"Total","description":"Total number of uploads"}},"type":"object","required":["uploads","total"],"title":"UploadHistoryResponse","description":"Response model for upload history endpoint.\n\nAttributes:\n    uploads: List of upload history items\n    total: Total number of uploads (for pagination)"},"UploadResponse":{"properties":{"upload_id":{"type":"string","title":"Upload Id","description":"Unique identifier for the created upload job"},"status":{"type":"string","title":"Status","description":"Initial processing status (always \"processing\")"}},"type":"object","required":["upload_id","status"],"title":"UploadResponse","description":"Response model for POST /v1/labs/uploads endpoint.\n\nAttributes:\n    upload_id: Unique identifier for the created upload job\n    status: Initial processing status (always \"processing\")"},"UploadStatus":{"type":"string","enum":["pending","processing","completed","failed","superseded"],"title":"UploadStatus","description":"Upload processing status enum.\n\nAttributes:\n    PENDING: Upload is queued and waiting to be processed\n    PROCESSING: Upload is currently being processed\n    COMPLETED: Upload processing completed successfully (markers inserted, flags surfaced via confidence_flag column)\n    FAILED: Upload processing failed; see `error` column\n    SUPERSEDED: Pre-redesign-clarys-upload-pipeline row that completed\n        without inserting markers (dedup-merge silent failure); user\n        should re-upload to reprocess. Introduced 2026-05-23.\n\nNote: the legacy NEEDS_REVIEW value was retired in the upload pipeline\nredesign (2026-05-23). Flagged markers are now surfaced via the\n`lab_results.confidence_flag` column instead of a blocking upload status."},"UploadStatusResponse":{"properties":{"upload_id":{"type":"string","title":"Upload Id","description":"Unique identifier for the upload"},"status":{"$ref":"#/components/schemas/UploadStatus","description":"Current processing status"},"confidence_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence Score","description":"Overall confidence score for the extraction"},"flagged_markers":{"items":{},"type":"array","title":"Flagged Markers","description":"List of flagged marker details (low-confidence rows that DID insert; user reviews and confirms or corrects)"},"dropped_markers":{"items":{},"type":"array","title":"Dropped Markers","description":"clarys-silent-drop-surface (2026-05-27): markers the pipeline received from the parser but could NOT insert into lab_results (e.g. categorical without value_text). Each entry: {original_name, canonical_id, reason}. Distinct from flagged_markers — these never landed in the panel and the user needs to enter them manually."},"panel_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Panel Id","description":"ID of the associated lab panel (if created)"},"upload_classification":{"additionalProperties":true,"type":"object","title":"Upload Classification","description":"Classification heuristic result"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error","description":"Pipeline error message (if any)"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At","description":"Timestamp when the upload was created"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At","description":"Timestamp when processing completed (if applicable)"}},"type":"object","required":["upload_id","status"],"title":"UploadStatusResponse","description":"Response model for upload status endpoint.\n\nAttributes:\n    upload_id: Unique identifier for the upload\n    status: Current processing status\n    confidence_score: Overall confidence score for the extraction\n    flagged_markers: List of flagged marker details\n    panel_id: ID of the associated lab panel (if created)\n    upload_classification: Classification heuristic result\n    error: Pipeline error message (if any)\n    created_at: Timestamp when the upload was created\n    completed_at: Timestamp when processing completed (if applicable)"},"UpsellCard":{"properties":{"headline":{"type":"string","title":"Headline","default":""},"body":{"type":"string","title":"Body","default":""},"cta_label":{"type":"string","title":"Cta Label","default":""},"show_price":{"type":"boolean","title":"Show Price","default":false},"price":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Price"}},"type":"object","title":"UpsellCard","description":"Section 7, unsigned reports only. Price is GATED OFF (ADR-018): medical-event prices are\nnot published until the doctor fee is validated. `show_price` stays False and `price` stays\nNone until that flag flips. The card sells the signed review without a number for now."},"UserConfig":{"properties":{},"additionalProperties":true,"type":"object","title":"UserConfig","description":"User settings blob (dynamic; known keys validated server-side)."},"ValidateMarkerRequest":{"properties":{"value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Value"},"unit":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Unit"},"value_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Value Text"},"value_qualifier":{"anyOf":[{"type":"string","enum":["lt","lte","gt","gte",""]},{"type":"null"}],"title":"Value Qualifier"},"prior":{"anyOf":[{"$ref":"#/components/schemas/MarkerPriorState"},{"type":"null"}]}},"type":"object","title":"ValidateMarkerRequest"},"ValidateMarkerResponse":{"properties":{"result_id":{"type":"string","title":"Result Id"},"confidence_flag":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Confidence Flag"},"value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Value"},"unit":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Unit"},"value_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Value Text"},"value_qualifier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Value Qualifier"},"value_original":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Value Original"},"unit_original":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Unit Original"},"value_corrected_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Value Corrected At"},"applied":{"type":"boolean","title":"Applied"}},"type":"object","required":["result_id","applied"],"title":"ValidateMarkerResponse"},"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"},"VerifyMarker":{"properties":{"marker_id":{"type":"string","title":"Marker Id"},"name":{"type":"string","title":"Name"},"value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Value"},"value_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Value Text"},"unit":{"type":"string","title":"Unit","default":""}},"type":"object","required":["marker_id","name"],"title":"VerifyMarker","description":"A low-confidence extraction (NOT trusted): shown only in 'Por verificar', never in the\ngrid or findings. Value is what the extractor read; the patient confirms it against the\noriginal PDF. value is rendered with a '~' prefix client-side."},"VialResetResponse":{"properties":{"protocol_id":{"type":"string","title":"Protocol Id"},"compound_id":{"type":"string","title":"Compound Id"},"starting_vial_mg":{"type":"number","title":"Starting Vial Mg"},"vial_opened_at":{"type":"string","title":"Vial Opened At"}},"type":"object","required":["protocol_id","compound_id","starting_vial_mg","vial_opened_at"],"title":"VialResetResponse"},"VialSupplyItem":{"properties":{"protocol_id":{"type":"string","title":"Protocol Id"},"compound_id":{"type":"string","title":"Compound Id"},"compound_name":{"type":"string","title":"Compound Name"},"starting_vial_mg":{"type":"number","title":"Starting Vial Mg"},"vial_opened_at":{"type":"string","title":"Vial Opened At"},"opened_days_ago":{"type":"integer","title":"Opened Days Ago"},"total_dosed_mg":{"type":"number","title":"Total Dosed Mg"},"remaining_mg":{"type":"number","title":"Remaining Mg"},"scheduled_dose_amount_mg":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Scheduled Dose Amount Mg"},"remaining_doses":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Remaining Doses"},"low_stock":{"type":"boolean","title":"Low Stock"},"low_stock_threshold_doses":{"type":"integer","title":"Low Stock Threshold Doses"},"ignored_non_mg_dose_count":{"type":"integer","title":"Ignored Non Mg Dose Count","description":"Dose logs since vial_opened_at ignored because dose_unit is not mg. Current-vial depletion subtracts mg-denominated dose logs only.","default":0},"unit_handling":{"type":"string","title":"Unit Handling","description":"Human-readable note for non-mg depletion behavior.","default":"Only dose_log rows with dose_unit='mg' are subtracted."}},"type":"object","required":["protocol_id","compound_id","compound_name","starting_vial_mg","vial_opened_at","opened_days_ago","total_dosed_mg","remaining_mg","low_stock","low_stock_threshold_doses"],"title":"VialSupplyItem"},"VialSupplyResponse":{"properties":{"supplies":{"items":{"$ref":"#/components/schemas/VialSupplyItem"},"type":"array","title":"Supplies"},"low_stock_threshold_doses":{"type":"integer","title":"Low Stock Threshold Doses"},"generated_at":{"type":"string","title":"Generated At"}},"type":"object","required":["supplies","low_stock_threshold_doses","generated_at"],"title":"VialSupplyResponse"},"Vo2maxCurrent":{"properties":{"value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Value"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date"}},"additionalProperties":true,"type":"object","title":"Vo2maxCurrent"},"Vo2maxField":{"properties":{"current":{"anyOf":[{"$ref":"#/components/schemas/Vo2maxCurrent"},{"type":"null"}]},"trend":{"items":{"$ref":"#/components/schemas/Vo2maxTrendPoint"},"type":"array","title":"Trend"},"stats":{"$ref":"#/components/schemas/Vo2maxStats"}},"type":"object","required":["trend","stats"],"title":"Vo2maxField"},"Vo2maxStats":{"properties":{"avg_90d":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg 90D"},"max_all_time":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Max All Time"},"max_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Max Date"}},"type":"object","title":"Vo2maxStats"},"Vo2maxTrendPoint":{"properties":{"date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date"},"value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Value"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"}},"type":"object","title":"Vo2maxTrendPoint"},"WaitlistAck":{"properties":{"status":{"type":"string","title":"Status","default":"ok"},"already":{"type":"boolean","title":"Already","default":false}},"type":"object","title":"WaitlistAck"},"WaitlistRequest":{"properties":{"email":{"type":"string","title":"Email"},"source":{"type":"string","title":"Source","default":"landing"}},"type":"object","required":["email"],"title":"WaitlistRequest"},"Workout":{"properties":{"id":{"type":"string","title":"Id"},"title":{"type":"string","title":"Title"},"start_time":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Time"},"end_time":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Time"},"duration_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Seconds"},"exercises":{"items":{"$ref":"#/components/schemas/Exercise"},"type":"array","title":"Exercises"},"total_volume_lbs":{"type":"number","title":"Total Volume Lbs"}},"type":"object","required":["id","title","exercises","total_volume_lbs"],"title":"Workout"},"WorkoutsResponse":{"properties":{"workouts":{"items":{"$ref":"#/components/schemas/Workout"},"type":"array","title":"Workouts"},"page":{"type":"integer","title":"Page"},"page_count":{"type":"integer","title":"Page Count"},"total_workouts":{"type":"integer","title":"Total Workouts"},"cached":{"type":"boolean","title":"Cached","default":false},"cache_age_sec":{"type":"integer","title":"Cache Age Sec","default":0},"generated_at":{"type":"string","title":"Generated At"}},"type":"object","required":["workouts","page","page_count","total_workouts","generated_at"],"title":"WorkoutsResponse"},"routers__health__BodyResponse":{"properties":{"current":{"anyOf":[{"$ref":"#/components/schemas/BodyMeasurement"},{"type":"null"}]},"series":{"items":{"$ref":"#/components/schemas/BodyMeasurement"},"type":"array","title":"Series"},"cached":{"type":"boolean","title":"Cached","default":false},"cache_age_sec":{"type":"integer","title":"Cache Age Sec","default":0},"generated_at":{"type":"string","title":"Generated At"}},"type":"object","required":["series","generated_at"],"title":"BodyResponse"},"routers__health__RecoveryResponse":{"properties":{"days":{"items":{"$ref":"#/components/schemas/RecoveryDay"},"type":"array","title":"Days"},"cached":{"type":"boolean","title":"Cached","default":false},"cache_age_sec":{"type":"integer","title":"Cache Age Sec","default":0},"generated_at":{"type":"string","title":"Generated At"}},"type":"object","required":["days","generated_at"],"title":"RecoveryResponse"},"routers__training__RefreshResponse":{"properties":{"status":{"type":"string","title":"Status"},"duration_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Ms"},"refreshed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Refreshed At"},"detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Detail"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"type":"object","required":["status"],"title":"RefreshResponse","description":"Response for POST /v1/training/refresh.\n\nstatus: \"ok\" | \"up_to_date\" | \"cooldown\" | \"error\""},"src__schemas__data_v1__BodyResponse":{"properties":{"current":{"$ref":"#/components/schemas/BodyCurrent"},"target_kg":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Target Kg"},"start_kg":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Start Kg"},"remaining_kg":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Remaining Kg"},"rate_per_week_kg":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Rate Per Week Kg"},"eta_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Eta Date"},"change_7d":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Change 7D"},"change_30d":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Change 30D"},"trend_data":{"items":{"$ref":"#/components/schemas/BodyTrendPoint"},"type":"array","title":"Trend Data"},"gold_trends":{"$ref":"#/components/schemas/GoldTrends"},"nutrition_summary":{"$ref":"#/components/schemas/NutritionSummary"},"metabolic_age":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Metabolic Age"},"metabolic_age_algorithm_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Metabolic Age Algorithm Version"},"metabolic_age_components":{"$ref":"#/components/schemas/MetabolicAgeComponents"},"vo2max":{"anyOf":[{"$ref":"#/components/schemas/Vo2maxField"},{"type":"null"}]},"generated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Generated At"},"data_age_hours":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Data Age Hours"},"degraded":{"items":{"type":"string"},"type":"array","title":"Degraded"}},"additionalProperties":true,"type":"object","required":["current","trend_data","gold_trends","nutrition_summary","metabolic_age_components"],"title":"BodyResponse"},"src__schemas__data_v1__RecoveryResponse":{"properties":{"score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Score"},"zone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Zone"},"hrv":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Hrv"},"rhr":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Rhr"},"spo2":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Spo2"},"skin_temp":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Skin Temp"},"sleep":{"$ref":"#/components/schemas/RecoverySleep"},"trend_7d":{"items":{"type":"number"},"type":"array","title":"Trend 7D"},"hrv_trend_7d":{"items":{"type":"number"},"type":"array","title":"Hrv Trend 7D"},"sleep_trend_7d_hrs":{"items":{"type":"number"},"type":"array","title":"Sleep Trend 7D Hrs"},"avg_7d":{"$ref":"#/components/schemas/RecoveryAvg"},"avg_28d":{"$ref":"#/components/schemas/RecoveryAvg"},"hrv_baseline":{"anyOf":[{"$ref":"#/components/schemas/RecoveryHrvBaseline"},{"type":"null"}]},"sleep_timing_consistency_proxy":{"anyOf":[{"$ref":"#/components/schemas/SleepTimingConsistencyProxy"},{"type":"null"}]},"illness_flag":{"anyOf":[{"$ref":"#/components/schemas/RecoveryIllnessFlag"},{"type":"null"}]},"skin_resp_co_deviation":{"anyOf":[{"$ref":"#/components/schemas/RecoverySkinRespCoDeviation"},{"type":"null"}]},"generated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Generated At"},"data_age_hours":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Data Age Hours"}},"type":"object","required":["sleep","trend_7d","hrv_trend_7d","sleep_trend_7d_hrs","avg_7d","avg_28d"],"title":"RecoveryResponse"},"src__schemas__envelope__Envelope_BodyResponse___1":{"properties":{"data":{"$ref":"#/components/schemas/src__schemas__data_v1__BodyResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[BodyResponse]"},"src__schemas__envelope__Envelope_BodyResponse___2":{"properties":{"data":{"$ref":"#/components/schemas/routers__health__BodyResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[BodyResponse]"},"src__schemas__envelope__Envelope_RecoveryResponse___1":{"properties":{"data":{"$ref":"#/components/schemas/src__schemas__data_v1__RecoveryResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[RecoveryResponse]"},"src__schemas__envelope__Envelope_RecoveryResponse___2":{"properties":{"data":{"$ref":"#/components/schemas/routers__health__RecoveryResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[RecoveryResponse]"},"src__schemas__envelope__Envelope_RefreshResponse___1":{"properties":{"data":{"$ref":"#/components/schemas/src__schemas__system__RefreshResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[RefreshResponse]"},"src__schemas__envelope__Envelope_RefreshResponse___2":{"properties":{"data":{"$ref":"#/components/schemas/routers__training__RefreshResponse"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object","required":["data"],"title":"Envelope[RefreshResponse]"},"src__schemas__system__RefreshResponse":{"properties":{"status":{"type":"string","title":"Status"},"duration_ms":{"type":"integer","title":"Duration Ms"},"tables_updated":{"items":{"type":"string"},"type":"array","title":"Tables Updated"},"apis_called":{"items":{"type":"string"},"type":"array","title":"Apis Called"},"refreshed_at":{"type":"string","title":"Refreshed At"},"errors":{"anyOf":[{"items":{"anyOf":[{"$ref":"#/components/schemas/ProviderError"},{"type":"string"}]},"type":"array"},{"type":"null"}],"title":"Errors"},"ingest_status":{"anyOf":[{"$ref":"#/components/schemas/RefreshIngestStatus"},{"type":"null"}]}},"type":"object","required":["status","duration_ms","tables_updated","apis_called","refreshed_at"],"title":"RefreshResponse","description":"POST /refresh result.\n\n`errors` is a heterogeneous list: ARCH-052 ProviderError objects for\nupstream-API failures, plus plain strings for engine failures\n(e.g. \"fatigue_engine: ...\"). The handler omits the key entirely when\nthere are no errors, so the route declares\n`response_model_exclude_none=True` to keep that exact shape (absent,\nnot null)."}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}},"tags":[{"name":"system","description":"Health, status, and token refresh."},{"name":"recovery","description":"Recovery score, HRV, sleep readiness."},{"name":"body","description":"Body composition and measurements."},{"name":"overview","description":"Cross-domain morning rollup."},{"name":"training","description":"Training readiness, activities, workouts."},{"name":"labs","description":"Lab panels, uploads, marker catalog."},{"name":"protocols","description":"Compounds, concentrations, doses, experiments."},{"name":"nutrition","description":"Nutrition log and TDEE."},{"name":"calendar","description":"Calendar events."},{"name":"user-config","description":"User configuration and protocol state."},{"name":"auth","description":"OAuth provider token refresh."},{"name":"admin","description":"Admin-only user permission management."},{"name":"doctor","description":"Clinician portal: linked patients, their labs, marker validation."},{"name":"reports","description":"Patient-facing report artifact: tier-gated, sectioned read-model."},{"name":"market-intel","description":"Medication price intelligence for doctors (HCP): GLP-1 price report read-model + admin capture surface."}]}