{"openapi":"3.1.0","info":{"title":"Sugalarm Platform","description":"Cloud CGM monitoring API with multi-device support","version":"0.496.0"},"paths":{"/api/auth/register":{"post":{"tags":["Authentication"],"summary":"Register","description":"Create a new user account and return JWT tokens.","operationId":"register_api_auth_register_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/reset_password":{"post":{"tags":["Authentication"],"summary":"Reset Password Route","description":"Cycle 95: PUBLIC (unauthenticated) consume of a single-use reset\ntoken. 400 invalid / weak password; 410 expired or already used.","operationId":"reset_password_route_api_auth_reset_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetPasswordRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/forgot_password":{"post":{"tags":["Authentication"],"summary":"Forgot Password Route","description":"Cycle 190: PUBLIC (unauthenticated) self-serve reset REQUEST.\n\nAnti-enumeration is a hard contract: this ALWAYS returns a generic 200,\nregardless of whether the account exists, is passwordless, or was\nrate-limited. The branchy decision lives in `request_password_reset`; the\nemail send is dispatched as a BACKGROUND task so the \"we sent\" and \"we\ndidn't\" branches are not distinguishable by response latency (the upstream\nemail round-trip never blocks the response). The background send routes\nthrough the swallow-all-errors path in email_service, so a down rail can\nnever turn this into a 500.","operationId":"forgot_password_route_api_auth_forgot_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForgotPasswordRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/login":{"post":{"tags":["Authentication"],"summary":"Login","description":"Authenticate with email and password, receive JWT tokens.","operationId":"login_api_auth_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/refresh":{"post":{"tags":["Authentication"],"summary":"Refresh","description":"Exchange a refresh token for a new access token.\n\nCycle 419 — three outcomes, and the difference between them is the whole\nsafety story of this cycle:\n\n* **The token names a live session** → rotate WITHIN it. Same row, new\n  pair, `revoked_at` still NULL. ⚠ A rotation must never mint a second\n  row: this endpoint runs roughly every access-token lifetime, so a row\n  per rotation would bury the one row a logout has to find.\n* **The token carries no `sid`** (every token in the field before this\n  deploy) → it authenticates normally and a session row is minted for\n  it. The population self-migrates within one refresh interval. ⚠\n  Rejecting these would be a platform-wide involuntary logout — cycle\n  235.2's directive, and a fleet of alarm surfaces going dark at once.\n* **The token names a REVOKED session** → 401, the genuine\n  auth-rejection semantics `refreshOnce()` already handles. This is the\n  only new rejection, it is caused by the user's own explicit Log out,\n  and it reaches only the install that performed it.\n\n⚠ CYCLE 235.2 IS OTHERWISE UNTOUCHED. A transient failure, a 5xx, an\noffline cold launch or a WebView eviction still keeps the session — none\nof them reach this function's rejection branch.","operationId":"refresh_api_auth_refresh_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/logout":{"post":{"tags":["Authentication"],"summary":"Logout","description":"End THIS install's session. Cycle 419.\n\n⚠ EXACTLY ONE ROW, AND IT IS THE CALLER'S OWN. There is no parameter\nhere — not a session id, not a device id, not a user id — so addressing\nsomebody else's session is unrepresentable rather than merely refused.\nThe session revoked is the one named by the `sid` claim in the very\ncredential this request authenticated with.\n\n⚠ THIS MUST NEVER SIGN OUT THE HOUSEHOLD KIOSK. A wall-mounted kiosk\nauthenticates with a `dt_` device token, which carries no `sid` at all\nand is a different credential family entirely — so it is structurally\noutside this mechanism. Even if it held a JWT it would hold a DIFFERENT\nsession row, and the revocation write names one id. A phone logout\ncannot reach it. (`test_auth_session_revocation.py` pins both halves.)\n\nIdempotent: a second logout, a logout from a device token, and a logout\non a token minted before cycle 419 all write nothing and return 200.","operationId":"logout_api_auth_logout_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/auth/me":{"get":{"tags":["Authentication"],"summary":"Get Me","description":"Get the authenticated user's profile.","operationId":"get_me_api_auth_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/auth/providers":{"get":{"tags":["Authentication"],"summary":"Providers","description":"PUBLIC — which sign-in methods this server is configured for.\nThe SPA renders only the available buttons.","operationId":"providers_api_auth_providers_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProvidersOut"}}}}}}},"/api/auth/oauth/google":{"post":{"tags":["Authentication"],"summary":"Oauth Google","description":"Verify a Google ID token (JWKS + iss + aud + exp) and sign in —\nfind-or-create-link, takeover-safe. Cycle 479: 503\n`provider_unavailable` when Google's keys cannot be fetched.","operationId":"oauth_google_api_auth_oauth_google_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthGoogleIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/oauth/apple":{"post":{"tags":["Authentication"],"summary":"Oauth Apple","description":"Verify an Apple identity token (JWKS + iss + aud + exp) and sign\nin — find-or-create-link, takeover-safe. Tolerates private-relay\nemails (they create/use their own account, never another's).\nCycle 479: 503 `provider_unavailable` when Apple's keys cannot be\nfetched.","operationId":"oauth_apple_api_auth_oauth_apple_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthAppleIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/passkey/register/begin":{"post":{"tags":["Authentication"],"summary":"Passkey Register Begin","description":"AUTHENTICATED — options for adding a passkey to the caller's\naccount (fresh single-use challenge, existing creds excluded).","operationId":"passkey_register_begin_api_auth_passkey_register_begin_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasskeyOptionsOut"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/auth/passkey/register/finish":{"post":{"tags":["Authentication"],"summary":"Passkey Register Finish","description":"AUTHENTICATED — verify the attestation and persist the passkey.","operationId":"passkey_register_finish_api_auth_passkey_register_finish_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasskeyRegisterFinishIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasskeyCredentialOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/auth/passkey/authenticate/begin":{"post":{"tags":["Authentication"],"summary":"Passkey Authenticate Begin","description":"PUBLIC — options for passkey sign-in. Discoverable-first (empty\nallowCredentials); pass `email` only for the fallback.","operationId":"passkey_authenticate_begin_api_auth_passkey_authenticate_begin_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasskeyAuthBeginIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasskeyOptionsOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/passkey/authenticate/finish":{"post":{"tags":["Authentication"],"summary":"Passkey Authenticate Finish","description":"PUBLIC — verify the assertion, advance sign_count, sign in.","operationId":"passkey_authenticate_finish_api_auth_passkey_authenticate_finish_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasskeyAuthFinishIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/passkey/credentials":{"get":{"tags":["Authentication"],"summary":"Passkey Credentials","description":"AUTHENTICATED — the caller's registered passkeys.","operationId":"passkey_credentials_api_auth_passkey_credentials_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/PasskeyCredentialOut"},"type":"array","title":"Response Passkey Credentials Api Auth Passkey Credentials Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/auth/passkey/credentials/{credential_id}":{"delete":{"tags":["Authentication"],"summary":"Passkey Credential Delete","description":"AUTHENTICATED — remove one of the caller's passkeys.","operationId":"passkey_credential_delete_api_auth_passkey_credentials__credential_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"credential_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Credential Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/account/deletion-preview":{"get":{"tags":["account"],"summary":"My Account Deletion Preview","description":"What deleting the caller's OWN account does to its billing (cycle\n463.1), for the confirmation step: whether a web subscription will be\ncancelled now, and which app stores still bill it. No provider ids.","operationId":"my_account_deletion_preview_api_account_deletion_preview_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response My Account Deletion Preview Api Account Deletion Preview Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/account":{"delete":{"tags":["account"],"summary":"Delete My Account","description":"Permanently delete the authenticated caller's OWN account + all\ntheir data. Self-only: no target parameter exists, so another\naccount can never be addressed (see module docstring).","operationId":"delete_my_account_api_account_delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Delete My Account Api Account Delete"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/cgm/connect":{"post":{"tags":["CGM Provider"],"summary":"Connect Cgm","description":"Link a CGM account on the caller's active member. Cycle 509: the\nper-account connect limit, and the coded provider outcomes (never 401)\n— `server/api/cgm_connect_http.py`.","operationId":"connect_cgm_api_cgm_connect_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CGMConnectRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CGMConnectResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/cgm/status":{"get":{"tags":["CGM Provider"],"summary":"Cgm Status","description":"Status of the active member's CGM. DB-only — never contacts the\nprovider (cycle 155).","operationId":"cgm_status_api_cgm_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CGMStatusResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/cgm/disconnect":{"delete":{"tags":["CGM Provider"],"summary":"Disconnect Cgm","description":"Disconnect the active member's CGM.","operationId":"disconnect_cgm_api_cgm_disconnect_delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CGMDisconnectResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/glucose/latest":{"get":{"tags":["Glucose"],"summary":"Latest","operationId":"latest_api_glucose_latest_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlucoseLatestResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/glucose/history":{"get":{"tags":["Glucose"],"summary":"History","operationId":"history_api_glucose_history_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"hours","in":"query","required":false,"schema":{"type":"integer","maximum":2160,"minimum":1,"default":24,"title":"Hours"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":30000,"minimum":1,"default":1000,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlucoseHistoryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/glucose/sync":{"post":{"tags":["Glucose"],"summary":"Sync Now","operationId":"sync_now_api_glucose_sync_post","requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/SyncRequest"},{"type":"null"}],"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyncTriggerResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/treatments":{"post":{"tags":["Treatments"],"summary":"Create Treatment","operationId":"create_treatment_api_treatments_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TreatmentCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TreatmentOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Treatments"],"summary":"List Treatments","operationId":"list_treatments_api_treatments_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"hours","in":"query","required":false,"schema":{"type":"integer","maximum":2160,"minimum":1,"default":24,"title":"Hours"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":10000,"minimum":1,"default":200,"title":"Limit"}},{"name":"before","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Anchor the `hours`-wide window at this timestamp instead of `now`. ISO-8601; naïve values are treated as UTC. Cycle 31: the calendar view uses this to page backwards by 30-day chunks without re-fetching what it already has.","title":"Before"},"description":"Anchor the `hours`-wide window at this timestamp instead of `now`. ISO-8601; naïve values are treated as UTC. Cycle 31: the calendar view uses this to page backwards by 30-day chunks without re-fetching what it already has."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TreatmentHistoryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/treatments/{treatment_id}":{"patch":{"tags":["Treatments"],"summary":"Update Treatment","description":"Cycle 34.20 — partial update for an existing treatment row.\n\nReuses the cycle-24 `treatment` WS frame for the broadcast so\nevery consumer (BolusRings, dashboard cards, recent-entries\nstrip, etc.) re-renders in place via the upsert path.","operationId":"update_treatment_api_treatments__treatment_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"treatment_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Treatment Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TreatmentUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TreatmentOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Treatments"],"summary":"Delete Treatment","operationId":"delete_treatment_api_treatments__treatment_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"treatment_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Treatment Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/devices/register":{"post":{"tags":["Devices"],"summary":"Register Device","operationId":"register_device_api_devices_register_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceRegisterRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/devices/heartbeat":{"post":{"tags":["Devices"],"summary":"Heartbeat Device","operationId":"heartbeat_device_api_devices_heartbeat_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceHeartbeatRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/devices":{"get":{"tags":["Devices"],"summary":"List Devices","operationId":"list_devices_api_devices_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceListResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/devices/kiosks/status":{"get":{"tags":["Devices"],"summary":"Kiosk Status","description":"Cycle 432 — the household line: every kiosk the caller can see (its\nown account's, plus the accounts whose members it is linked to), with\nthe derived state. Label, state, since — nothing that could place a\nscreen on a network. JWT or device token.","operationId":"kiosk_status_api_devices_kiosks_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KioskStatusListResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/devices/self/capabilities":{"post":{"tags":["Devices"],"summary":"Self Report Capabilities","description":"Cycle 200 — a device self-reports its hardware capabilities.\n\nDEVICE-TOKEN AUTH ONLY: operates on the *calling* device, resolved\nfrom the device-token identity. There is no `device_id` param, so\nthere is no IDOR surface. A JWT-only caller (no device context) is\nrejected with 403 — this is a device self-report, not an admin write.\nIdempotent. Sets `camera_capable` on the authenticated device and\nreturns the updated value.\n\nThe Android tablet kiosk calls this once on mount with\n`{camera_capable: true}` so the photo flow's softened auth\n(`CurrentUserPhotoCapable`) lets its device token through — a\nself-heal for already-paired tablets with no re-pair.","operationId":"self_report_capabilities_api_devices_self_capabilities_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceCapabilitiesIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceCapabilitiesOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/devices/self/camera_fallback":{"post":{"tags":["Devices"],"summary":"Self Report Camera Fallback","description":"Cycle 458 — a kiosk photo chooser opened without its camera purpose\nreaching the APK, so the APK routed on `capture` alone (the in-app front\ncamera). Counted on `/api/health.photos.kiosk_camera`; nothing stored.\n\nDEVICE-TOKEN AUTH ONLY, self-scoped like `/self/capabilities`: no id in\nthe body, so no IDOR surface; a JWT caller gets 403. Bounded per device;\npast the bound the report is dropped and counted, still 204 — the page\nnever retries and never waits on this. Telemetry only, never a gate.","operationId":"self_report_camera_fallback_api_devices_self_camera_fallback_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CameraFallbackIn"}}},"required":true},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/devices/self/revoke_token":{"post":{"tags":["Devices"],"summary":"Self Revoke Token","description":"Cycle 471 — a kiosk that signs out revokes ITSELF.\n\nDEVICE-TOKEN AUTH ONLY, SELF-SCOPED BY CONSTRUCTION (the `/self/*`\nfamily): the subject is the CALLING device, resolved from the `dt_`\ncredential; there is no `device_id` in the body or the path, so a\ndevice can revoke exactly one row — its own — and a JWT caller, which\nhas no device context, is refused with 403 `device_context_required`\n(the family's existing answer: there is no id to enumerate, so 403 and\nnot 404). The JWT-only `POST /api/devices/{id}/revoke_token` (cycle 8)\nis untouched and still the phone's door onto OTHER devices.\n\nWhy: before this cycle a kiosk \"Log out\" was CLIENT-ONLY. The screen\nwiped its token locally, but `revoke_token` and `/api/devices/release`\nare JWT-only, so the server row kept a LIVE token forever (`is_active`\ntrue, never swept, the kiosk-only Settings cards unlocked for an\naccount the kiosk had left) and the native heartbeat kept the old row\nreading `monitoring`; the kiosk's `.kiosk` FCM row stayed under the old\naccount and the tablet WOKE AND SOUNDED for that account's lows while\nshowing the next account's screen. Operator decision 3 (2026-10-28):\nself-revoke only — the row turns inactive and the daily sweep removes\nit; not an immediate delete.\n\nWrites, one transaction: (a) `pairing_service.revoke_device_token` —\n`token_hash` cleared, `token_revoked_at` set, `token_fingerprint` KEPT\n(cycle 432: a later refused heartbeat from an old APK is still\nattributed to this row); (b) `device_service.release_device_push_tokens`\n— this device's push rows by `device_id` or by the names the install\nremembers, both arms carrying `user_id`. Nothing touches the kiosk\nstate machine: it derives `unpaired` on its next tick and, after the\nconfigured bound, sends the household ONE \"no longer paired\" notice —\nthe same path an admin or phone revoke takes (operator decision 6).\n\nIdempotent in effect, not in auth: a SECOND call presents a revoked\ncredential and is refused 401 at `_authenticate` (with a `revoked`\nrefusal row); the SPA treats 401 as done.","operationId":"self_revoke_token_api_devices_self_revoke_token_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SelfRevokeIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SelfRevokeOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/devices/{device_id}":{"patch":{"tags":["Devices"],"summary":"Patch Device","description":"Cycle 100 / 377 — update an owned device's settings.\n\nJWT-only (`get_current_user_jwt_only`): the owner manages this from\ntheir phone, and a stolen kiosk's device token must not be able to\nreassign devices or relabel the fleet. Verifies ownership (404 on\nmiss — never a 403, so a probe can't enumerate other users' devices).\n\nEach field is an INDEPENDENT tri-state read off `model_fields_set`,\nso one, the other, or both may be sent and an omitted field is left\nuntouched:\n\n  * `wake_word` (cycle 100) — `null` unsets it (the agent falls back\n    to its local default); a string must match the wake-word charset.\n  * `name` (cycle 377) — a non-empty string, ≤100 chars, stripped.\n    Not nullable; an explicit `null` is rejected at the schema.\n\nA body with neither field is a harmless no-op that echoes the current\nrow rather than failing silently.","operationId":"patch_device_api_devices__device_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"device_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Device Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DevicePatchRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Devices"],"summary":"Delete Device","description":"Remove a device the caller owns (404 otherwise, never 403 on a miss).\n\n⚠ Cycle 471 — JWT-ONLY (operator decision 5, 2026-10-28). This route\nwas `CurrentUser`, so any paired kiosk's `dt_` token could DELETE any\ndevice row of its account — a sibling kiosk's live-token row included,\nwhich darkened that screen on its next request with no audit. That\ncontradicted the cycle-8 posture every other device write already\nholds (`revoke_token`, `PATCH`, `/release`). A kiosk that wants to\nforget ITSELF signs out, which now self-revokes\n(`POST /api/devices/self/revoke_token`); the household manages other\nrows from a phone.","operationId":"delete_device_api_devices__device_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"device_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Device Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/devices/{device_id}/revoke_token":{"post":{"tags":["Devices"],"summary":"Revoke Device Token","description":"JWT-only — a stolen kiosk must not be able to revoke other devices.\n\nIdempotent: revoking a device that has no token clears nothing,\nsets `token_revoked_at` if it was previously unset, and returns\nthe row.","operationId":"revoke_device_token_api_devices__device_id__revoke_token_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"device_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Device Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/devices/release":{"post":{"tags":["Devices"],"summary":"Release Credentials","description":"Cycle 418 — release every credential this INSTALL holds, on sign-out.\n\n⚠ SELF-SCOPED BY CONSTRUCTION. There is no `user_id` parameter anywhere in\nthe body or the path: every delete is `(credential AND caller's account)`.\nIDOR is not merely checked for, it is unrepresentable — a caller cannot\nname another account's rows, and naming another account's CREDENTIAL\ndeletes nothing because the account half of the predicate will not match.\n\n⚠ JWT-ONLY (cycle-244 posture). A paired kiosk's `dt_` token is refused,\nbecause a wall-mounted alarm surface must never be able to deregister a\nhousehold's phones.\n\n`204` for both \"deleted\" and \"nothing to delete\" — it discloses nothing\nabout whether a credential existed or who held it, and it is safely\nretryable. Sign-out calls this best-effort and must never block on it.\n\nEnds the caller's Live Activities on this device BEFORE deleting their\ntoken rows: deleting the row stops updates but does not dismiss a tile iOS\nis already showing, and the row is the only handle for the end push.\n\nCycle 470: `release_watch_tokens` (an EXPLICIT sign-out only) also\nreleases every watch token under the caller's account, behind the\n`logout_releases_watch_tokens` kill switch — see\n`device_service.release_credentials`. Still JWT-only: a kiosk's `dt_`\ntoken is refused here until cycle 471 gives it a self-scoped door.","operationId":"release_credentials_api_devices_release_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceReleaseIn"}}},"required":true},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/devices/prune_inactive":{"post":{"tags":["Devices"],"summary":"Prune Inactive Devices","description":"Cycle 131 — remove the caller's revoked / stale device rows.\n\nKeeps every device with a live token or recent activity; removes\nrevoked devices and never-tokened stale duplicates. Returns\n`{removed: N}`. Scoped to the caller's own devices.","operationId":"prune_inactive_devices_api_devices_prune_inactive_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/settings":{"get":{"tags":["Settings"],"summary":"Get Settings","operationId":"get_settings_api_settings_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserSettingsOut"}}}}},"security":[{"HTTPBearer":[]}]},"patch":{"tags":["Settings"],"summary":"Patch Settings","operationId":"patch_settings_api_settings_patch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserSettingsPatch"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserSettingsOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/settings/reset":{"post":{"tags":["Settings"],"summary":"Reset Settings","operationId":"reset_settings_api_settings_reset_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserSettingsOut"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/alerts/unacknowledged_count":{"get":{"tags":["Alerts"],"summary":"Unacknowledged Count","operationId":"unacknowledged_count_api_alerts_unacknowledged_count_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertUnacknowledgedCountResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/alerts/active_count":{"get":{"tags":["Alerts"],"summary":"Active Count","description":"Cycle 310 — the un-wedge truth check: how many fired, NOT-yet-\nserver-recovered, non-synthetic alerts exist across every member the\nCALLING account can access (owned ∪ granted — the same accessible set\nthe dashboard uses). Consumer-scoped: resolved from the bearer alone,\nno member/user param, so one household can never probe another.\nConsumed by (1) the SPA's latched-episode reconciliation and (2) the\nkiosk OTA updater's deferral cross-check. Snoozed/silenced/acked rows\nstill COUNT — an un-recovered episode is live for install-gating\npurposes; only server-authored recovery (or a row that no longer\nexists) clears it. Read-only, never on the alarm dispatch path.","operationId":"active_count_api_alerts_active_count_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertActiveCountResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/alerts/acknowledge_all":{"post":{"tags":["Alerts"],"summary":"Acknowledge All","operationId":"acknowledge_all_api_alerts_acknowledge_all_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertAcknowledgeAllResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/alerts":{"get":{"tags":["Alerts"],"summary":"List Alerts","operationId":"list_alerts_api_alerts_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"hours","in":"query","required":false,"schema":{"type":"integer","maximum":2160,"minimum":1,"default":24,"title":"Hours"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":10000,"minimum":1,"default":200,"title":"Limit"}},{"name":"unacknowledged_only","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Unacknowledged Only"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertHistoryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/alerts/{alert_id}/acknowledge":{"post":{"tags":["Alerts"],"summary":"Acknowledge Alert","operationId":"acknowledge_alert_api_alerts__alert_id__acknowledge_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"alert_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Alert Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/alerts/{alert_id}/snooze":{"post":{"tags":["Alerts"],"summary":"Snooze Alert","description":"Cycle 38: \"Address the Situation\". Body is optional; when\nomitted (or `duration_seconds` is null) the server uses the cycle-\n20.x 5-minute default. Server-clamps to [60, 1800].","operationId":"snooze_alert_api_alerts__alert_id__snooze_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"alert_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Alert Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/AlertSnoozeRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/alerts/{alert_id}/silence":{"post":{"tags":["Alerts"],"summary":"Silence Alert","description":"Cycle 38: \"Silence\". No body; the row's `silenced_at` is\nserver-stamped and `snoozed_until` cleared.\n\nCycle 410: the cycle-73 floor is enforced HERE now, not only in the\nclient — an urgent low (or a `low` whose member has an open urgent\nsibling, the cycle-408 rule) answers **409 `not_silenceable_urgent_low`**\nand nothing is written. The level is read from the ROW at request time,\nnever from the request. `urgent_high`, `low` and `high` are unchanged;\nsnooze is unaffected.","operationId":"silence_alert_api_alerts__alert_id__silence_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"alert_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Alert Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/alerts/{alert_id}/sound_now":{"post":{"tags":["Alerts"],"summary":"Sound Now","description":"End the lead window on an urgent low so every device sounds now.\n\nONE DIRECTION ONLY. This can END a window; it can never open, extend\nor shorten one to anything but zero — cycle 407's reasoning for making\n`end_custody` client-reachable: the only reachable outcome makes the\nalarm LOUDER, which is the direction that needs no gate.\n\nNo new auth surface: the same `WriteMember` dependency as `/treating`,\n`/checkin`, `/snooze` and `/silence`; a paired kiosk for the member is\nallowed, as on `/checkin`. The lookup is scoped by member AND alert id,\nso a foreign or nonexistent id gets the SAME 404 — no oracle for\neither. No body is read.\n\n⚠ NOT RATE LIMITED INTO ANY QUIET BUCKET (cycle 407's V2: the quiet\nsurface must never throttle the loud one during a hypo). It is\nself-limiting — the first call closes the window.\n\nStatuses:\n  200 — the window is closed (or there was none: idempotent no-op);\n        body is the refreshed `AlertOut` with `audio_lead_until: null`\n  404 — no such alert for this member\n  409 — the episode already ended (`episode_closed`)","operationId":"sound_now_api_alerts__alert_id__sound_now_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"alert_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Alert Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/alerts/{alert_id}/treating":{"post":{"tags":["Alerts"],"summary":"Begin Custody","description":"Open a bounded treating window on an urgent low.\n\nTHE MOST ABUSE-SENSITIVE ROUTE ADDED IN A LONG TIME, because it is a\nQUIETING action on an alarm path — so it deliberately introduces no\nnew auth surface at all. It uses the same `WriteMember` dependency as\n`/snooze` and `/silence`: the caller must already hold a credential\nwith write access to the ACTIVE member, so a device token belonging to\nanother household resolves to a different member and the alert lookup\n(which is scoped by `member_id` AND `alert_id`) simply misses → 404.\n\nNOTHING IN THE BODY IS TRUSTED FOR STATE. Since cycle 404 no field of\nthe body reaches the window at all — the duration is server-assigned,\nand `contact_id` is the only value read. The anchor glucose, the\nexpiry and the count are server-derived; extra keys are ignored, never\nvalidated.\n\nStatuses:\n  200 — window open (or reset to the full ten minutes); body is the\n        refreshed `AlertOut`. ⚠ CYCLE 427: ON A DARK FEED TOO — the\n        window opens unanchored, exactly as a press-1 and a snooze\n        always did, and holds through the gap (operator-authorized\n        2026-09-08). `no_fresh_reading` is no longer a refusal.\n  404 — no such alert for this member\n  409 — not an urgent low / already recovered or silenced\n  429 — a wedged client re-POSTing in a loop (the 6/60 s flood guard;\n        the client disables the button while a request is in flight\n        and renders the refusal on the takeover and the treating\n        screen)\n\n⚠ CYCLE 404 — `duration_seconds` IS NOW IGNORED OUTRIGHT, AND THE 422\nIS GONE. There is one duration and the server assigns it. For months\ncached kiosks and phones will POST 300 / 600 / 900 over a sounding\nurgent low; refusing them inline mid-alarm helps nobody, so the window\nsimply opens at the server's value. The field is read nowhere, logged\nnowhere and echoed nowhere — it is genuinely dead, not merely\noverridden. (Deliberately NOT the cycle-395 precedent, which 422s an\nout-of-set CHOICE. Refuse a bad choice; ignore a retired parameter.)","operationId":"begin_custody_api_alerts__alert_id__treating_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"alert_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Alert Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertTreatingRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/alerts/{alert_id}/checkin":{"post":{"tags":["Alerts"],"summary":"Answer Checkin","description":"Answer the prompt on an open treating window — or press one of\nthe screen's two standing actions.\n\nTHE CHECK-IN ANSWER IS A SUPPRESSION CAPABILITY (\"yes\" can extend the\nquiet), so it takes exactly the treating endpoints' posture and adds no\nauth surface: the same `WriteMember` as `/snooze`, `/silence` and\n`/treating`; the alert lookup is scoped by `member_id` AND `alert_id`,\nso a foreign or nonexistent id misses byte-identically → 404. A paired\nkiosk for the member is allowed (it is the screen the question is on).\n\n⚠ THE GLUCOSE IS THE ARBITER. The body is `{answer, kind?}` and\nNOTHING else is read — no glucose value, no deadline, no count can be\nasserted by a client. `kind` names WHICH prompt a `yes` / `no` answers\n(`checkin` / `worsening` / `still_treating`; absent = `checkin`, the\nonly prompt a pre-427 client knows); an answer to a prompt the server\nhas since superseded is refused `409 prompt_superseded`. The server\nreads the live readings under the row lock and decides: ⚠ CYCLE 450\n(operator decision 2026-09-21) — EVERY check-in \"yes\" RENEWS the window\nto its full ten minutes from the answer (`extended`), still low, flat,\nrising, in range or dark alike, through `begin_custody`'s renewal\nmode: re-anchored to the live value, `custody_count` untouched, the\ncheck-in re-armed, silent on every outbound rail; `winding_down` is\nretired. Uncapped on the shipping default —\n`SUGALARM_CUSTODY_CHECKIN_RENEWALS_MAX` (0 = UNLIMITED) is the operator\nlever, and past a positive limit the answer is recorded, the window is\nnot moved and the outcome is `capped`;\na worsening / still-treating \"yes\" re-anchors and resets ten minutes;\na check-in or worsening \"no\" is the help path (the window stays open;\nthe other heroes are texted and rung beneath it); a still-treating\n\"no\" ends the window `caregiver_declined` and starts a fresh search.\nNo path lets a client set `custody_until` directly. `help` and\n`resume` need no pending prompt and only ever make the alarm LOUDER.\n\nStatuses:\n  200 — `{outcome, alert}`; `outcome` says what the server did\n        (`resolved` = nothing was pending: the other device answered\n        first — the current row comes back, it is not an error)\n  404 — no such alert for this member\n  409 — no treating window is open (`no_custody`); the prompt was\n        superseded (`prompt_superseded`); the episode closed\n  429 — a wedged client looping the answer (its OWN rate-limit bucket,\n        so it can never starve the `I'm treating this` tap)","operationId":"answer_checkin_api_alerts__alert_id__checkin_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"alert_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Alert Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertCheckinRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertCheckinOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/alerts/{alert_id}/optout/undo":{"post":{"tags":["Alerts"],"summary":"Undo Opt Out","description":"Cycle 404 — \"I can help after all\": reinstate a press-3 hero.\n\n⚠ THIS CAN ONLY MAKE A PHONE LOUDER. It removes an entry from\n`episode_opt_outs` and does nothing else, so it introduces no\nsuppression surface and needs no gate beyond household write access —\nthe same `WriteMember` every alarm control here uses.\n\nWho gets reinstated: `body.contact_id` when a grant-holder acts on a\nhero's behalf, else the CALLER's own linked contact for this member\n(arc 1). A caller with no linked contact and no body is a no-op 200.\nA foreign or nonexistent alert, or a `contact_id` that is not one of\nthis member's heroes, all get the SAME 404 — no oracle for either id.","operationId":"undo_opt_out_api_alerts__alert_id__optout_undo_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"alert_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Alert Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/AlertOptOutUndoRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/alerts/{alert_id}/treating/identity":{"post":{"tags":["Alerts"],"summary":"Set Custody Identity","description":"Cycle 392 — the SECOND tap: attach a name to a running window.\n\n⚠ IDENTITY IS NEVER A GATE. This endpoint only ever refines a window\nthat is ALREADY open; it cannot open, extend, shorten or close one, and\nskipping it entirely costs the caregiver nothing.\n\n`{\"contact_id\": null}` is the explicit \"Someone else\" answer and is a\nreal, supported outcome — not a failure to answer.\n\n**NO FREE TEXT.** The only accepted input is an id from a list the\nhousehold already curated, so nothing a caregiver types can reach an\nSMS body or a TwiML `<Say>`.\n\nStatuses:\n  200 — recorded (idempotent; a repeat with the same id is a no-op)\n  404 — no such alert for this member, OR a contact id that is not\n        this member's.\n\n        ⚠ THE PROPERTY THAT MATTERS IS NARROWER THAN \"ALL 404s LOOK\n        ALIKE\", AND SAYING THE BROAD THING WOULD BE FALSE: a missing\n        ALERT answers `{\"detail\": \"Alert not found\"}` while a bad\n        CONTACT answers a structured `unknown_contact` body, and they\n        are NOT byte-identical. What is guaranteed — and what the\n        oracle question actually turns on — is that a contact\n        belonging to ANOTHER member and a contact that does not exist\n        AT ALL are indistinguishable from each other, so this endpoint\n        cannot be used to probe which contact ids exist. A caller who\n        already holds a valid alert id for their own member learns\n        nothing about anyone else's contacts.\n  409 — there is no open treating window on that alert","operationId":"set_custody_identity_api_alerts__alert_id__treating_identity_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"alert_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Alert Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertTreatingIdentityRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/analytics/summary":{"get":{"tags":["Analytics"],"summary":"Summary","operationId":"summary_api_analytics_summary_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"hours","in":"query","required":false,"schema":{"type":"integer","maximum":2160,"minimum":1,"default":24,"title":"Hours"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlucoseSummary"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/analytics/summary/range":{"get":{"tags":["Analytics"],"summary":"Summary Range","operationId":"summary_range_api_analytics_summary_range_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"start","in":"query","required":true,"schema":{"type":"string","format":"date-time","description":"ISO-8601 UTC start","title":"Start"},"description":"ISO-8601 UTC start"},{"name":"end","in":"query","required":true,"schema":{"type":"string","format":"date-time","description":"ISO-8601 UTC end","title":"End"},"description":"ISO-8601 UTC end"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GlucoseSummary"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/analytics/daily":{"get":{"tags":["Analytics"],"summary":"Daily","operationId":"daily_api_analytics_daily_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":90,"minimum":1,"default":14,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailySummaryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/export/glucose.csv":{"get":{"tags":["Export"],"summary":"Export Glucose Csv","operationId":"export_glucose_csv_api_export_glucose_csv_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"hours","in":"query","required":false,"schema":{"type":"integer","maximum":2160,"minimum":1,"default":720,"title":"Hours"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/export/full.csv":{"get":{"tags":["Export"],"summary":"Export Full Csv","operationId":"export_full_csv_api_export_full_csv_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"hours","in":"query","required":false,"schema":{"type":"integer","maximum":2160,"minimum":1,"default":720,"title":"Hours"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/reports/agp":{"get":{"tags":["Reports"],"summary":"Agp Report","operationId":"agp_report_api_reports_agp_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":90,"minimum":1,"default":14,"title":"Days"}},{"name":"tz_offset_minutes","in":"query","required":false,"schema":{"type":"integer","maximum":840,"minimum":-840,"default":0,"title":"Tz Offset Minutes"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/reports/alarms":{"get":{"tags":["Reports"],"summary":"Alarm Report","operationId":"alarm_report_api_reports_alarms_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":90,"minimum":1,"default":14,"title":"Days"}},{"name":"tz_offset_minutes","in":"query","required":false,"schema":{"type":"integer","maximum":840,"minimum":-840,"default":0,"title":"Tz Offset Minutes"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/predictions/acknowledge_all":{"post":{"tags":["Predictions"],"summary":"Acknowledge All","operationId":"acknowledge_all_api_predictions_acknowledge_all_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PredictionAcknowledgeAllResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/predictions/stats":{"get":{"tags":["Predictions"],"summary":"Stats","operationId":"stats_api_predictions_stats_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":90,"minimum":1,"default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PredictionStatsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/predictions":{"get":{"tags":["Predictions"],"summary":"List Predictions","operationId":"list_predictions_api_predictions_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"hours","in":"query","required":false,"schema":{"type":"integer","maximum":2160,"minimum":1,"default":24,"title":"Hours"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":10000,"minimum":1,"default":200,"title":"Limit"}},{"name":"unacknowledged_only","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Unacknowledged Only"}},{"name":"pending_only","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Pending Only"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PredictionHistoryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/predictions/{prediction_id}/acknowledge":{"post":{"tags":["Predictions"],"summary":"Acknowledge","operationId":"acknowledge_api_predictions__prediction_id__acknowledge_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"prediction_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Prediction Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PredictionOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/pairing/request":{"post":{"tags":["Pairing"],"summary":"Pairing Request","operationId":"pairing_request_api_pairing_request_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PairingRequestIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PairingRequestOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/pairing/poll/{pairing_id}":{"get":{"tags":["Pairing"],"summary":"Pairing Poll","operationId":"pairing_poll_api_pairing_poll__pairing_id__get","parameters":[{"name":"pairing_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Pairing Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PairingPollOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/pairing/approve":{"post":{"tags":["Pairing"],"summary":"Pairing Approve","operationId":"pairing_approve_api_pairing_approve_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PairingApproveIn"}}},"required":true},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/members":{"post":{"tags":["Members"],"summary":"Create Member","operationId":"create_member_api_members_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemberCreateIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemberOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Members"],"summary":"List Members","operationId":"list_members_api_members_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"include_archived","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Archived"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemberListOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/members/{member_id}":{"get":{"tags":["Members"],"summary":"Get Member","operationId":"get_member_api_members__member_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"member_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Member Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemberOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["Members"],"summary":"Patch Member","operationId":"patch_member_api_members__member_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"member_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Member Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemberPatchIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemberOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/members/{member_id}/archive":{"post":{"tags":["Members"],"summary":"Archive Member","operationId":"archive_member_api_members__member_id__archive_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"member_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Member Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/members/{member_id}/cgm/connect":{"post":{"tags":["Members"],"summary":"Member Cgm Connect","operationId":"member_cgm_connect_api_members__member_id__cgm_connect_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"member_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Member Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CGMConnectRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CGMConnectResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/members/{member_id}/cgm/status":{"get":{"tags":["Members"],"summary":"Member Cgm Status","operationId":"member_cgm_status_api_members__member_id__cgm_status_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"member_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Member Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CGMStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/members/{member_id}/cgm/disconnect":{"delete":{"tags":["Members"],"summary":"Member Cgm Disconnect","operationId":"member_cgm_disconnect_api_members__member_id__cgm_disconnect_delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"member_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Member Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CGMDisconnectResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/members/{member_id}/link_invite":{"post":{"tags":["Members"],"summary":"Create Link Invite","description":"Owner-only. Issues a 6-digit, email-targeted invite that the\ninvited user can accept from their own account to tie this\nhousehold member to that account's self-member.","operationId":"create_link_invite_api_members__member_id__link_invite_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"member_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Member Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemberLinkInviteCreateIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemberLinkInviteOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/members/{member_id}/link_invites":{"get":{"tags":["Members"],"summary":"List Link Invites","description":"Owner-only. Lists pending invites for this member. Code is\nintentionally omitted — the code is surfaced once at create.","operationId":"list_link_invites_api_members__member_id__link_invites_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"member_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Member Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemberLinkInviteListOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/members/{member_id}/links":{"get":{"tags":["Members"],"summary":"List Member Grants","description":"Owner-only. Lists current grants on this member (the other\naccounts that can see / write its data). The UI uses this to\nrender the \"Linked to X\" row + Unlink affordance.","operationId":"list_member_grants_api_members__member_id__links_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"member_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Member Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemberLinkGrantListOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/members/link_invites/{invite_id}":{"delete":{"tags":["Members"],"summary":"Revoke Link Invite","description":"Owner-only. Flips a pending invite to `revoked`.","operationId":"revoke_link_invite_api_members_link_invites__invite_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"invite_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Invite Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/members/{member_id}/link/{user_id}":{"delete":{"tags":["Members"],"summary":"Unlink Member Grant","description":"Owner-only. Removes the `member_links` grant for `user_id` on\nthis member. Does not un-merge data (cycle-60 documented behavior);\nit only revokes the other account's ongoing access.","operationId":"unlink_member_grant_api_members__member_id__link__user_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}},{"name":"member_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Member Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemberLinkUnlinkOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/members/{member_id}/sensor_pause":{"post":{"tags":["Members"],"summary":"Set Sensor Pause","operationId":"set_sensor_pause_api_members__member_id__sensor_pause_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"member_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Member Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SensorPauseIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Members"],"summary":"Clear Sensor Pause","operationId":"clear_sensor_pause_api_members__member_id__sensor_pause_delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"member_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Member Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/members/{member_id}/heroes/roster":{"get":{"tags":["Treating attribution"],"summary":"Hero Roster","operationId":"hero_roster_api_members__member_id__heroes_roster_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"member_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Member Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/HeroRosterItem"},"title":"Response Hero Roster Api Members  Member Id  Heroes Roster Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/members/{member_id}/custody/attribution":{"post":{"tags":["Treating attribution"],"summary":"Attribute Custody","description":"200 → the attribution object · 404 hero not on this member's list ·\n409 no open window / a stale window · 429 the member's picker bucket.","operationId":"attribute_custody_api_members__member_id__custody_attribution_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"member_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Member Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttributionIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/TreatingByOut"},{"type":"null"}],"title":"Response Attribute Custody Api Members  Member Id  Custody Attribution Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Treating attribution"],"summary":"Undo Custody Attribution","description":"Undo: the open window goes back to unattributed (one ledger row).\nSame refusals as the POST; answers `null` on success.","operationId":"undo_custody_attribution_api_members__member_id__custody_attribution_delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"member_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Member Id"}},{"name":"window","in":"query","required":true,"schema":{"type":"string","format":"date-time","title":"Window"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/TreatingByOut"},{"type":"null"}],"title":"Response Undo Custody Attribution Api Members  Member Id  Custody Attribution Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/members/{member_id}/heroes/{hero_id}/avatar":{"put":{"tags":["Hero pictures"],"summary":"Set Hero Avatar Preset","description":"Pick a preset. Clears any photo (its stored object is deleted).","operationId":"set_hero_avatar_preset_api_members__member_id__heroes__hero_id__avatar_put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"hero_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Hero Id"}},{"name":"member_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Member Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HeroAvatarPresetIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HeroAvatarOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/members/{member_id}/heroes/{hero_id}/avatar/photo":{"post":{"tags":["Hero pictures"],"summary":"Upload Hero Avatar Photo","description":"Upload a photo. Multipart, one image file (field `image`).","operationId":"upload_hero_avatar_photo_api_members__member_id__heroes__hero_id__avatar_photo_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"hero_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Hero Id"}},{"name":"member_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Member Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HeroAvatarOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Hero pictures"],"summary":"Remove Hero Avatar Photo","description":"Back to the preset; the stored object is deleted. Idempotent.","operationId":"remove_hero_avatar_photo_api_members__member_id__heroes__hero_id__avatar_photo_delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"hero_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Hero Id"}},{"name":"member_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Member Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HeroAvatarOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Hero pictures"],"summary":"Get Hero Avatar Photo","description":"The stored WebP. 404 when the hero is not on this member's list, has\nno photo, the requested `v` is not the current one, or the object is\ngone — every one of which the client answers with the preset.","operationId":"get_hero_avatar_photo_api_members__member_id__heroes__hero_id__avatar_photo_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"hero_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Hero Id"}},{"name":"member_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Member Id"}},{"name":"size","in":"query","required":false,"schema":{"type":"integer","default":256,"title":"Size"}},{"name":"v","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"V"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/me/members":{"get":{"tags":["Me"],"summary":"Me Members","description":"Cycle 60: lists owned + granted members. The dashboard variant\n(`with_latest=true`) carries latest-reading + alert-level per\nmember for both owned and granted sets via the same batched\nqueries.\n\nCycle 113: `include_archived` (additive, default false — pre-deploy\nclients are unaffected) lets Settings → Members render the same\naccessible set the dashboard / active-member switcher use while\nkeeping its \"Show archived\" toggle. Owner-only manage controls\n(Archive, the link panel) are gated client-side per `owner_user_id`;\nthe archived set never widens authorization — only visibility.\n`with_latest` (the dashboard) stays non-archived by construction.","operationId":"me_members_api_me_members_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"with_latest","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"With Latest"}},{"name":"include_archived","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Archived"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/me/active_member":{"get":{"tags":["Me"],"summary":"Get Active Member Endpoint","operationId":"get_active_member_endpoint_api_me_active_member_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActiveMemberOut"}}}}},"security":[{"HTTPBearer":[]}]},"put":{"tags":["Me"],"summary":"Set Active Member Endpoint","operationId":"set_active_member_endpoint_api_me_active_member_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActiveMemberSetIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActiveMemberOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/me/members/{member_id}/link":{"delete":{"tags":["Me"],"summary":"Unlink Own Member Grant","description":"Grantee-side: remove the CALLER'S OWN grant on a member shared to\nthem, dropping it from their accessible set. The inverse of the\nowner-only `DELETE /api/members/{member_id}/link/{user_id}` — this\none takes no `user_id` (it always operates on the caller, so it\ncan't touch anyone else's grant) and refuses a member the caller\nOWNS (owners archive instead). 404 when the caller has no such\ngrant. Does not un-merge historical data (cycle-60 contract).","operationId":"unlink_own_member_grant_api_me_members__member_id__link_delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"member_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Member Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemberLinkUnlinkOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/me/link_invites/accept":{"post":{"tags":["Me"],"summary":"Accept Link Invite","description":"Self-only. Validates the code (must match the invited email,\ncase-insensitive; rejects expired/revoked/already-accepted-by-\nsomeone-else), runs the merge, and creates the grant. Returns the\ncanonical member id + owner identity for the UI's \"now sharing\nwith X\" confirmation.","operationId":"accept_link_invite_api_me_link_invites_accept_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemberLinkInviteAcceptIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemberLinkInviteAcceptOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/me/subscription":{"get":{"tags":["Billing"],"summary":"My Subscription","operationId":"my_subscription_api_me_subscription_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response My Subscription Api Me Subscription Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/me/subscription/onboarding-done":{"post":{"tags":["Billing"],"summary":"Mark Subscription Step Done","description":"Cycle 464: stamp that THIS account has been shown the \"Start your free\nmonth\" step, so it never reappears on another launch or device (Settings\nis the way back). JWT only: a kiosk can never reach a billing surface, so\na device token is refused (403) rather than allowed to write the owner's\nrecord. Idempotent: the first stamp wins and a repeat writes nothing.","operationId":"mark_subscription_step_done_api_me_subscription_onboarding_done_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Mark Subscription Step Done Api Me Subscription Onboarding Done Post"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/billing/web/code":{"post":{"tags":["Billing"],"summary":"Request Code","description":"Always 202 with the same body, whether or not the account exists.\nEvery send is a background task, so the email itself adds no time; an\naccount's code row is still minted in the request, so the response time\nis not equalised (security review, cycle 516). Cycle 516: an address with\nno account is emailed how to create one.","operationId":"request_code_api_billing_web_code_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CodeIn"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Request Code Api Billing Web Code Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/billing/web/verify":{"post":{"tags":["Billing"],"summary":"Verify Code","description":"Code → handoff. Any failure is one generic 400.\n\n⚠ The failure is RETURNED, not raised: raising would roll back the\nattempt counter the service just incremented, and the 5-attempt cap would\nnever hold.","operationId":"verify_code_api_billing_web_verify_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/billing/web/checkout":{"post":{"tags":["Billing"],"summary":"Create Checkout","operationId":"create_checkout_api_billing_web_checkout_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Create Checkout Api Billing Web Checkout Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/billing/web/portal":{"post":{"tags":["Billing"],"summary":"Portal From Handoff","operationId":"portal_from_handoff_api_billing_web_portal_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HandoffIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Portal From Handoff Api Billing Web Portal Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/billing/web/handoff":{"post":{"tags":["Billing"],"summary":"Mint App Handoff","description":"The Cycle 464 \"Pay on thesugaralarm.com instead\" link. The token rides\nin the URL FRAGMENT, which a browser never sends to a server or puts in a\nReferer header.","operationId":"mint_app_handoff_api_billing_web_handoff_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Mint App Handoff Api Billing Web Handoff Post"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/billing/stripe/portal":{"post":{"tags":["Billing"],"summary":"Portal For Signed In","operationId":"portal_for_signed_in_api_billing_stripe_portal_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Portal For Signed In Api Billing Stripe Portal Post"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/billing/apple/offer":{"get":{"tags":["Billing"],"summary":"Apple Offer","description":"`{product_id, has_trial, app_account_token}`. The token is the\naccount's opaque purchase token (minted on first use, never changed),\nnever the account id.","operationId":"apple_offer_api_billing_apple_offer_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Apple Offer Api Billing Apple Offer Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/billing/apple/verify":{"post":{"tags":["Billing"],"summary":"Apple Verify","description":"Body `{ \"signed_transaction\": \"<JWS>\" }` → the `GET /api/me/subscription`\nbody for the caller, once the transaction is verified, bound to this\naccount and re-checked with the App Store Server API, plus\n`verified_environment` (`production` / `sandbox`, cycle 480.5).","operationId":"apple_verify_api_billing_apple_verify_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Apple Verify Api Billing Apple Verify Post"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/billing/google/offer":{"get":{"tags":["Billing"],"summary":"Google Offer","description":"`{product_id, base_plan_id, offer_id, obfuscated_account_id}`.\n`offer_id` is the free-month offer only while the account is trial\neligible; the account id is the opaque purchase token, never the\naccount id.","operationId":"google_offer_api_billing_google_offer_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Google Offer Api Billing Google Offer Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/billing/google/verify":{"post":{"tags":["Billing"],"summary":"Google Verify","description":"Body `{ \"purchase_token\": str, \"product_id\": str }` → the\n`GET /api/me/subscription` body for the caller once the purchase is\nre-read from the Android Publisher API, bound to this account,\nwritten and acknowledged.","operationId":"google_verify_api_billing_google_verify_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Google Verify Api Billing Google Verify Post"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/billing/google/rtdn":{"post":{"tags":["Billing"],"summary":"Google Rtdn","description":"Play's Real-time developer notifications (a Pub/Sub push).","operationId":"google_rtdn_api_billing_google_rtdn_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/tts/veracity_event":{"post":{"tags":["TTS"],"summary":"Report Veracity Event","description":"Log a client-reported TTS veracity gate event (`tts_veracity_abort`\net al). Telemetry only — never on any alarm or speech path. Over-limit\nevents are dropped silently (still 204 — the client is fire-and-forget\nand must never retry-loop on telemetry).","operationId":"report_veracity_event_api_tts_veracity_event_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VeracityEventIn"}}},"required":true},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/tts/voices":{"get":{"tags":["TTS"],"summary":"List Voices","description":"Return the voice catalog.\n\n`locale_prefix` is a deliberate NO-OP kept for backward compatibility:\nan SPA build from before this cycle still appends `?locale_prefix=en`,\nand rejecting it would break Voice settings on every client that hasn't\npicked up the new bundle yet. Accept and ignore.","operationId":"list_voices_api_tts_voices_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"locale_prefix","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":2,"maxLength":8},{"type":"null"}],"description":"Ignored since cycle 330 (the voice library is not locale-partitioned). Still ACCEPTED so an older client that keeps sending it is not 422'd.","deprecated":true,"title":"Locale Prefix"},"description":"Ignored since cycle 330 (the voice library is not locale-partitioned). Still ACCEPTED so an older client that keeps sending it is not 422'd.","deprecated":true}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceListOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tts/speak":{"post":{"tags":["TTS"],"summary":"Speak","description":"Stream `audio/mpeg` for the given text in the chosen voice.","operationId":"speak_api_tts_speak_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SpeakIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/push/vapid":{"get":{"tags":["Push"],"summary":"Get Vapid","description":"Return the VAPID public key. Public — it's literally the public\nhalf of the keypair; no privacy concern.","operationId":"get_vapid_api_push_vapid_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PushVapidOut"}}}}}}},"/api/push/subscriptions":{"get":{"tags":["Push"],"summary":"List Subscriptions","operationId":"list_subscriptions_api_push_subscriptions_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PushSubscriptionListOut"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["Push"],"summary":"Create Subscription","operationId":"create_subscription_api_push_subscriptions_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PushSubscribeIn"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PushSubscriptionOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/push/subscriptions/{subscription_id}":{"delete":{"tags":["Push"],"summary":"Delete Subscription","operationId":"delete_subscription_api_push_subscriptions__subscription_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"subscription_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Subscription Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/push/test":{"post":{"tags":["Push"],"summary":"Send Test","operationId":"send_test_api_push_test_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PushTestOut"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/push/native/tokens":{"get":{"tags":["Push (Native)"],"summary":"List Tokens","operationId":"list_tokens_api_push_native_tokens_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NativePushListOut"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["Push (Native)"],"summary":"Create Token","operationId":"create_token_api_push_native_tokens_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NativePushRegisterIn"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NativePushTokenOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/push/native/activation":{"post":{"tags":["Push (Native)"],"summary":"Report Activation","description":"Cycle 365: one install reports what it can actually deliver, and\ngets the server's verdict back.\n\nLives on this router because it is the read-side companion to token\nregistration above: the verdict is largely \"does a token row exist for\nwhat this install claims to be\". `CurrentUser` (not the JWT-only\nvariant) for the same reason `/tokens` uses it — a shell on a device\ntoken must be able to report.\n\nDiagnostic only. It never gates delivery: a 4xx here, or never calling\nit at all, changes nothing about whether this device gets paged.\n\nCycle 431: the report may carry CLIENT-CLAIMED transport events\n(`events`). They land in `alarm_events` as `rail=\"client\"`,\n`actor=\"client_claimed\"`, server-stamped, 20 per report, 200 per hour —\nthe hourly cap keyed on the AUTHENTICATED identity (the session id, or\nthe user + credential kind) — never on the body's `client_id`, which is\na shape-only claim, and never on the source IP, which behind Fly's proxy\n(`--forwarded-allow-ips '*'`) is the caller's own `X-Forwarded-For`.","operationId":"report_activation_api_push_native_activation_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActivationReportIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActivationVerdictOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/push/native/tokens/{token_id}":{"delete":{"tags":["Push (Native)"],"summary":"Delete Token","operationId":"delete_token_api_push_native_tokens__token_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"token_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Token Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/push/native/test":{"post":{"tags":["Push (Native)"],"summary":"Send Test","operationId":"send_test_api_push_native_test_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NativePushTestOut"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/live-activity/tokens":{"post":{"tags":["Live Activity"],"summary":"Register Token","description":"Register (upsert) a `start` or `update` token for a member.","operationId":"register_token_api_live_activity_tokens_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LiveActivityTokenIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LiveActivityTokenAck"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]},"delete":{"tags":["Live Activity"],"summary":"Drop Token","description":"Drop a token on activity end / sign-out.","operationId":"drop_token_api_live_activity_tokens_delete","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LiveActivityTokenDeleteIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LiveActivityTokenAck"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/theme-packs":{"get":{"tags":["Theme packs"],"summary":"List Theme Packs","description":"Cycle 188/189: the merged catalog = code `core` + every PUBLISHED DB\npack. Drafts are never returned here. Shape is byte-compatible with\ncycle 174 (the `owned` flag + `image_presets[]`); the array now serves\nboth code presets and uploaded DB image presets.","operationId":"list_theme_packs_api_theme_packs_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThemePacksResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/me/entitlements":{"get":{"tags":["Theme packs"],"summary":"My Entitlements","operationId":"my_entitlements_api_me_entitlements_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MyEntitlementsResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/theme-packs/{pack_id}/purchase":{"post":{"tags":["Theme packs"],"summary":"Purchase Pack","description":"The single purchase seam — UNCHANGED this cycle: a dev-gated\nsimulate-purchase (authenticated; audited grant). Production 404s →\nclient shows \"Coming soon\". Now validates against the merged catalog so\na seeded/DB pack (legends, relics, …) is purchasable.","operationId":"purchase_pack_api_theme_packs__pack_id__purchase_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"pack_id","in":"path","required":true,"schema":{"type":"string","title":"Pack Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntitlementOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/entitlements":{"post":{"tags":["Theme packs"],"summary":"Admin Grant Entitlement","operationId":"admin_grant_entitlement_api_admin_entitlements_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntitlementGrantIn"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntitlementOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/admin/entitlements/{user_id}/{pack_id}":{"delete":{"tags":["Theme packs"],"summary":"Admin Revoke Entitlement","operationId":"admin_revoke_entitlement_api_admin_entitlements__user_id___pack_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}},{"name":"pack_id","in":"path","required":true,"schema":{"type":"string","title":"Pack Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Revoke Entitlement Api Admin Entitlements  User Id   Pack Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/theme-packs/{pack_id}/owners":{"get":{"tags":["Theme packs"],"summary":"Admin Theme Pack Owners","description":"Cycle 191: the accounts that own a pack (its entitlement rows joined to\nusers), so the admin Ownership panel can list + revoke them. Read-only —\nno audit row, no secrets. 404 for an absent pack OR the reserved `core`\n(which is code-defined + free and has no DB ownership), matching the\n404-not-403 posture of every admin theme-pack route.","operationId":"admin_theme_pack_owners_api_admin_theme_packs__pack_id__owners_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"pack_id","in":"path","required":true,"schema":{"type":"string","title":"Pack Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThemePackOwnersResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/theme-packs":{"get":{"tags":["Theme packs"],"summary":"Admin List Theme Packs","description":"Full catalog including drafts + the read-only `core`, each with its\nowner count + any admin-uploaded image presets (deletable).","operationId":"admin_list_theme_packs_api_admin_theme_packs_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminThemePacksResponse"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["Theme packs"],"summary":"Admin Create Theme Pack","operationId":"admin_create_theme_pack_api_admin_theme_packs_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThemePackCreateIn"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminThemePackOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/admin/theme-packs/{pack_id}":{"patch":{"tags":["Theme packs"],"summary":"Admin Update Theme Pack","operationId":"admin_update_theme_pack_api_admin_theme_packs__pack_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"pack_id","in":"path","required":true,"schema":{"type":"string","title":"Pack Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThemePackUpdateIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminThemePackOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Theme packs"],"summary":"Admin Delete Theme Pack","description":"Removes the pack + its membership (cascade). Deliberately does NOT\ntouch `entitlements` — existing owners keep their (now inert) rows.","operationId":"admin_delete_theme_pack_api_admin_theme_packs__pack_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"pack_id","in":"path","required":true,"schema":{"type":"string","title":"Pack Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Delete Theme Pack Api Admin Theme Packs  Pack Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/theme-packs/{pack_id}/publish":{"post":{"tags":["Theme packs"],"summary":"Admin Publish Theme Pack","operationId":"admin_publish_theme_pack_api_admin_theme_packs__pack_id__publish_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"pack_id","in":"path","required":true,"schema":{"type":"string","title":"Pack Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThemePackPublishIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminThemePackOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/theme-packs/core/hidden":{"put":{"tags":["Theme packs"],"summary":"Admin Set Core Hidden","description":"Replace the globally-hidden built-in set for the code-defined free\n`core` pack (the staged → Publish admin commit sends the FULL set).\nRejects `aurora` (422 `fallback_protected`) and any non-built-in id\n(422 `unknown_preset`). Audits ONLY the resulting hidden id list (no\nPII). Returns the refreshed `core` admin row (visible + hidden built-ins)\nso the UI can re-render the gallery + the Hidden-built-ins tray. Behind\n`require_admin` — 404 to non-admins like every admin route.","operationId":"admin_set_core_hidden_api_admin_theme_packs_core_hidden_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CoreHiddenIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminThemePackOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/admin/theme-packs/{pack_id}/image-presets":{"post":{"tags":["Theme packs"],"summary":"Admin Upload Image Preset","description":"Upload brand-new background art for a pack. Server composes the bucket\nkeys from validated slugs (no user-supplied path → no traversal), uploads\nthe validated WebP(s), then writes the image-preset row + a membership\nrow. 503 when storage creds are unset.","operationId":"admin_upload_image_preset_api_admin_theme_packs__pack_id__image_presets_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"pack_id","in":"path","required":true,"schema":{"type":"string","title":"Pack Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_admin_upload_image_preset_api_admin_theme_packs__pack_id__image_presets_post"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminThemePackOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/theme-packs/{pack_id}/image-presets/{preset_id}":{"delete":{"tags":["Theme packs"],"summary":"Admin Delete Image Preset","description":"Remove the image-preset row + its membership row, then best-effort\ndelete the bucket objects (a bucket failure never blocks the DB delete).\nMembers who had it selected fall back to `aurora`.","operationId":"admin_delete_image_preset_api_admin_theme_packs__pack_id__image_presets__preset_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"pack_id","in":"path","required":true,"schema":{"type":"string","title":"Pack Id"}},{"name":"preset_id","in":"path","required":true,"schema":{"type":"string","title":"Preset Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Delete Image Preset Api Admin Theme Packs  Pack Id  Image Presets  Preset Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/emergency-contacts":{"get":{"tags":["Emergency Contacts"],"summary":"List Contacts","operationId":"list_contacts_api_emergency_contacts_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmergencyContactListOut"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["Emergency Contacts"],"summary":"Create Contact","description":"Idempotent upsert on `(member_id, phone_e164)`.\n\nRe-adding the same number for the same member updates the row's\nlabel / sms_enabled / notify_levels rather than rejecting with a\nunique-constraint violation. Verification state is preserved on the\nupsert path — a contact who already verified once doesn't have to\nre-verify because the operator typed their name differently.","operationId":"create_contact_api_emergency_contacts_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmergencyContactCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmergencyContactOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/emergency-contacts/{contact_id}":{"patch":{"tags":["Emergency Contacts"],"summary":"Update Contact","operationId":"update_contact_api_emergency_contacts__contact_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"contact_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Contact Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmergencyContactUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmergencyContactOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Emergency Contacts"],"summary":"Delete Contact","operationId":"delete_contact_api_emergency_contacts__contact_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"contact_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Contact Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/emergency-contacts/{contact_id}/verify/start":{"post":{"tags":["Emergency Contacts"],"summary":"Verify Start","operationId":"verify_start_api_emergency_contacts__contact_id__verify_start_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"contact_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Contact Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyStartOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/emergency-contacts/{contact_id}/test":{"post":{"tags":["Emergency Contacts"],"summary":"Send Test","operationId":"send_test_api_emergency_contacts__contact_id__test_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"contact_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Contact Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SmsTestOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/emergency-contacts/reorder":{"post":{"tags":["Emergency Contacts"],"summary":"Reorder Contacts","description":"Atomically rewrite `call_order` to match the array position. 422\nif any id isn't one of the active member's contacts (or the set is\nincomplete/duplicated). Returns the refreshed, re-ordered list.","operationId":"reorder_contacts_api_emergency_contacts_reorder_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReorderContactsIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmergencyContactListOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/emergency-contacts/{contact_id}/voice-test":{"post":{"tags":["Emergency Contacts"],"summary":"Voice Test","description":"Place one standalone test call to a verified, voice-enabled\ncontact. No escalation row, no advancement.","operationId":"voice_test_api_emergency_contacts__contact_id__voice_test_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"contact_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Contact Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceTestOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/sms/inbound":{"post":{"tags":["SMS"],"summary":"Inbound Sms","operationId":"inbound_sms_api_sms_inbound_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/sms/status":{"post":{"tags":["SMS"],"summary":"Sms Status","operationId":"sms_status_api_sms_status_post","responses":{"204":{"description":"Successful Response"}}}},"/api/voice/twiml/{attempt_id}":{"post":{"tags":["Voice"],"summary":"Voice Twiml","operationId":"voice_twiml_api_voice_twiml__attempt_id__post","parameters":[{"name":"attempt_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Attempt Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/voice/gather/{attempt_id}":{"post":{"tags":["Voice"],"summary":"Voice Gather","operationId":"voice_gather_api_voice_gather__attempt_id__post","parameters":[{"name":"attempt_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Attempt Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/voice/robin/{attempt_id}":{"post":{"tags":["Voice"],"summary":"Voice Robin Twiml","description":"Cycle 373 — TwiML for the backup caregiver's offer call.\n\nSame public-but-signature-validated posture as the three cycle-128\nwebhooks: 403 before any DB write on a bad/absent signature. The\nconference room is NEVER taken from the request — it is derived\nserver-side from the escalation this attempt belongs to, so a guessed\nid cannot bridge anyone into another member's call.","operationId":"voice_robin_twiml_api_voice_robin__attempt_id__post","parameters":[{"name":"attempt_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Attempt Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/voice/robin/gather/{attempt_id}":{"post":{"tags":["Voice"],"summary":"Voice Robin Gather","description":"Cycle 373 — the backup caregiver's keypress: 1 bridges, anything\nelse declines. A failed bridge degrades to a polite goodbye; it never\nfails the request, never touches escalation state, and never stops the\ninformational cascade.","operationId":"voice_robin_gather_api_voice_robin_gather__attempt_id__post","parameters":[{"name":"attempt_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Attempt Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/voice/status/{attempt_id}":{"post":{"tags":["Voice"],"summary":"Voice Status","operationId":"voice_status_api_voice_status__attempt_id__post","parameters":[{"name":"attempt_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Attempt Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/voice/checkin/{attempt_id}":{"post":{"tags":["Voice"],"summary":"Voice Checkin Twiml","description":"Cycle 483 — TwiML for the phone check-in call to a custodian who\naccepted by press 1. Signature first (403 before any DB read); the\ncheck-in is authorized from server state only (the attempt's alert must\nhave a phone check-in pending for this attempt's contact).","operationId":"voice_checkin_twiml_api_voice_checkin__attempt_id__post","parameters":[{"name":"attempt_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Attempt Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/voice/checkin/gather/{attempt_id}":{"post":{"tags":["Voice"],"summary":"Voice Checkin Gather","description":"Cycle 483 — the check-in keypress: 1 answers the check-in exactly as\nthe in-app \"yes\" (one idempotent claim); anything else is no answer.","operationId":"voice_checkin_gather_api_voice_checkin_gather__attempt_id__post","parameters":[{"name":"attempt_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Attempt Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/voice/checkin/status/{attempt_id}":{"post":{"tags":["Voice"],"summary":"Voice Checkin Status","description":"Cycle 483 — the check-in call's own status / async-AMD callback,\nkept apart from `/status` so it can never advance the search.","operationId":"voice_checkin_status_api_voice_checkin_status__attempt_id__post","parameters":[{"name":"attempt_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Attempt Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/voice/no_data/status/{call_id}":{"post":{"tags":["Voice"],"summary":"Voice No Data Status","description":"The No Data call's own status and async-AMD callback, apart from\n`/status` so it can never reach a search.","operationId":"voice_no_data_status_api_voice_no_data_status__call_id__post","parameters":[{"name":"call_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Call Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/voice/no_data/mailbox/{call_id}":{"post":{"tags":["Voice"],"summary":"Voice No Data Mailbox","description":"Where the live call is redirected at a mailbox's beep: the message\nonce, from the start, then a hang-up. Authorized from the row's own\nstored verdict, never from this request.","operationId":"voice_no_data_mailbox_api_voice_no_data_mailbox__call_id__post","parameters":[{"name":"call_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Call Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/voice/no_data/{call_id}":{"post":{"tags":["Voice"],"summary":"Voice No Data Twiml","description":"TwiML when the No Data call connects. `AnsweredBy` is in the body\nonly under synchronous machine detection; it is read through the\ncycle-487 classifier and can only shorten the call.","operationId":"voice_no_data_twiml_api_voice_no_data__call_id__post","parameters":[{"name":"call_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Call Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/photo/estimate_carbs":{"post":{"tags":["Photo"],"summary":"Estimate Carbs","operationId":"estimate_carbs_api_photo_estimate_carbs_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_estimate_carbs_api_photo_estimate_carbs_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PhotoEstimateOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/carbs/estimate":{"post":{"tags":["Carbs"],"summary":"Estimate Carbs From Text","operationId":"estimate_carbs_from_text_api_carbs_estimate_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CarbEstimateIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PhotoEstimateOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/backgrounds":{"get":{"tags":["Backgrounds"],"summary":"List Backgrounds","operationId":"list_backgrounds_api_backgrounds_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BackgroundListOut"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["Backgrounds"],"summary":"Upload Background","operationId":"upload_background_api_backgrounds_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_background_api_backgrounds_post"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BackgroundOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/backgrounds/{background_id}/image":{"get":{"tags":["Backgrounds"],"summary":"Get Background Image","operationId":"get_background_image_api_backgrounds__background_id__image_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"background_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Background Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/backgrounds/{background_id}":{"delete":{"tags":["Backgrounds"],"summary":"Delete Background","operationId":"delete_background_api_backgrounds__background_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"background_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Background Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/members/{member_id}/avatar":{"post":{"tags":["Avatars"],"summary":"Upload Avatar","operationId":"upload_avatar_api_members__member_id__avatar_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"member_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Member Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_avatar_api_members__member_id__avatar_post"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AvatarOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Avatars"],"summary":"Delete Avatar","operationId":"delete_avatar_api_members__member_id__avatar_delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"member_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Member Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/avatars/{avatar_id}/image":{"get":{"tags":["Avatars"],"summary":"Get Avatar Image","operationId":"get_avatar_image_api_avatars__avatar_id__image_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"avatar_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Avatar Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/reminders":{"get":{"tags":["Reminders"],"summary":"List Reminders","operationId":"list_reminders_api_reminders_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ReminderOut"},"type":"array","title":"Response List Reminders Api Reminders Get"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["Reminders"],"summary":"Create Reminder","operationId":"create_reminder_api_reminders_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReminderCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReminderOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/reminders/{reminder_id}":{"patch":{"tags":["Reminders"],"summary":"Update Reminder","operationId":"update_reminder_api_reminders__reminder_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"reminder_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Reminder Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReminderUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReminderOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Reminders"],"summary":"Delete Reminder","operationId":"delete_reminder_api_reminders__reminder_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"reminder_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Reminder Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/reminders/{reminder_id}/test":{"post":{"tags":["Reminders"],"summary":"Test Reminder","operationId":"test_reminder_api_reminders__reminder_id__test_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"reminder_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Reminder Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReminderOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/reminders/{reminder_id}/snooze":{"post":{"tags":["Reminders"],"summary":"Snooze Reminder","description":"Cycle 272: snoozing a fired reminder on one device hides + re-shows\nit on ALL of the owner's devices together. Verifies ownership (404 if\nnot the caller's — never leaks existence across users), then broadcasts\n`reminder_snoozed` with an absolute `snooze_until_ms` so every device\nre-shows at the same instant. Does NOT mutate the reminder row (this is\na fired-instance action, not a config change). The broadcast is\nbest-effort — a WS failure must not fail the gesture the client already\nperformed.","operationId":"snooze_reminder_api_reminders__reminder_id__snooze_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"reminder_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Reminder Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ReminderSnoozeRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReminderSnoozeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/reminders/{reminder_id}/dismiss":{"post":{"tags":["Reminders"],"summary":"Dismiss Reminder","description":"Cycle 272: marking a fired reminder Done on one device clears it on\nALL of the owner's devices and cancels any pending snooze. Ownership\nverified (404 otherwise); broadcasts `reminder_dismissed`.\n\nCycle 362: this route addresses a REMINDER, not an occurrence — it is the\nshape pre-362 clients call. It now ALSO resolves that reminder's newest\nun-acknowledged occurrence and stamps it durably, so an older client's\nClose still clears the outstanding record instead of only broadcasting.\nCurrent clients call `/fires/{fire_id}/dismiss` and acknowledge the exact\noccurrence they were shown. Kept, not deprecated: it is the only dismiss\npath available for a `/test` fire, which has no durable row.","operationId":"dismiss_reminder_api_reminders__reminder_id__dismiss_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"reminder_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Reminder Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/reminders/fires/{fire_id}/dismiss":{"post":{"tags":["Reminders"],"summary":"Dismiss Reminder Fire","description":"Cycle 362: acknowledge a specific fired OCCURRENCE.\n\nThis is the durable Close. It stamps `reminder_fires.dismissed_at` (so the\nacknowledgement survives a reload, a reboot, and a device that was offline\nwhen the broadcast went out) and then fans out `reminder_dismissed`.\nIdempotent — a second Close, or a Close racing in from another device,\nkeeps the first acknowledgement.\n\nScoped by `user_id`: a fire id that isn't the caller's returns 404 and\nnever leaks existence across accounts. There is no `user_id` parameter\nanywhere, so this cannot address another account's occurrence by\nconstruction.\n\nNOTE the path is `/fires/{fire_id}/dismiss` (3 segments) so it can never\ncollide with the 2-segment `/{reminder_id}/dismiss` above.","operationId":"dismiss_reminder_fire_api_reminders_fires__fire_id__dismiss_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"fire_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Fire Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/kiosk/heartbeat":{"post":{"tags":["Kiosk"],"summary":"Kiosk Heartbeat","description":"Upsert the calling device's heartbeat row. Best-effort + frequent;\na malformed/partial body still records what it can.\n\nCycle 432: the AUTHENTICATED heartbeat is also where the admin-only\n`kiosk_identity` row learns the screen's address and user agent —\nserver-derived from this request, never from the body, and never\nwritten to `devices.last_ip` / `devices.user_agent` (those reach the\nhousehold through `DeviceOut`).","operationId":"kiosk_heartbeat_api_kiosk_heartbeat_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KioskHeartbeatIn"}}},"required":true},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/dev/inject-reading":{"post":{"tags":["Dev (gated)"],"summary":"Inject Reading","description":"Drive one synthetic reading through the real alerts engine.\n\nPersists a real `GlucoseReading` row (so the chart sees it), runs\n`alerts_service.evaluate_reading(..., synthetic=True)` (so the\nreal state machine fires alerts / heartbeat / engine re-arm with\nreal WS frames on the real cycle-60 audience), and broadcasts a\n`glucose` frame so every connected client updates its hero.\n\nPush fan-out is suppressed under `synthetic=True`. No real phone\nreceives a notification from this endpoint.","operationId":"inject_reading_api_dev_inject_reading_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InjectReadingBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InjectReadingOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/dev/test-alerts":{"delete":{"tags":["Dev (gated)"],"summary":"Cleanup Synthetic","description":"Delete every synthetic Alert + GlucoseReading row this process\nhas minted for the given member. Idempotent. Out-of-process or\npre-restart synthetic rows are NOT cleaned (no schema tag — known\nlimitation, documented in CHANGELOG).","operationId":"cleanup_synthetic_api_dev_test_alerts_delete","parameters":[{"name":"member_id","in":"query","required":true,"schema":{"type":"string","format":"uuid","title":"Member Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DevCleanupOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/me":{"get":{"tags":["Admin"],"summary":"Admin Me","description":"Gate probe. Reachable only by admins (else 404 via require_admin).","operationId":"admin_me_api_admin_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Admin Me Api Admin Me Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/admin/health":{"get":{"tags":["Admin"],"summary":"Admin Health","description":"Aggregated platform-health payload. Best-effort + non-blocking.","operationId":"admin_health_api_admin_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Admin Health Api Admin Health Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/admin/accounts":{"get":{"tags":["Admin"],"summary":"Admin Accounts","operationId":"admin_accounts_api_admin_accounts_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"query","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Query"}},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Accounts Api Admin Accounts Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Admin"],"summary":"Admin Create Account","description":"Create an account and return a one-time reset link (the new user\nsets their own password). The admin never sees/sets a password — a\nthrowaway random one is stored so the row is valid until reset.","operationId":"admin_create_account_api_admin_accounts_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAccountRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Create Account Api Admin Accounts Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/accounts/{user_id}":{"get":{"tags":["Admin"],"summary":"Admin Account Detail","operationId":"admin_account_detail_api_admin_accounts__user_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Account Detail Api Admin Accounts  User Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Admin"],"summary":"Admin Delete Account","description":"Permanently delete an account (cascades to members + all their\ndata). Guarded: an admin can't delete themselves or the last admin.","operationId":"admin_delete_account_api_admin_accounts__user_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Delete Account Api Admin Accounts  User Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/lookup":{"get":{"tags":["Admin"],"summary":"Admin Lookup Id","operationId":"admin_lookup_id_api_admin_lookup_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"id","in":"query","required":false,"schema":{"type":"string","maxLength":320,"default":"","title":"Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Lookup Id Api Admin Lookup Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/members":{"get":{"tags":["Admin"],"summary":"Admin Members","operationId":"admin_members_api_admin_members_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"query","in":"query","required":false,"schema":{"type":"string","maxLength":320,"default":"","title":"Query"}},{"name":"filter","in":"query","required":false,"schema":{"type":"string","default":"all","title":"Filter"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Members Api Admin Members Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/members/{member_id}":{"get":{"tags":["Admin"],"summary":"Admin Member Detail","operationId":"admin_member_detail_api_admin_members__member_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"member_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Member Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Member Detail Api Admin Members  Member Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/devices":{"get":{"tags":["Admin"],"summary":"Admin Devices","operationId":"admin_devices_api_admin_devices_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"query","in":"query","required":false,"schema":{"type":"string","maxLength":320,"default":"","title":"Query"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Devices Api Admin Devices Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/watchlist/stale":{"get":{"tags":["Admin"],"summary":"Admin Watchlist Stale","operationId":"admin_watchlist_stale_api_admin_watchlist_stale_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"minutes","in":"query","required":false,"schema":{"type":"integer","maximum":10080,"minimum":1,"default":25,"title":"Minutes"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Watchlist Stale Api Admin Watchlist Stale Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/watchlist/cgm_auth_failed":{"get":{"tags":["Admin"],"summary":"Admin Watchlist Cgm Auth Failed","operationId":"admin_watchlist_cgm_auth_failed_api_admin_watchlist_cgm_auth_failed_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Admin Watchlist Cgm Auth Failed Api Admin Watchlist Cgm Auth Failed Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/admin/members/{member_id}/resync":{"post":{"tags":["Admin"],"summary":"Admin Resync Member","description":"Force an immediate sync for THIS member (bypassing the per-member\ncooldown) via the same `sync_engine.sync_member_now` primitive that\n`POST /api/glucose/sync` uses. A definitive CGMAuthError is reported\nin the summary and stamps the sticky flag; the action still returns\n200 with ok:false. A clean poll clears any stale flag.","operationId":"admin_resync_member_api_admin_members__member_id__resync_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"member_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Member Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Resync Member Api Admin Members  Member Id  Resync Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/members/{member_id}/test_sensor_blackout":{"post":{"tags":["Admin"],"summary":"Admin Test Sensor Blackout","description":"Cycle 360: fire ONE no-data CRITICAL alarm push to THIS member's\naudience on demand, so the operator can verify the loud DND-bypassing\n'Sensor data lost' alarm on their own devices WITHOUT waiting for a real\n15-minute dark feed. Clearly-labelled TEST copy, carries no glucose value,\nand does NOT touch the sensor-blackout episode state / cadence (a one-shot,\nnot a sweep). The critical posture follows the live\n`SUGALARM_SENSOR_BLACKOUT_CRITICAL` kill-switch. Audited.","operationId":"admin_test_sensor_blackout_api_admin_members__member_id__test_sensor_blackout_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"member_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Member Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Test Sensor Blackout Api Admin Members  Member Id  Test Sensor Blackout Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/members/{member_id}/test_no_data_call":{"post":{"tags":["Admin"],"summary":"Admin Test No Data Call","description":"Cycle 513 (from parked 501): place ONE No Data call to THIS member's\nfirst callable hero, with the production script, so the operator can\nhear it without waiting for a real dark feed. It speaks the member's\ncurrent minutes dark (or the blackout threshold if the feed is fresh).\n\nThe number dialled is ALWAYS the stored hero's: the request carries a\nmember id and nothing else (no body is read). It writes one `is_test`\nrow in `no_data_hero_calls` (the Twilio webhooks' key), uses no\ncooldown, counts toward no cap and touches no outage or blackout state;\nit does not read the kill switch. The paid-services pause stops it like\nthe real call, an open low makes it wait (`glucose_alarm_open`), a demo\nor drill member is refused, and it is limited to one per member per 5\nminutes (429). Audited: ids and the outcome word only, never a number\nor a name.","operationId":"admin_test_no_data_call_api_admin_members__member_id__test_no_data_call_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"member_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Member Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Test No Data Call Api Admin Members  Member Id  Test No Data Call Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/members/{member_id}/clear_cgm_auth_failed":{"post":{"tags":["Admin"],"summary":"Admin Clear Cgm Auth Failed","description":"Clear the sticky CGM-auth-failed flag via the existing\nedge-triggered helper (nulls `cgm_auth_failed_at` only if set and\nbroadcasts `cgm_auth` once). No-op-safe. NOTE: clearing the flag does\nNOT fix bad credentials — it only dismisses the modal until the next\nfailed poll. Pair with a resync to confirm the connection.","operationId":"admin_clear_cgm_auth_failed_api_admin_members__member_id__clear_cgm_auth_failed_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"member_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Member Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Clear Cgm Auth Failed Api Admin Members  Member Id  Clear Cgm Auth Failed Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/devices/{device_id}/revoke_token":{"post":{"tags":["Admin"],"summary":"Admin Revoke Device Token","description":"Revoke a device's token across ANY account, reusing the\n`pairing_service.revoke_device_token` primitive (the same one behind\nthe JWT-only `POST /api/devices/{id}/revoke_token`). Idempotent: a\nno-op when the device has no active token.","operationId":"admin_revoke_device_token_api_admin_devices__device_id__revoke_token_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"device_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Device Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Revoke Device Token Api Admin Devices  Device Id  Revoke Token Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/devices/{device_id}":{"delete":{"tags":["Admin"],"summary":"Admin Delete Device","description":"Cycle 471 — REMOVE a device row of ANY account (operator decision 4,\n2026-10-28: an admin action per account, never an automatic purge).\n\n404 on a miss (never 403 — the admin surface is indistinguishable from\n\"route doesn't exist\" to anyone who is not an admin, and a probe must\nnot learn whether an id is real). What goes: the row's push-token rows\nfirst (`device_service.release_device_push_tokens` by `device_id`, the\nadmin being a deliberate actor; a released kiosk FCM row stops the\ntablet waking for this account's lows), then the `devices` row, whose\nFKs cascade `kiosk_heartbeats`, `kiosk_identity`,\n`device_token_fingerprints` and `pairing_codes`; a `device_push_tokens`\nrow that was NOT linked by `device_id` is left with its FK set NULL\n(the ON DELETE SET NULL the model declares). `kiosk_auth_refusals` and\n`kiosk_state_transitions` carry no FK ON PURPOSE and are KEPT: \"a\ndevice's deletion must not erase the record of what its screen did\"\n(`server/models/kiosk_state.py`); orphaned, they are inert — the sweep\nand every derivation read only kiosks that still exist.\n\nA LIVE row removed here darkens that kiosk until it is paired again\non-site (the confirm copy says so) — and since the safety review it can\nonly be a kiosk nobody has presented for more than 24 h: a kiosk seen\nwithin the last day is refused (409 `kiosk_seen_within_24h`, below),\nwhatever its token state, so Revoke and the sweep are the only way to\nend a screen the household could still be told about. Revoke and\nRemove are separate actions. No bulk route: the console loops this one\nso each removal writes its own audit row — `admin.device.delete` with\nids, the type and counts, never an email or a name (cycle 419).","operationId":"admin_delete_device_api_admin_devices__device_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"device_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Device Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Delete Device Api Admin Devices  Device Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/members/{member_id}/archive":{"post":{"tags":["Admin"],"summary":"Admin Archive Member","description":"Soft-delete (reuses `member_service.archive`, passing the member's\nreal owner). Refuses the self-member with a 409 and writes NO audit\nrow.","operationId":"admin_archive_member_api_admin_members__member_id__archive_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"member_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Member Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Archive Member Api Admin Members  Member Id  Archive Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/members/{member_id}/restore":{"post":{"tags":["Admin"],"summary":"Admin Restore Member","description":"Undo an archive (nulls `archived_at`).","operationId":"admin_restore_member_api_admin_members__member_id__restore_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"member_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Member Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Restore Member Api Admin Members  Member Id  Restore Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/accounts/{user_id}/password_reset_link":{"post":{"tags":["Admin"],"summary":"Admin Issue Password Reset Link","operationId":"admin_issue_password_reset_link_api_admin_accounts__user_id__password_reset_link_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Issue Password Reset Link Api Admin Accounts  User Id  Password Reset Link Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/notifications/recent":{"get":{"tags":["Admin"],"summary":"Admin Notifications Recent","operationId":"admin_notifications_recent_api_admin_notifications_recent_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Notifications Recent Api Admin Notifications Recent Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/alerts/{alert_id}/events":{"get":{"tags":["Admin"],"summary":"Admin Alert Events","description":"Cycle 431 — the episode timeline `scripts/episode_report.py` prints,\nas JSON. Behind `require_admin` (404, never 403, for a non-admin) and\n404 for an unknown alert, byte-identically. Scoped by the alert id from\nthe PATH only — no member id from the client. The projection is id-only\nand redacted by construction (`episode_report_service`): the admin audit\nrows carry no `detail`, deliveries carry no provider detail, nothing\ncarries a name, an email, a number or a token.","operationId":"admin_alert_events_api_admin_alerts__alert_id__events_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"alert_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Alert Id"}},{"name":"log_lines_limit","in":"query","required":false,"schema":{"type":"integer","maximum":4000,"minimum":0,"default":2000,"title":"Log Lines Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Alert Events Api Admin Alerts  Alert Id  Events Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/members/{member_id}/notifications":{"get":{"tags":["Admin"],"summary":"Admin Member Notifications","operationId":"admin_member_notifications_api_admin_members__member_id__notifications_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"member_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Member Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Member Notifications Api Admin Members  Member Id  Notifications Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/notifications/rates":{"get":{"tags":["Admin"],"summary":"Admin Notifications Rates","operationId":"admin_notifications_rates_api_admin_notifications_rates_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"window_hours","in":"query","required":false,"schema":{"type":"integer","maximum":720,"minimum":1,"default":24,"title":"Window Hours"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Notifications Rates Api Admin Notifications Rates Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/activation":{"get":{"tags":["Admin"],"summary":"Admin Activation","description":"Cycle 365: who can't actually be reached, worst first.\n\nAnswers the question no existing surface could: an account whose\ninstall is signed in and painting a glance tile while having no push\ntoken at all. `severity: \"unknown\"` means an install has never checked\nin — deliberately not reported as fine, because \"no news is good news\"\nis exactly how this class of gap stayed hidden.\n\nRead-only, so no audit row (matching the other admin read endpoints).\nEmails are the admin console's existing exposure level; no token\nmaterial or client id is returned.","operationId":"admin_activation_api_admin_activation_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Admin Activation Api Admin Activation Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/admin/notifications/push_rot":{"get":{"tags":["Admin"],"summary":"Admin Push Rot","operationId":"admin_push_rot_api_admin_notifications_push_rot_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Admin Push Rot Api Admin Notifications Push Rot Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/admin/overview":{"get":{"tags":["Admin"],"summary":"Admin Overview","description":"Aggregated tactical-overview payload for the /admin landing.\nBest-effort + non-blocking: any sub-section that fails computes as null\nwith the rest of the payload intact. Read-only; 404 to non-admins.","operationId":"admin_overview_api_admin_overview_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Admin Overview Api Admin Overview Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/admin/notifications/sms_status":{"get":{"tags":["Admin"],"summary":"Admin Sms Status","operationId":"admin_sms_status_api_admin_notifications_sms_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Admin Sms Status Api Admin Notifications Sms Status Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/admin/costs/twilio":{"get":{"tags":["Admin"],"summary":"Admin Twilio Costs","operationId":"admin_twilio_costs_api_admin_costs_twilio_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Days"}},{"name":"include_inactive","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Inactive"}},{"name":"force_refresh","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Force Refresh"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Twilio Costs Api Admin Costs Twilio Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/ai/query":{"post":{"tags":["Admin"],"summary":"Admin Ai Query","operationId":"admin_ai_query_api_admin_ai_query_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiQueryIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Admin Ai Query Api Admin Ai Query Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/admin/costs/ai":{"get":{"tags":["Admin"],"summary":"Admin Ai Costs","description":"Cycle 336: now backed by the persisted `ai_assistant_usage` ledger\n(survives redeploys) via `ai_usage_service.get_usage_overview`. The\nresponse is a BACKWARD-COMPATIBLE SUPERSET of the old shape — every\nfield `admin_ai_service.usage_metrics()` used to return here is still\npresent, unchanged, so the existing \"AI assistant · since last deploy\"\ncard on `MessagingCostsPage` keeps working with no changes.","operationId":"admin_ai_costs_api_admin_costs_ai_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"force_refresh","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Force Refresh"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Ai Costs Api Admin Costs Ai Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/costs/ai/timeseries":{"get":{"tags":["Admin"],"summary":"Admin Ai Costs Timeseries","operationId":"admin_ai_costs_timeseries_api_admin_costs_ai_timeseries_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":14,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Ai Costs Timeseries Api Admin Costs Ai Timeseries Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/costs/ai/recent":{"get":{"tags":["Admin"],"summary":"Admin Ai Costs Recent","operationId":"admin_ai_costs_recent_api_admin_costs_ai_recent_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":20,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Ai Costs Recent Api Admin Costs Ai Recent Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/agents":{"get":{"tags":["Admin"],"summary":"Admin Dev Agents List","operationId":"admin_dev_agents_list_api_admin_agents_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Admin Dev Agents List Api Admin Agents Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/admin/agents/history":{"get":{"tags":["Admin"],"summary":"Admin Dev Agents History","operationId":"admin_dev_agents_history_api_admin_agents_history_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"agent_key","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Dev Agents History Api Admin Agents History Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/agents/overview":{"get":{"tags":["Admin"],"summary":"Admin Dev Agents Overview","operationId":"admin_dev_agents_overview_api_admin_agents_overview_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Admin Dev Agents Overview Api Admin Agents Overview Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/admin/agents/{agent_key}":{"get":{"tags":["Admin"],"summary":"Admin Dev Agent Detail","operationId":"admin_dev_agent_detail_api_admin_agents__agent_key__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_key","in":"path","required":true,"schema":{"type":"string","title":"Agent Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Dev Agent Detail Api Admin Agents  Agent Key  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/broadcast":{"post":{"tags":["Admin"],"summary":"Admin Broadcast","operationId":"admin_broadcast_api_admin_broadcast_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BroadcastRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Admin Broadcast Api Admin Broadcast Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/admin/broadcast/{broadcast_id}":{"delete":{"tags":["Admin"],"summary":"Admin Clear Broadcast","operationId":"admin_clear_broadcast_api_admin_broadcast__broadcast_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"broadcast_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Broadcast Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Clear Broadcast Api Admin Broadcast  Broadcast Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/broadcast/active":{"get":{"tags":["Admin"],"summary":"Admin Broadcast Active","description":"Current in-memory broadcast (for the composer to show what's live).","operationId":"admin_broadcast_active_api_admin_broadcast_active_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Admin Broadcast Active Api Admin Broadcast Active Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/admin/accounts/{user_id}/view_as":{"get":{"tags":["Admin"],"summary":"Admin View As","description":"Read-only snapshot of what `user_id` would see. Issues NO user JWT,\nexposes no credentials, has no write companion. Audited every call.","operationId":"admin_view_as_api_admin_accounts__user_id__view_as_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin View As Api Admin Accounts  User Id  View As Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/audit":{"get":{"tags":["Admin"],"summary":"Admin Audit Log","operationId":"admin_audit_log_api_admin_audit_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"actor","in":"query","required":false,"schema":{"type":"string","maxLength":320,"default":"","title":"Actor"}},{"name":"action","in":"query","required":false,"schema":{"type":"string","maxLength":120,"default":"","title":"Action"}},{"name":"target_type","in":"query","required":false,"schema":{"type":"string","maxLength":60,"default":"","title":"Target Type"}},{"name":"from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"From"}},{"name":"to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"To"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Audit Log Api Admin Audit Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/allowed-signups":{"get":{"tags":["Admin"],"summary":"Admin List Allowed Signups","description":"List approved signup emails + whether invite-only is enforced.","operationId":"admin_list_allowed_signups_api_admin_allowed_signups_get","security":[{"HTTPBearer":[]}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin List Allowed Signups Api Admin Allowed Signups Get"}}}}}},"post":{"tags":["Admin"],"summary":"Admin Add Allowed Signups","description":"Approve one or more emails for signup (idempotent). Audited.","operationId":"admin_add_allowed_signups_api_admin_allowed_signups_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AllowedSignupAddRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Add Allowed Signups Api Admin Allowed Signups Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Admin"],"summary":"Admin Remove Allowed Signup","description":"Revoke an email's signup approval. Audited. (Does not delete any\naccount that already exists — only stops a NEW signup with this email.)","operationId":"admin_remove_allowed_signup_api_admin_allowed_signups_delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"email","in":"query","required":true,"schema":{"type":"string","title":"Email"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Remove Allowed Signup Api Admin Allowed Signups Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/accounts/{user_id}/set_admin":{"post":{"tags":["Admin"],"summary":"Admin Set Admin","operationId":"admin_set_admin_api_admin_accounts__user_id__set_admin_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetAdminRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Set Admin Api Admin Accounts  User Id  Set Admin Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/members/{member_id}/export/glucose.csv":{"get":{"tags":["Admin"],"summary":"Admin Export Member Glucose Csv","description":"Stream a member's glucose readings as CSV (any account). Columns\nand row source are identical to the user-side /api/export/glucose.csv.","operationId":"admin_export_member_glucose_csv_api_admin_members__member_id__export_glucose_csv_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"member_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Member Id"}},{"name":"hours","in":"query","required":false,"schema":{"type":"integer","maximum":2160,"minimum":1,"default":720,"title":"Hours"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/members/{member_id}/export/full.csv":{"get":{"tags":["Admin"],"summary":"Admin Export Member Full Csv","description":"Stream a member's combined glucose + treatments history as CSV\n(any account). Mirrors the user-side /api/export/full.csv.","operationId":"admin_export_member_full_csv_api_admin_members__member_id__export_full_csv_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"member_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Member Id"}},{"name":"hours","in":"query","required":false,"schema":{"type":"integer","maximum":2160,"minimum":1,"default":720,"title":"Hours"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/kiosk/ota/trigger":{"post":{"tags":["Admin"],"summary":"Admin Trigger Kiosk Ota","description":"Nudge kiosk devices to run an immediate OTA update check.\n\nSends a DATA-only FCM `{\"type\": \"ota_check\"}` message to kiosk Android\ndevices (all, or a supplied `device_ids` subset). The message carries\nno APK and bypasses NONE of the native install gates (signature pin +\nSHA-256 + forward-only) — it is a nudge only. Admin-authed; 404 (not\n403) to non-admins via `require_admin`; audited.","operationId":"admin_trigger_kiosk_ota_api_admin_kiosk_ota_trigger_post","requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/KioskOtaTriggerIn"},{"type":"null"}],"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KioskOtaTriggerOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/admin/kiosk/devices":{"get":{"tags":["Admin"],"summary":"Admin List Kiosk Devices","description":"List kiosk devices with their reported native version + last OTA\nresult + last_seen — the \"did the push land, what version is each unit\non\" view. Admin-authed; 404 to non-admins.","operationId":"admin_list_kiosk_devices_api_admin_kiosk_devices_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KioskDeviceListOut"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/admin/iap/subscriptions":{"get":{"tags":["Admin"],"summary":"Admin Iap Subscriptions","operationId":"admin_iap_subscriptions_api_admin_iap_subscriptions_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Iap Subscriptions Api Admin Iap Subscriptions Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/preorders":{"get":{"tags":["Admin"],"summary":"Admin List Preorders","description":"List preorders newest-first, with the recorded consent on each row.\n\n`missing_consent` counts orders with no `terms_version` — pre-cycle-397\nrows, and the number an operator should expect to stay FROZEN. If it\nstarts climbing after the gate ships, the gate is not being enforced\nand that is a defect worth chasing, so it is surfaced as a first-class\nnumber rather than something to derive by eye.","operationId":"admin_list_preorders_api_admin_preorders_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreorderListOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/kiosks/fleet":{"get":{"tags":["Admin"],"summary":"Admin Kiosk Fleet","description":"One row per kiosk across every account, with the derived state.\n`state` filters (`monitoring` / `unpaired` / `silent` / `never_paired`);\n`sort` is `last_seen` (stalest first, never-seen first) or `label`.","operationId":"admin_kiosk_fleet_api_admin_kiosks_fleet_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"state","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":16},{"type":"null"}],"title":"State"}},{"name":"sort","in":"query","required":false,"schema":{"type":"string","maxLength":16,"default":"last_seen","title":"Sort"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Kiosk Fleet Api Admin Kiosks Fleet Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/kiosks/{device_id}":{"get":{"tags":["Admin"],"summary":"Admin Kiosk Detail","description":"The row plus its recent state transitions, its refused-attempt\nhistory grouped by fingerprint (addresses masked, fingerprints never\nreturned — a per-token index only), and its pairing history.","operationId":"admin_kiosk_detail_api_admin_kiosks__device_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"device_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Device 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":{"type":"object","additionalProperties":true,"title":"Response Admin Kiosk Detail Api Admin Kiosks  Device Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/kiosks/{device_id}/label":{"patch":{"tags":["Admin"],"summary":"Admin Kiosk Label","description":"Relabel a kiosk from admin (audited). Display-only: `devices.name`\nis consulted by no auth, routing or rail (the cycle-377 rule).","operationId":"admin_kiosk_label_api_admin_kiosks__device_id__label_patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"device_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Device Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KioskLabelIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Kiosk Label Api Admin Kiosks  Device Id  Label Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/subscriptions":{"get":{"tags":["Admin"],"summary":"Admin Subscriptions","description":"Accounts with their derived subscription state. State is derived per\naccount, so filtering happens after derivation (the account count is in\nthe tens; see `billing.states_for_users`). Cycle 481: `care_only=true`\nlists only the accounts whose subscription carries Care and no service\nline (operator decision 2026-11-10: Care-only = no service), and every\nitem says whether it is one.","operationId":"admin_subscriptions_api_admin_subscriptions_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"state","in":"query","required":false,"schema":{"enum":["","none","trial","active","comped","grace","locked"],"type":"string","default":"","title":"State"}},{"name":"source","in":"query","required":false,"schema":{"enum":["","apple","google","stripe","comp"],"type":"string","default":"","title":"Source"}},{"name":"query","in":"query","required":false,"schema":{"type":"string","maxLength":320,"default":"","title":"Query"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"care_only","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Care Only"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Subscriptions Api Admin Subscriptions Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/subscriptions/{user_id}":{"get":{"tags":["Admin"],"summary":"Admin Subscription Detail","operationId":"admin_subscription_detail_api_admin_subscriptions__user_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Subscription Detail Api Admin Subscriptions  User Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/subscriptions/{user_id}/comp":{"post":{"tags":["Admin"],"summary":"Admin Grant Comp","operationId":"admin_grant_comp_api_admin_subscriptions__user_id__comp_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantCompIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Grant Comp Api Admin Subscriptions  User Id  Comp Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/subscriptions/{user_id}/comp/revoke":{"post":{"tags":["Admin"],"summary":"Admin Revoke Comp","operationId":"admin_revoke_comp_api_admin_subscriptions__user_id__comp_revoke_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingNoteIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Revoke Comp Api Admin Subscriptions  User Id  Comp Revoke Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/subscriptions/{user_id}/grace":{"post":{"tags":["Admin"],"summary":"Admin Extend Grace","operationId":"admin_extend_grace_api_admin_subscriptions__user_id__grace_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtendGraceIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Extend Grace Api Admin Subscriptions  User Id  Grace Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/subscriptions/{user_id}/device":{"put":{"tags":["Admin"],"summary":"Admin Set Device Protection","description":"Cycle 477 (operator decision 5; SP2 = B): the ONE writer of\n`device_protected_at`. An account with a device is never fully locked\n(the next sweep lifts a lock that already landed); clearing it makes a\npast-day-30 account lockable again on the next sweep (never mid-alarm).\nStamped once: setting an already-protected account keeps its original\nstamp and only changes the note. `AdminUser` refuses kiosk device tokens\n(the 471 JWT-only admin surface). Audited with old and new values and\nthe source; the note's LENGTH only (it may name a person).","operationId":"admin_set_device_protection_api_admin_subscriptions__user_id__device_put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceProtectionIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Set Device Protection Api Admin Subscriptions  User Id  Device Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/billing/settings":{"get":{"tags":["Admin"],"summary":"Admin Billing Settings","operationId":"admin_billing_settings_api_admin_billing_settings_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Admin Billing Settings Api Admin Billing Settings Get"}}}}},"security":[{"HTTPBearer":[]}]},"put":{"tags":["Admin"],"summary":"Admin Put Billing Settings","operationId":"admin_put_billing_settings_api_admin_billing_settings_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingSettingsIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Admin Put Billing Settings Api Admin Billing Settings Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/admin/drills/active":{"get":{"tags":["Admin"],"summary":"Drill Active","operationId":"drill_active_api_admin_drills_active_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Drill Active Api Admin Drills Active Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/admin/drills":{"get":{"tags":["Admin"],"summary":"Drill Recent","operationId":"drill_recent_api_admin_drills_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Drill Recent Api Admin Drills Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Admin"],"summary":"Drill Start","operationId":"drill_start_api_admin_drills_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartDrillIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Drill Start Api Admin Drills Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/drills/{run_id}/abort":{"post":{"tags":["Admin"],"summary":"Drill Abort","operationId":"drill_abort_api_admin_drills__run_id__abort_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Drill Abort Api Admin Drills  Run Id  Abort Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/demo/tradeshow/status":{"get":{"tags":["Trade-show demo"],"summary":"Get Status","operationId":"get_status_api_demo_tradeshow_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/demo/tradeshow/trigger":{"post":{"tags":["Trade-show demo"],"summary":"Post Trigger","operationId":"post_trigger_api_demo_tradeshow_trigger_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TriggerIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/demo/tradeshow/stop":{"post":{"tags":["Trade-show demo"],"summary":"Post Stop","description":"Cycle 484.3, the Demo Kill switch (operator decisions 2026-11-13). No\nbody. A double tap within `KILL_MIN_INTERVAL_SECONDS` is a 429 (the\nfirst tap already did the work); the trigger limiter is untouched.","operationId":"post_stop_api_demo_tradeshow_stop_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/demo/tradeshow/heroes":{"post":{"tags":["Trade-show demo"],"summary":"Post Hero","operationId":"post_hero_api_demo_tradeshow_heroes_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrollIn"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/demo/tradeshow/heroes/clear":{"post":{"tags":["Trade-show demo"],"summary":"Post Clear","operationId":"post_clear_api_demo_tradeshow_heroes_clear_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/demo/tradeshow/heroes/{hero_id}":{"delete":{"tags":["Trade-show demo"],"summary":"Delete Hero","operationId":"delete_hero_api_demo_tradeshow_heroes__hero_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"hero_id","in":"path","required":true,"schema":{"type":"string","title":"Hero Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/accounts/{user_id}/activity":{"get":{"tags":["Admin"],"summary":"Admin Account Activity","operationId":"admin_account_activity_api_admin_accounts__user_id__activity_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":{"type":"object","additionalProperties":true,"title":"Response Admin Account Activity Api Admin Accounts  User Id  Activity Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/members/{member_id}/glucose-stats":{"get":{"tags":["Admin"],"summary":"Admin Member Glucose Stats","operationId":"admin_member_glucose_stats_api_admin_members__member_id__glucose_stats_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"member_id","in":"path","required":true,"schema":{"type":"string","title":"Member Id"}},{"name":"window_hours","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Window Hours"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Member Glucose Stats Api Admin Members  Member Id  Glucose Stats Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/members/{member_id}/heroes":{"get":{"tags":["Admin"],"summary":"Admin Member Heroes","operationId":"admin_member_heroes_api_admin_members__member_id__heroes_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"member_id","in":"path","required":true,"schema":{"type":"string","title":"Member Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Member Heroes Api Admin Members  Member Id  Heroes Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/members/{member_id}/outbound":{"get":{"tags":["Admin"],"summary":"Admin Member Outbound","operationId":"admin_member_outbound_api_admin_members__member_id__outbound_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"member_id","in":"path","required":true,"schema":{"type":"string","title":"Member Id"}},{"name":"from","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From"}},{"name":"to","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"To"}},{"name":"kind","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kind"}},{"name":"contact_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Id"}},{"name":"alert_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Alert Id"}},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Member Outbound Api Admin Members  Member Id  Outbound Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/members/{member_id}/episodes":{"get":{"tags":["Admin"],"summary":"Admin Member Episodes","operationId":"admin_member_episodes_api_admin_members__member_id__episodes_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"member_id","in":"path","required":true,"schema":{"type":"string","title":"Member Id"}},{"name":"from","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From"}},{"name":"to","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"To"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Member Episodes Api Admin Members  Member Id  Episodes Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/members/{member_id}/diagnostics":{"post":{"tags":["Admin"],"summary":"Admin Member Diagnostics","operationId":"admin_member_diagnostics_api_admin_members__member_id__diagnostics_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"member_id","in":"path","required":true,"schema":{"type":"string","title":"Member Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Member Diagnostics Api Admin Members  Member Id  Diagnostics Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/command/roster":{"get":{"tags":["Admin"],"summary":"Command Roster","operationId":"command_roster_api_admin_command_roster_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Command Roster Api Admin Command Roster Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/admin/command/members/{member_id}/readings":{"get":{"tags":["Admin"],"summary":"Command Member Readings","operationId":"command_member_readings_api_admin_command_members__member_id__readings_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"member_id","in":"path","required":true,"schema":{"type":"string","title":"Member Id"}},{"name":"window_hours","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Window Hours"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Command Member Readings Api Admin Command Members  Member Id  Readings Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/pricing":{"get":{"tags":["Admin"],"summary":"Admin Pricing","operationId":"admin_pricing_api_admin_pricing_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Admin Pricing Api Admin Pricing Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/admin/pricing/web-subscription":{"post":{"tags":["Admin"],"summary":"Admin Change Web Price","operationId":"admin_change_web_price_api_admin_pricing_web_subscription_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Admin Change Web Price Api Admin Pricing Web Subscription Post"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/admin/switches/drills":{"get":{"tags":["Admin"],"summary":"Admin Drill Switch","operationId":"admin_drill_switch_api_admin_switches_drills_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Admin Drill Switch Api Admin Switches Drills Get"}}}}},"security":[{"HTTPBearer":[]}]},"put":{"tags":["Admin"],"summary":"Admin Set Drill Switch","operationId":"admin_set_drill_switch_api_admin_switches_drills_put","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Admin Set Drill Switch Api Admin Switches Drills Put"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/admin/command/accounts/group":{"put":{"tags":["Admin"],"summary":"Set Account Group","description":"Label accounts `customer` / `tester` / `show_demo`. A console label\nonly: it changes how the console lists and counts an account, and\nnothing else about it.","operationId":"set_account_group_api_admin_command_accounts_group_put","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Set Account Group Api Admin Command Accounts Group Put"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/admin/command/accounts/{user_id}/delivery":{"get":{"tags":["Admin"],"summary":"Account Delivery","description":"Why calls and texts for one account did not get through, in the last\n30 days, grouped by member, hero and reason. Reads only.","operationId":"account_delivery_api_admin_command_accounts__user_id__delivery_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":{"type":"object","additionalProperties":true,"title":"Response Account Delivery Api Admin Command Accounts  User Id  Delivery Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/command/members/{member_id}":{"patch":{"tags":["Admin"],"summary":"Rename Member","description":"Rename a member for the household. The household's own screens follow\nthrough the same `member_update` frame their own rename sends.","operationId":"rename_member_api_admin_command_members__member_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"member_id","in":"path","required":true,"schema":{"type":"string","title":"Member Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Rename Member Api Admin Command Members  Member Id  Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/command/devices/{device_id}":{"patch":{"tags":["Admin"],"summary":"Rename Device","description":"Rename any device. Display only: `devices.name` is read by no auth,\nrouting or rail.","operationId":"rename_device_api_admin_command_devices__device_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"device_id","in":"path","required":true,"schema":{"type":"string","title":"Device Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Rename Device Api Admin Command Devices  Device Id  Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/command/members/{member_id}/cgm/disconnect":{"post":{"tags":["Admin"],"summary":"Disconnect Failed Cgm","description":"Remove a member's saved CGM sign-in, ONLY when that sign-in has\nalready been rejected by the provider.\n\nClearing the failure flag alone does not last: the next poll with the\nsame rejected credentials raises it again. Removing the dead sign-in is\nwhat takes the member out of the failing count for good. It is refused\n(409 `cgm_not_failing`) for a feed that is being read, so this action can\nnever stop a working monitor. The household reconnects from the app.","operationId":"disconnect_failed_cgm_api_admin_command_members__member_id__cgm_disconnect_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"member_id","in":"path","required":true,"schema":{"type":"string","title":"Member Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Disconnect Failed Cgm Api Admin Command Members  Member Id  Cgm Disconnect Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/command/costs":{"get":{"tags":["Admin"],"summary":"Costs","description":"What the platform costs to run in one month: the bills an admin\nentered, the AI carb estimates' metered cost and the voice provider's\nown figures. Twilio and the console assistant keep their own routes\n(`/api/admin/costs/twilio`, `/api/admin/costs/ai`); the page adds them.","operationId":"costs_api_admin_command_costs_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Costs Api Admin Command Costs Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/admin/command/costs/entries":{"post":{"tags":["Admin"],"summary":"Add Cost Entry","operationId":"add_cost_entry_api_admin_command_costs_entries_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Add Cost Entry Api Admin Command Costs Entries Post"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/admin/command/costs/entries/{entry_id}/end":{"post":{"tags":["Admin"],"summary":"End Cost Entry","description":"Stop a recurring bill: `month` is the LAST month it counts in.","operationId":"end_cost_entry_api_admin_command_costs_entries__entry_id__end_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"entry_id","in":"path","required":true,"schema":{"type":"string","title":"Entry Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response End Cost Entry Api Admin Command Costs Entries  Entry Id  End Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/command/costs/entries/{entry_id}":{"delete":{"tags":["Admin"],"summary":"Delete Cost Entry","operationId":"delete_cost_entry_api_admin_command_costs_entries__entry_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"entry_id","in":"path","required":true,"schema":{"type":"string","title":"Entry Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete Cost Entry Api Admin Command Costs Entries  Entry Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/sentry-test":{"post":{"tags":["Admin"],"summary":"Sentry Test","operationId":"sentry_test_api_admin_sentry_test_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"null","title":"Response Sentry Test Api Admin Sentry Test Post"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/iap/apple/notifications":{"post":{"tags":["IAP"],"summary":"Apple Notifications","operationId":"apple_notifications_api_iap_apple_notifications_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/iap/apple/notifications/sandbox":{"post":{"tags":["IAP"],"summary":"Apple Notifications Sandbox","operationId":"apple_notifications_sandbox_api_iap_apple_notifications_sandbox_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/widget/glucose":{"get":{"tags":["Widget"],"summary":"Widget Glucose","description":"The glance rail for the iOS home-screen widget AND the Apple Watch.\n\n⚠ CYCLE 419 — A REVOKED SESSION GETS `200` + `signed_in: false`, NEVER\nA 401. Both clients treat an auth failure as \"offline\" and keep their\nlast snapshot: the widget falls back to `WidgetSnapshotStore.read()`\nand re-renders it every ~15 min; `WatchGlanceModel`'s catch keeps the\nlast good snapshot, and `GlanceView` still renders it because its guard\nis `snap.signedIn || snap.ts > 0`. So a 401 here would freeze a\nsigned-out phone's widget and watch on the last glucose value\nindefinitely — a native-looking bug, unfixable without an archive,\nwhile the server behaved perfectly. A `signed_in: false` body instead\nOVERWRITES the stale App-Group snapshot (`getTimeline` persists what it\nfetches) and both surfaces fall to their existing signed-out\nplaceholders. No archive required.\n\nThe rejection stays narrow: only a credential whose SIGNATURE VERIFIES\nand whose session was explicitly logged out gets this payload. A\nmalformed, forged, expired or unknown credential still 401s from\n`deps._authenticate`, exactly as before — the emptiness signal is never\na way to skip authentication.\n\n⚠ The member is resolved AFTER the revocation check on purpose:\n`resolve_active_member` can WRITE (it creates the self-member when the\npointer is stale), and a signed-out credential must not create rows.\n\n⚠ AND THE REACH OF THIS IS BOUNDED BY THE ACCESS-TOKEN LIFETIME (30 min),\nWHICH THE \"forever\" ABOVE SHOULD NOT BE READ AS DENYING. A surface that\nmakes no request while its access token is still valid, and next wakes\nafter it has expired, gets a 401 from `_authenticate` (an expired\nsignature must still 401) and falls back to its cached snapshot exactly\nas described. On the device that signed out this is already closed\nlocally by the cycle-418 teardown — it wipes the App-Group widget\nsnapshot and relays a signed-out context to the watch. Closing it for a\ndevice that never heard about the sign-out means teaching the native\nclients to treat a REJECTED REFRESH as a purge, which is a Swift change\nand therefore an archive.","operationId":"widget_glucose_api_widget_glucose_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WidgetGlucoseSnapshot"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/admin/agents/report":{"post":{"tags":["Dev agent report"],"summary":"Report Cycle","operationId":"report_cycle_api_admin_agents_report_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DevAgentReportIn"}}},"required":true},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/preorders/checkout":{"post":{"tags":["preorders"],"summary":"Create Checkout","description":"Open a Stripe Checkout Session for one SKU.\n\nThe body carries `{sku, quantity, service_tier, terms_version,\nterms_accepted_at}` and nothing else is read — see\n`PreorderCheckoutIn`. Any amount-shaped field a caller adds is dropped\nby the schema before this function runs, so there is no branch here\nthat could trust one.\n\n⚠ THE TWO `terms_*` FIELDS ARE REQUIRED AND THE SCHEMA IS WHAT\nENFORCES IT. A request that never ran the acknowledgment gate is\nrefused with a 422 before this body executes, so no Stripe session\nand no order row can exist without a recorded agreement. The\ncheckbox in the page can be bypassed from a console; this cannot.\n\n`body.terms_accepted_at` is validated and then deliberately NOT\nforwarded: `create_checkout` stamps its own clock for the stored\nvalue. Its job here is to prove the gate ran, not to set the record.","operationId":"create_checkout_api_preorders_checkout_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreorderCheckoutIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreorderCheckoutOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/preorders/shipping-quote":{"post":{"tags":["preorders"],"summary":"Shipping Quote","description":"Cycle 517: live shipping rates (Shippo) for one SKU × quantity to a\nUS ZIP, and the signed quote checkout needs. No database, no account.","operationId":"shipping_quote_api_preorders_shipping_quote_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShippingQuoteIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShippingQuoteOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/preorders/session/{session_id}":{"get":{"tags":["preorders"],"summary":"Preorder By Session","description":"The thank-you page's only data source.\n\n404 unless the row exists AND the webhook has moved it to `paid` —\nthe page reads a confirmation, it never creates one.","operationId":"preorder_by_session_api_preorders_session__session_id__get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreorderSessionOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/health":{"get":{"tags":["System"],"summary":"Health Check","description":"Server, database, sync-engine, and alert backlog health.","operationId":"health_check_api_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"ActivationReportIn":{"properties":{"client_id":{"type":"string","maxLength":64,"minLength":1,"title":"Client Id"},"events":{"anyOf":[{"items":{"$ref":"#/components/schemas/ClientEventIn"},"type":"array","maxItems":100},{"type":"null"}],"title":"Events"},"platform":{"type":"string","enum":["ios","android","web"],"title":"Platform"},"app_version":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"App Version"},"shell_version":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Shell Version"},"notifications_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Notifications Enabled"},"critical_alerts_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Critical Alerts Enabled"},"live_activities_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Live Activities Enabled"},"activity_running":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Activity Running"},"widget_installed":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Widget Installed"},"push_token_claimed":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Push Token Claimed"},"note":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Note"}},"additionalProperties":false,"type":"object","required":["client_id","platform"],"title":"ActivationReportIn","description":"One install's self-report. `extra=\"forbid\"` so a typo in a client\nfield is a loud 422 instead of a silently-dropped signal."},"ActivationVerdictOut":{"properties":{"severity":{"type":"string","enum":["critical","advisory","ok"],"title":"Severity"},"gaps":{"items":{"type":"string","enum":["notifications_denied","no_push_token","token_claim_without_row","critical_alerts_off","live_activities_off","no_widget"]},"type":"array","title":"Gaps"},"has_push_token":{"type":"boolean","title":"Has Push Token"},"client_events":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Client Events"}},"type":"object","required":["severity","gaps","has_push_token"],"title":"ActivationVerdictOut","description":"The server's verdict for this install.\n\n`severity` is what the SPA gates its prompt on:\n  critical  — an alarm cannot reach this device; prompt firmly\n  advisory  — alarms fine, the glance surface needs attention\n  ok        — nothing to do"},"ActiveMemberOut":{"properties":{"member_id":{"type":"string","format":"uuid","title":"Member Id"},"is_self":{"type":"boolean","title":"Is Self"},"display_name":{"type":"string","title":"Display Name"},"avatar_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Avatar Id"}},"type":"object","required":["member_id","is_self","display_name"],"title":"ActiveMemberOut"},"ActiveMemberSetIn":{"properties":{"member_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Member Id"}},"type":"object","title":"ActiveMemberSetIn","description":"NULL clears the pointer; the resolver returns the self-member."},"AdminImagePresetOut":{"properties":{"preset_id":{"type":"string","title":"Preset Id"},"name":{"type":"string","title":"Name"},"light_src":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Light Src"},"dark_src":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dark Src"},"thumb_src":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Thumb Src"},"light_bytes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Light Bytes"},"dark_bytes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Dark Bytes"},"thumb_bytes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Thumb Bytes"}},"type":"object","required":["preset_id","name"],"title":"AdminImagePresetOut","description":"An admin-uploaded image preset on a pack (cycle 189) — surfaced in the\nadmin row so the console can preview + delete it. `*_src` are resolved\nagainst `THEME_PACK_CDN_BASE` (empty when unset). Bytes are the stored\nsizes for the admin view."},"AdminThemePackOut":{"properties":{"pack_id":{"type":"string","title":"Pack Id"},"name":{"type":"string","title":"Name"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"is_free":{"type":"boolean","title":"Is Free"},"price_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Price Cents"},"currency":{"type":"string","title":"Currency"},"price_display":{"type":"string","title":"Price Display"},"published":{"type":"boolean","title":"Published"},"sort_order":{"type":"integer","title":"Sort Order"},"preset_ids":{"items":{"type":"string"},"type":"array","title":"Preset Ids"},"owner_count":{"type":"integer","title":"Owner Count"},"editable":{"type":"boolean","title":"Editable"},"image_presets":{"items":{"$ref":"#/components/schemas/AdminImagePresetOut"},"type":"array","title":"Image Presets","default":[]},"hidden_preset_ids":{"items":{"type":"string"},"type":"array","title":"Hidden Preset Ids","default":[]}},"type":"object","required":["pack_id","name","category","is_free","price_cents","currency","price_display","published","sort_order","preset_ids","owner_count","editable"],"title":"AdminThemePackOut","description":"One catalog row for the admin console — includes drafts and `core`."},"AdminThemePacksResponse":{"properties":{"packs":{"items":{"$ref":"#/components/schemas/AdminThemePackOut"},"type":"array","title":"Packs"}},"type":"object","required":["packs"],"title":"AdminThemePacksResponse"},"AiQueryIn":{"properties":{"messages":{"items":{"$ref":"#/components/schemas/AiQueryMessage"},"type":"array","title":"Messages"}},"type":"object","required":["messages"],"title":"AiQueryIn"},"AiQueryMessage":{"properties":{"role":{"type":"string","title":"Role"},"content":{"type":"string","title":"Content"}},"type":"object","required":["role","content"],"title":"AiQueryMessage"},"AlarmClockSettings":{"properties":{"enabled":{"type":"boolean","title":"Enabled","default":false},"start":{"type":"string","title":"Start","default":"22:00"},"end":{"type":"string","title":"End","default":"07:00"},"days":{"items":{"type":"boolean"},"type":"array","title":"Days"},"show_iob_rings":{"type":"boolean","title":"Show Iob Rings","default":true}},"additionalProperties":false,"type":"object","title":"AlarmClockSettings","description":"Cycle 145 — alarm-clock-mode nightly schedule. Additive JSONB\nsub-object on `members.settings` (no migration; the cycle-77/84\npattern). `days[0]` = Sunday. An overnight window where `end <=\nstart` is VALID — it wraps past midnight; the client's in-window\ncheck handles the wrap. Purely presentational: the alarm system is\nuntouched by this key."},"AlertAcknowledgeAllResponse":{"properties":{"acknowledged":{"type":"integer","title":"Acknowledged"}},"type":"object","required":["acknowledged"],"title":"AlertAcknowledgeAllResponse"},"AlertActiveCountResponse":{"properties":{"active_alerts":{"type":"integer","title":"Active Alerts"}},"type":"object","required":["active_alerts"],"title":"AlertActiveCountResponse","description":"Cycle 310 — GET /api/alerts/active_count: fired, not-yet-recovered,\nnon-synthetic alerts across the calling account's accessible members.\nDeliberately minimal (count-only semantics — no rows, no ids) so the\nOTA cross-check consumer can't be repurposed as an alert reader."},"AlertCheckinOut":{"properties":{"outcome":{"type":"string","title":"Outcome"},"alert":{"$ref":"#/components/schemas/AlertOut"}},"type":"object","required":["outcome","alert"],"title":"AlertCheckinOut","description":"POST /api/alerts/{id}/checkin response.\n\n`outcome` is what the server DID, so the client can speak the right\nreply without re-deriving it: `extended` (⚠ cycle 450: EVERY check-in\n\"yes\" — still low, flat, rising, in range or dark — RENEWED the window\nto its full ten minutes through `begin_custody`'s renewal mode;\n`winding_down` is retired server-side, an older client still renders\nthe word) · `capped` (cycle 450 UN-retired it for the operator lever\n`SUGALARM_CUSTODY_CHECKIN_RENEWALS_MAX` — 0 = UNLIMITED, the shipping\ndefault; past a positive limit the answer was accepted and recorded but\nthe window was not renewed) · `reset` (a\nworsening / still-treating \"yes\" re-anchored the window and reset it to\nten minutes) · `declined` (a still-treating \"no\": the window ended\n`caregiver_declined` and a fresh search started, calls first) · `backup`\n(a help text LEFT; the window stays open and the ladder walks the other\nheroes beneath it) · `backup_repeat` (this episode's one text went out\nearlier; the ladder still walks) · `backup_unsent` (nobody could be\ntexted — rails off / no verified contacts / every send failed; gated on\nthe send, never on the claim — the ladder still walks) · `resumed` ·\n`resolved` (nothing was pending — the other device answered first, and\nthis is the resolved state, not an error). Cycle 427 retired\n`ask_more_time` and `no_reading` with the second question, the backup\noffer and the dark-feed refusal (a \"yes\" on a dark feed extends on\ntrust); cycle 450 retired `winding_down` and un-retired `capped`."},"AlertCheckinRequest":{"properties":{"answer":{"type":"string","enum":["yes","no","help","resume"],"title":"Answer"},"kind":{"anyOf":[{"type":"string","enum":["checkin","worsening","still_treating"]},{"type":"null"}],"title":"Kind"}},"type":"object","required":["answer"],"title":"AlertCheckinRequest","description":"POST /api/alerts/{id}/checkin body — `{\"answer\": ...}` and nothing\nelse is read.\n\n`yes` / `no` answer the question currently pending on the window.\n`help` (\"I need help now\") and `resume` (\"Resume alerts\") are the\ntreating screen's two standing actions and need no pending question.\n\n⚠ AN ANSWER CARRIES NO GLUCOSE CLAIM AND CANNOT. The server decides the\nglucose side from the LIVE readings on its own clock; a body carrying\n`sgv`, `custody_until`, `custody_extension_count` or anything else has\nthose keys IGNORED outright (the cycle-389 posture: ignore, do not\nvalidate — a 422 naming the extra field would merely say which names\nare interesting). \"yes\" can never buy more than one bounded window on\na number the server is still watching, and it buys nothing at all on a\nnumber that is recovering."},"AlertHistoryResponse":{"properties":{"count":{"type":"integer","title":"Count"},"alerts":{"items":{"$ref":"#/components/schemas/AlertOut"},"type":"array","title":"Alerts"}},"type":"object","required":["count","alerts"],"title":"AlertHistoryResponse"},"AlertOptOutUndoRequest":{"properties":{"contact_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Contact Id"}},"type":"object","title":"AlertOptOutUndoRequest","description":"POST /api/alerts/{id}/optout/undo body — entirely optional.\n\n`contact_id` lets a household grant-holder reinstate a hero ON THEIR\nBEHALF. Omitted, the server reinstates the CALLER's own linked contact\n(arc 1's `emergency_contacts.linked_user_id`). Nothing else is read.\nThis endpoint can only ever REMOVE an entry — it makes a phone louder,\nnever quieter — so it is not a suppression surface."},"AlertOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"member_id":{"type":"string","format":"uuid","title":"Member Id"},"level":{"type":"string","title":"Level"},"sgv":{"type":"integer","title":"Sgv"},"triggered_at":{"type":"string","format":"date-time","title":"Triggered At"},"fired_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Fired At"},"acknowledged_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Acknowledged At"},"snoozed_until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Snoozed Until"},"silenced_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Silenced At"},"last_heartbeat_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Heartbeat At"},"recovered_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Recovered At"},"custody_until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Custody Until"},"custody_anchor_sgv":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Custody Anchor Sgv"},"custody_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Custody Count"},"custody_contact_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Custody Contact Name"},"custody_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Custody Source"},"custody_backup_reach":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Custody Backup Reach"},"custody_kind":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Custody Kind"},"custody_opened_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Custody Opened At"},"treating_by":{"anyOf":[{"$ref":"#/components/schemas/TreatingByOut"},{"type":"null"}]},"attribution_picker_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Attribution Picker Seconds"},"episode_opt_outs":{"items":{"type":"string"},"type":"array","title":"Episode Opt Outs","default":[]},"custody_checkin_question":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Custody Checkin Question"},"custody_checkin_expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Custody Checkin Expires At"},"custody_extension_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Custody Extension Count"},"custody_checkin_renewals":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Custody Checkin Renewals"},"custody_end_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Custody End Reason"},"custody_end_sgv":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Custody End Sgv"},"audio_lead_until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Audio Lead Until"},"audio_lead_end_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Audio Lead End Reason"},"audio_lead_pending":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Audio Lead Pending"},"ascent_peak_sgv":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Ascent Peak Sgv"},"ascent_broken_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Ascent Broken At"},"custody_prompt_kind":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Custody Prompt Kind"},"custody_prompt_deadline":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Custody Prompt Deadline"},"custody_help_state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Custody Help State"},"custody_help_contact_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Custody Help Contact Name"},"no_data_quiet":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"No Data Quiet"},"synthetic":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Synthetic"},"reading_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Reading Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","member_id","level","sgv","triggered_at","created_at"],"title":"AlertOut"},"AlertSnoozeRequest":{"properties":{"duration_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Seconds"}},"type":"object","title":"AlertSnoozeRequest","description":"POST /api/alerts/{id}/snooze body. `duration_seconds` is optional\nand defaults to 300 (5 minutes). Clamped server-side to [60, 1800]."},"AlertTreatingIdentityRequest":{"properties":{"contact_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Contact Id"}},"type":"object","title":"AlertTreatingIdentityRequest","description":"POST /api/alerts/{id}/treating/identity body — the second tap.\n\n`{\"contact_id\": \"<uuid>\"}` names the custodian; `{\"contact_id\": null}`\nis the explicit \"Someone else\" choice, which is a real answer and not\na failure to answer.\n\nNO FREE TEXT, by construction: the only accepted value is an id that\nmust belong to the active member. A contact id from another household\nis refused with a response BYTE-IDENTICAL to the not-found response,\nso the endpoint cannot be used to probe which ids exist."},"AlertTreatingRequest":{"properties":{"duration_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Seconds"},"retry_of":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Retry Of"},"contact_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Contact Id"}},"type":"object","title":"AlertTreatingRequest","description":"POST /api/alerts/{id}/treating body.\n\n⚠ CYCLE 404: `duration_seconds` IS OPTIONAL AND IGNORED. There is one\nwindow, ten minutes, and the server assigns it. The field survives on\nthe schema ONLY so that a stale client POSTing 300 / 600 / 900 over a\nsounding urgent low is accepted rather than 422'd mid-alarm — it is\nread nowhere, logged nowhere and echoed nowhere. A current client\nsends `{}`. (Cycle 395's precedent — 422 an out-of-set CHOICE — stands\nfor choices; this is a retired parameter, and a retired parameter is\nignored.)\n\nNOTHING ELSE IS READ. The anchor glucose, the expiry and the engagement\ncount are all server-derived; a body carrying `custody_anchor_sgv`,\n`custody_until` or `custody_count` has those keys IGNORED outright\n(Pydantic's default `extra=\"ignore\"`), so they can never become\nattributes and no code path could trust one. This is deliberately the\ncycle-389 checkout posture: ignore, do not validate — a 422 naming the\nextra field would merely tell an attacker which names are interesting."},"AlertUnacknowledgedCountResponse":{"properties":{"count":{"type":"integer","title":"Count"}},"type":"object","required":["count"],"title":"AlertUnacknowledgedCountResponse"},"AllowedSignupAddRequest":{"properties":{"emails":{"items":{"type":"string"},"type":"array","minItems":1,"title":"Emails"},"note":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Note"}},"type":"object","required":["emails"],"title":"AllowedSignupAddRequest"},"AttributionIn":{"properties":{"window":{"type":"string","format":"date-time","title":"Window"},"hero_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Hero Id"}},"type":"object","required":["window"],"title":"AttributionIn","description":"`window` is the open window's `custody_opened_at`; `hero_id: null`\nis \"Someone else\". Extra keys (a client-sent `source`) are ignored."},"AvatarOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"member_id":{"type":"string","format":"uuid","title":"Member Id"},"content_type":{"type":"string","title":"Content Type"},"byte_size":{"type":"integer","title":"Byte Size"},"width":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Width"},"height":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Height"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"image_url":{"type":"string","title":"Image Url","description":"Relative URL of the raw bytes — fetched with auth by the\nclient (kiosk + web), so it's not a public link. Immutable per\nid (replacement mints a new id).","readOnly":true}},"type":"object","required":["id","member_id","content_type","byte_size","created_at","image_url"],"title":"AvatarOut"},"AvatarPhotoOut":{"properties":{"url":{"type":"string","title":"Url"},"v":{"type":"string","title":"V"}},"type":"object","required":["url","v"],"title":"AvatarPhotoOut"},"BackgroundListOut":{"properties":{"backgrounds":{"items":{"$ref":"#/components/schemas/BackgroundOut"},"type":"array","title":"Backgrounds"}},"type":"object","required":["backgrounds"],"title":"BackgroundListOut"},"BackgroundOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"member_id":{"type":"string","format":"uuid","title":"Member Id"},"content_type":{"type":"string","title":"Content Type"},"byte_size":{"type":"integer","title":"Byte Size"},"width":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Width"},"height":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Height"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"original_filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Original Filename"},"image_url":{"type":"string","title":"Image Url","description":"Relative URL of the raw bytes — fetched with auth by the\nclient (kiosk + web), so it's not a public link.","readOnly":true}},"type":"object","required":["id","member_id","content_type","byte_size","created_at","image_url"],"title":"BackgroundOut"},"BillingNoteIn":{"properties":{"note":{"type":"string","maxLength":500,"minLength":1,"title":"Note"}},"type":"object","required":["note"],"title":"BillingNoteIn"},"BillingSettingsIn":{"properties":{"enforcement_enabled":{"type":"boolean","title":"Enforcement Enabled"},"confirm":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Confirm"}},"type":"object","required":["enforcement_enabled"],"title":"BillingSettingsIn"},"Body_admin_upload_image_preset_api_admin_theme_packs__pack_id__image_presets_post":{"properties":{"name":{"type":"string","title":"Name"},"light":{"type":"string","format":"binary","title":"Light"},"dark":{"anyOf":[{"type":"string","format":"binary"},{"type":"null"}],"title":"Dark"},"thumb":{"anyOf":[{"type":"string","format":"binary"},{"type":"null"}],"title":"Thumb"}},"type":"object","required":["name","light"],"title":"Body_admin_upload_image_preset_api_admin_theme_packs__pack_id__image_presets_post"},"Body_estimate_carbs_api_photo_estimate_carbs_post":{"properties":{"image":{"type":"string","format":"binary","title":"Image"}},"type":"object","required":["image"],"title":"Body_estimate_carbs_api_photo_estimate_carbs_post"},"Body_upload_avatar_api_members__member_id__avatar_post":{"properties":{"image":{"type":"string","format":"binary","title":"Image"},"width":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Width"},"height":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Height"}},"type":"object","required":["image"],"title":"Body_upload_avatar_api_members__member_id__avatar_post"},"Body_upload_background_api_backgrounds_post":{"properties":{"image":{"type":"string","format":"binary","title":"Image"},"width":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Width"},"height":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Height"}},"type":"object","required":["image"],"title":"Body_upload_background_api_backgrounds_post"},"BroadcastRequest":{"properties":{"message":{"type":"string","title":"Message"},"level":{"type":"string","enum":["info","warn","urgent"],"title":"Level"},"target":{"anyOf":[{"type":"string","const":"all"},{"$ref":"#/components/schemas/_BroadcastTarget"}],"title":"Target","default":"all"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"}},"type":"object","required":["message","level"],"title":"BroadcastRequest"},"CGMConnectRequest":{"properties":{"provider":{"type":"string","enum":["dexcom","libre"],"title":"Provider"},"region":{"type":"string","title":"Region","default":"us"},"username":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Username"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"password":{"type":"string","minLength":1,"title":"Password"}},"type":"object","required":["provider","password"],"title":"CGMConnectRequest"},"CGMConnectResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"provider":{"type":"string","title":"Provider"},"message":{"type":"string","title":"Message"},"patient_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Patient Id"},"backfill_count":{"type":"integer","title":"Backfill Count","default":0},"warning_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Warning Code"},"warning":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Warning"}},"type":"object","required":["success","provider","message"],"title":"CGMConnectResponse"},"CGMDisconnectResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"}},"type":"object","required":["success","message"],"title":"CGMDisconnectResponse"},"CGMStatusResponse":{"properties":{"connected":{"type":"boolean","title":"Connected"},"provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider"},"region":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Region"},"last_reading":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Last Reading"},"cgm_auth_failed":{"type":"boolean","title":"Cgm Auth Failed","default":false},"username":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Username"}},"type":"object","required":["connected"],"title":"CGMStatusResponse"},"CameraFallbackIn":{"properties":{"purpose":{"type":"string","enum":["meal_photo","avatar"],"title":"Purpose"},"reason":{"type":"string","enum":["no_bridge","post_failed","timing_miss"],"title":"Reason"}},"additionalProperties":false,"type":"object","required":["purpose","reason"],"title":"CameraFallbackIn","description":"Cycle 458 — the kiosk reports a photo chooser opened without its\ncycle-455 camera purpose reaching the APK. Closed enums only — no id, no\npath, no free text (`extra=\"forbid\"`). The calling device is the subject.\n`timing_miss` is accepted for the APK's own report (a later cycle)."},"CannedReading":{"properties":{"sgv":{"type":"integer","maximum":1000.0,"minimum":0.0,"title":"Sgv"},"timestamp":{"type":"string","format":"date-time","title":"Timestamp"},"trend":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trend"},"provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider"}},"type":"object","required":["sgv","timestamp"],"title":"CannedReading"},"CarbEstimateIn":{"properties":{"description":{"type":"string","maxLength":300,"minLength":1,"title":"Description"}},"additionalProperties":false,"type":"object","required":["description"],"title":"CarbEstimateIn","description":"Request for `POST /api/carbs/estimate` (cycle 102, voice carb lookup).\n\nThe spoken food + restaurant text Leopard transcribed on the Pi — only\nthe TEXT reaches the server (audio stays on-device). The response shape\nis `PhotoEstimateOut`, identical to the photo estimator."},"CheckoutIn":{"properties":{"handoff":{"type":"string","maxLength":256,"minLength":1,"title":"Handoff"},"terms_version":{"type":"string","maxLength":64,"minLength":1,"pattern":"^[A-Za-z0-9._-]+$","title":"Terms Version"},"terms_accepted_at":{"type":"string","format":"date-time","title":"Terms Accepted At"},"care_plan":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Care Plan"}},"type":"object","required":["handoff","terms_version","terms_accepted_at"],"title":"CheckoutIn","description":"The cycle-397 consent pattern: both terms fields REQUIRED (422 without\nthem), `terms_version` shape-validated, `terms_accepted_at` proves the\ngate ran and is NOT stored — the server stamps its own clock."},"ClientEventIn":{"properties":{"kind":{"type":"string","maxLength":32,"minLength":1,"title":"Kind"},"client_ts":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}],"title":"Client Ts"},"details":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Details"}},"type":"object","required":["kind"],"title":"ClientEventIn","description":"Cycle 431 — one CLIENT-CLAIMED transport event, posted on the\nactivation report. The kind is validated server-side against the closed\nlist (`alarm_event.CLIENT_CLAIMED_KINDS`); an unknown kind is dropped,\nnever refused. There is deliberately NO `actor` field and NO `ts`:\nthe server forces `actor=\"client_claimed\"` and stamps `ts` itself; the\nclient's own clock goes to `details.client_ts`. `extra=\"ignore\"`, not\nforbid: an unknown key is dropped so a newer shell can never 422 the\nwhole report."},"CodeIn":{"properties":{"email":{"type":"string","maxLength":320,"minLength":1,"title":"Email"}},"type":"object","required":["email"],"title":"CodeIn"},"CoreHiddenIn":{"properties":{"preset_ids":{"items":{"type":"string"},"type":"array","maxItems":64,"title":"Preset Ids"}},"type":"object","title":"CoreHiddenIn","description":"Cycle 192 — replace the globally-hidden built-in set for `core`. The\nstaged → Publish admin commit sends the FULL desired hidden set. The\nservice rejects `aurora` (422 `fallback_protected`) and any id that is\nnot a code-defined built-in (422 `unknown_preset`)."},"CreateAccountRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"display_name":{"type":"string","maxLength":100,"minLength":1,"title":"Display Name"},"is_admin":{"type":"boolean","title":"Is Admin","default":false}},"type":"object","required":["email","display_name"],"title":"CreateAccountRequest"},"DailySummary":{"properties":{"date":{"type":"string","format":"date","title":"Date"},"reading_count":{"type":"integer","title":"Reading Count"},"avg_sgv":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Sgv"},"std_sgv":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Std Sgv"},"cv_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cv Pct"},"min_sgv":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Min Sgv"},"max_sgv":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Sgv"},"gmi_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Gmi Pct"},"tir":{"$ref":"#/components/schemas/TIRBuckets"},"target_low":{"type":"integer","title":"Target Low"},"target_high":{"type":"integer","title":"Target High"},"urgent_low":{"type":"integer","title":"Urgent Low"},"urgent_high":{"type":"integer","title":"Urgent High"}},"type":"object","required":["date","reading_count","tir","target_low","target_high","urgent_low","urgent_high"],"title":"DailySummary","description":"One UTC calendar day of glucose stats. Same fields as\n`GlucoseSummary` minus the redundant start/end window."},"DailySummaryResponse":{"properties":{"count":{"type":"integer","title":"Count"},"days":{"items":{"$ref":"#/components/schemas/DailySummary"},"type":"array","title":"Days"}},"type":"object","required":["count","days"],"title":"DailySummaryResponse"},"DevAgentReportIn":{"properties":{"cycle_number":{"type":"integer","minimum":0.0,"title":"Cycle Number"},"version":{"type":"string","maxLength":32,"minLength":1,"title":"Version"},"commit_sha":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Commit Sha"},"agents":{"items":{"$ref":"#/components/schemas/DevAgentReportItemIn"},"type":"array","maxItems":20,"minItems":1,"title":"Agents"}},"additionalProperties":false,"type":"object","required":["cycle_number","version","agents"],"title":"DevAgentReportIn"},"DevAgentReportItemIn":{"properties":{"agent_key":{"type":"string","maxLength":128,"minLength":1,"title":"Agent Key"},"display_name":{"type":"string","maxLength":128,"minLength":1,"title":"Display Name"},"model":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Model"},"kind":{"type":"string","enum":["review-gate","write-capable"],"title":"Kind","default":"review-gate"},"result":{"type":"string","enum":["pass","warn","blocked","skip"],"title":"Result"},"reason":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Reason"},"duration_seconds":{"anyOf":[{"type":"number","maximum":86400.0,"minimum":0.0},{"type":"null"}],"title":"Duration Seconds"},"estimated_cost_usd":{"anyOf":[{"type":"number","maximum":1000.0,"minimum":0.0},{"type":"null"}],"title":"Estimated Cost Usd"}},"additionalProperties":false,"type":"object","required":["agent_key","display_name","result"],"title":"DevAgentReportItemIn"},"DevCleanupOut":{"properties":{"readings_deleted":{"type":"integer","title":"Readings Deleted"},"alerts_deleted":{"type":"integer","title":"Alerts Deleted"}},"type":"object","required":["readings_deleted","alerts_deleted"],"title":"DevCleanupOut"},"DeviceCapabilitiesIn":{"properties":{"camera_capable":{"type":"boolean","title":"Camera Capable"}},"additionalProperties":false,"type":"object","required":["camera_capable"],"title":"DeviceCapabilitiesIn","description":"Cycle 200 — a device self-reporting its hardware capabilities.\n\nOperates on the *calling* device (resolved from the device-token\nidentity) — there is no `device_id` field, so no IDOR surface. JWT-\nonly callers have no device context and are rejected by the route."},"DeviceCapabilitiesOut":{"properties":{"camera_capable":{"type":"boolean","title":"Camera Capable"}},"type":"object","required":["camera_capable"],"title":"DeviceCapabilitiesOut","description":"The updated capability flag echoed back to the self-reporting device."},"DeviceHeartbeatRequest":{"properties":{"client_id":{"type":"string","maxLength":100,"minLength":1,"title":"Client Id"}},"type":"object","required":["client_id"],"title":"DeviceHeartbeatRequest"},"DeviceListResponse":{"properties":{"count":{"type":"integer","title":"Count"},"devices":{"items":{"$ref":"#/components/schemas/DeviceOut"},"type":"array","title":"Devices"}},"type":"object","required":["count","devices"],"title":"DeviceListResponse"},"DeviceOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"user_id":{"type":"string","format":"uuid","title":"User Id"},"name":{"type":"string","title":"Name"},"device_type":{"type":"string","title":"Device Type"},"client_id":{"type":"string","title":"Client Id"},"last_seen_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Seen At"},"last_ip":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Ip"},"user_agent":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Agent"},"has_token":{"type":"boolean","title":"Has Token","default":false},"token_issued_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Token Issued At"},"token_revoked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Token Revoked At"},"wake_word":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wake Word"},"camera_capable":{"type":"boolean","title":"Camera Capable","default":false},"created_at":{"type":"string","format":"date-time","title":"Created At"},"active":{"type":"boolean","title":"Active","default":false},"kiosk_state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kiosk State"},"kiosk_state_since":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Kiosk State Since"}},"type":"object","required":["id","user_id","name","device_type","client_id","created_at"],"title":"DeviceOut"},"DevicePatchRequest":{"properties":{"wake_word":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Wake Word"},"name":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Name"}},"additionalProperties":false,"type":"object","title":"DevicePatchRequest","description":"Cycle 100 / 377 — owner-driven device updates (JWT only).\n\nEvery field is INDEPENDENTLY tri-stated off `model_fields_set`, so a\ncaller may send one, the other, or both; an omitted field is never\ntouched. `extra=\"forbid\"`, so an unknown key is a 422 rather than a\nsilently-ignored no-op.\n\n`wake_word` (cycle 100): omitted → no change; `null` → unset (agent\nfalls back to its local default); a string → the wake-word key\ncharset.\n\n`name` (cycle 377): omitted → no change; a string → the new display\nname. Unlike `wake_word` it is NOT nullable — `devices.name` is\n`NOT NULL` and a device with no name is unidentifiable in the picker\n— so an explicit `null` is a 422, not an unset. Before this cycle\nthe name was write-once, set at pairing/registration and unchangeable\nafterwards, which left a mislabelled kiosk mislabelled forever (a\nhousehold kiosk named for the wrong child is a real misread: a kiosk\nrenders its OWNER account's active member regardless of its name)."},"DeviceProtectionIn":{"properties":{"protected":{"type":"boolean","title":"Protected"},"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Note"},"confirm":{"type":"boolean","title":"Confirm","default":false}},"type":"object","required":["protected"],"title":"DeviceProtectionIn","description":"Cycle 477: \"Device purchased\" (set or clear) and the note. The\nconsole sends `confirm: true` from its confirm dialog."},"DeviceRegisterRequest":{"properties":{"client_id":{"type":"string","maxLength":100,"minLength":1,"title":"Client Id"},"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name"},"device_type":{"type":"string","enum":["kiosk","web","mobile","other"],"title":"Device Type"}},"type":"object","required":["client_id","name","device_type"],"title":"DeviceRegisterRequest"},"DeviceReleaseIn":{"properties":{"push_tokens":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":32},{"type":"null"}],"title":"Push Tokens"},"live_activity_tokens":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":32},{"type":"null"}],"title":"Live Activity Tokens"},"web_push_endpoints":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":32},{"type":"null"}],"title":"Web Push Endpoints"},"release_watch_tokens":{"type":"boolean","title":"Release Watch Tokens","default":false}},"additionalProperties":false,"type":"object","title":"DeviceReleaseIn","description":"Cycle 418 — the credentials one install is handing back at sign-out.\n\n⚠ NO `user_id` FIELD, DELIBERATELY. The caller's account comes from the\nJWT and nothing else, so the endpoint cannot be pointed at another\nhousehold. Every list is optional: an install releases whatever rails it\nactually holds, and an empty body is a valid no-op."},"EmergencyContactCreate":{"properties":{"label":{"type":"string","maxLength":120,"minLength":1,"title":"Label"},"phone_e164":{"type":"string","maxLength":20,"minLength":8,"title":"Phone E164"},"notify_levels":{"items":{"type":"string","enum":["urgent_low","low","high","urgent_high"]},"type":"array","title":"Notify Levels"},"sms_enabled":{"type":"boolean","title":"Sms Enabled","default":true},"voice_enabled":{"type":"boolean","title":"Voice Enabled","default":false},"linked_user_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Linked User Id"}},"type":"object","required":["label","phone_e164"],"title":"EmergencyContactCreate"},"EmergencyContactListOut":{"properties":{"contacts":{"items":{"$ref":"#/components/schemas/EmergencyContactOut"},"type":"array","title":"Contacts"},"sms_enabled":{"type":"boolean","title":"Sms Enabled"},"voice_enabled":{"type":"boolean","title":"Voice Enabled"},"preselected_contact_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Preselected Contact Id"}},"type":"object","required":["contacts","sms_enabled","voice_enabled"],"title":"EmergencyContactListOut"},"EmergencyContactOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"member_id":{"type":"string","format":"uuid","title":"Member Id"},"label":{"type":"string","title":"Label"},"phone_e164":{"type":"string","title":"Phone E164"},"sms_enabled":{"type":"boolean","title":"Sms Enabled"},"notify_levels":{"items":{"type":"string"},"type":"array","title":"Notify Levels"},"call_order":{"type":"integer","title":"Call Order"},"voice_enabled":{"type":"boolean","title":"Voice Enabled"},"no_data_call_enabled":{"type":"boolean","title":"No Data Call Enabled","default":false},"verified":{"type":"boolean","title":"Verified"},"awaiting_optin":{"type":"boolean","title":"Awaiting Optin"},"linked_user_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Linked User Id"},"link_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Link Source"},"avatar_preset":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar Preset"},"avatar_photo":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Avatar Photo"},"can_change_picture":{"type":"boolean","title":"Can Change Picture","default":false},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","member_id","label","phone_e164","sms_enabled","notify_levels","call_order","voice_enabled","verified","awaiting_optin","created_at"],"title":"EmergencyContactOut"},"EmergencyContactUpdate":{"properties":{"label":{"anyOf":[{"type":"string","maxLength":120,"minLength":1},{"type":"null"}],"title":"Label"},"phone_e164":{"anyOf":[{"type":"string","maxLength":20,"minLength":8},{"type":"null"}],"title":"Phone E164"},"notify_levels":{"anyOf":[{"items":{"type":"string","enum":["urgent_low","low","high","urgent_high"]},"type":"array"},{"type":"null"}],"title":"Notify Levels"},"sms_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Sms Enabled"},"voice_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Voice Enabled"},"call_order":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Call Order"},"no_data_call_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"No Data Call Enabled"},"linked_user_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Linked User Id"}},"type":"object","title":"EmergencyContactUpdate","description":"Partial update for `PATCH /api/emergency-contacts/{id}`.\n\nEditing `phone_e164` clears `verified_at` server-side so a changed\nnumber must re-verify."},"EnrollIn":{"properties":{"first_name":{"type":"string","title":"First Name"},"phone":{"type":"string","title":"Phone"},"consent":{"type":"boolean","title":"Consent"}},"additionalProperties":false,"type":"object","required":["first_name","phone","consent"],"title":"EnrollIn"},"EntitlementGrantIn":{"properties":{"user_id":{"type":"string","format":"uuid","title":"User Id"},"pack_id":{"type":"string","title":"Pack Id"},"source":{"type":"string","enum":["grant","promo"],"title":"Source","default":"grant"}},"type":"object","required":["user_id","pack_id"],"title":"EntitlementGrantIn"},"EntitlementOut":{"properties":{"pack_id":{"type":"string","title":"Pack Id"},"source":{"type":"string","title":"Source"},"granted_at":{"type":"string","format":"date-time","title":"Granted At"}},"type":"object","required":["pack_id","source","granted_at"],"title":"EntitlementOut"},"ExtendGraceIn":{"properties":{"add_days":{"type":"integer","maximum":90.0,"minimum":1.0,"title":"Add Days"},"note":{"type":"string","maxLength":500,"minLength":1,"title":"Note"}},"type":"object","required":["add_days","note"],"title":"ExtendGraceIn"},"ForgotPasswordRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"}},"type":"object","required":["email"],"title":"ForgotPasswordRequest","description":"Cycle 190: public reset REQUEST. Only the email — a malformed address\nmay 422 (input validation), which does not reveal account existence. The\nendpoint otherwise always returns a generic 200 regardless of state."},"GlucoseHistoryResponse":{"properties":{"count":{"type":"integer","title":"Count"},"readings":{"items":{"$ref":"#/components/schemas/GlucoseReadingOut"},"type":"array","title":"Readings"}},"type":"object","required":["count","readings"],"title":"GlucoseHistoryResponse"},"GlucoseLatestResponse":{"properties":{"reading":{"anyOf":[{"$ref":"#/components/schemas/GlucoseReadingOut"},{"type":"null"}]},"stale":{"type":"boolean","title":"Stale"},"age_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Age Seconds"}},"type":"object","required":["stale"],"title":"GlucoseLatestResponse"},"GlucoseReadingOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"sgv":{"type":"integer","title":"Sgv"},"timestamp":{"type":"string","format":"date-time","title":"Timestamp"},"trend":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trend"},"trend_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Trend Rate"},"provider":{"type":"string","title":"Provider"},"received_at":{"type":"string","format":"date-time","title":"Received At"},"classification":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Classification"}},"type":"object","required":["id","sgv","timestamp","provider","received_at"],"title":"GlucoseReadingOut"},"GlucoseSummary":{"properties":{"start":{"type":"string","format":"date-time","title":"Start"},"end":{"type":"string","format":"date-time","title":"End"},"reading_count":{"type":"integer","title":"Reading Count"},"avg_sgv":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Sgv"},"std_sgv":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Std Sgv"},"cv_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cv Pct"},"min_sgv":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Min Sgv"},"max_sgv":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Sgv"},"gmi_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Gmi Pct"},"tir":{"$ref":"#/components/schemas/TIRBuckets"},"target_low":{"type":"integer","title":"Target Low"},"target_high":{"type":"integer","title":"Target High"},"urgent_low":{"type":"integer","title":"Urgent Low"},"urgent_high":{"type":"integer","title":"Urgent High"}},"type":"object","required":["start","end","reading_count","tir","target_low","target_high","urgent_low","urgent_high"],"title":"GlucoseSummary","description":"Summary statistics over a closed [start, end] window."},"GrantCompIn":{"properties":{"until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Until"},"note":{"type":"string","maxLength":500,"minLength":1,"title":"Note"}},"type":"object","required":["note"],"title":"GrantCompIn"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HandoffIn":{"properties":{"handoff":{"type":"string","maxLength":256,"minLength":1,"title":"Handoff"}},"type":"object","required":["handoff"],"title":"HandoffIn"},"HeroAvatarOut":{"properties":{"hero_id":{"type":"string","format":"uuid","title":"Hero Id"},"avatar_preset":{"type":"string","title":"Avatar Preset"},"avatar_photo":{"anyOf":[{"$ref":"#/components/schemas/AvatarPhotoOut"},{"type":"null"}]}},"type":"object","required":["hero_id","avatar_preset"],"title":"HeroAvatarOut"},"HeroAvatarPhoto":{"properties":{"url":{"type":"string","title":"Url"},"v":{"type":"string","title":"V"}},"type":"object","required":["url","v"],"title":"HeroAvatarPhoto","description":"Cycle 457: the hero's own photo — an AUTHENTICATED path (never a\nbucket URL) plus `v`, which changes with every picture change."},"HeroAvatarPresetIn":{"properties":{"preset":{"type":"string","enum":["kitty-1","kitty-2","kitty-3","puppy-1","puppy-2","puppy-3"],"title":"Preset"}},"type":"object","required":["preset"],"title":"HeroAvatarPresetIn","description":"`{\"preset\": \"kitty-1\"}`. Anything but one of the six keys is a 422."},"HeroRosterItem":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"display_name":{"type":"string","title":"Display Name"},"avatar_preset":{"type":"string","title":"Avatar Preset"},"position":{"type":"integer","title":"Position"},"avatar_photo":{"anyOf":[{"$ref":"#/components/schemas/HeroAvatarPhoto"},{"type":"null"}]}},"type":"object","required":["id","display_name","avatar_preset","position"],"title":"HeroRosterItem","description":"One picker tile. Deliberately nothing that reaches a person."},"ImagePresetOut":{"properties":{"id":{"type":"string","title":"Id"},"pack_id":{"type":"string","title":"Pack Id"},"light_src":{"type":"string","title":"Light Src"},"dark_src":{"type":"string","title":"Dark Src"},"thumb_src":{"type":"string","title":"Thumb Src"}},"type":"object","required":["id","pack_id","light_src","dark_src","thumb_src"],"title":"ImagePresetOut"},"InjectReadingBody":{"properties":{"member_id":{"type":"string","format":"uuid","title":"Member Id"},"sgv":{"type":"integer","maximum":600.0,"minimum":10.0,"title":"Sgv"},"trend":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trend","default":"Flat"},"at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"At"}},"type":"object","required":["member_id","sgv"],"title":"InjectReadingBody"},"InjectReadingOut":{"properties":{"reading_id":{"type":"string","format":"uuid","title":"Reading Id"},"member_id":{"type":"string","format":"uuid","title":"Member Id"},"sgv":{"type":"integer","title":"Sgv"},"timestamp":{"type":"string","format":"date-time","title":"Timestamp"},"alert":{"anyOf":[{"$ref":"#/components/schemas/AlertOut"},{"type":"null"}]}},"type":"object","required":["reading_id","member_id","sgv","timestamp"],"title":"InjectReadingOut"},"KioskDeviceListOut":{"properties":{"devices":{"items":{"$ref":"#/components/schemas/KioskDeviceOut"},"type":"array","title":"Devices"}},"type":"object","required":["devices"],"title":"KioskDeviceListOut"},"KioskDeviceOut":{"properties":{"device_id":{"type":"string","format":"uuid","title":"Device Id"},"name":{"type":"string","title":"Name"},"device_type":{"type":"string","title":"Device Type"},"owner_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Owner Email"},"app_version_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"App Version Name"},"app_version_code":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"App Version Code"},"current_route":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Route"},"online":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Online"},"last_reading_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Reading At"},"last_alarm_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Alarm At"},"last_ota_result":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Ota Result"},"last_seen_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Seen At"},"last_wedge_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Wedge At"},"last_wedge_episode_age_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Last Wedge Episode Age Seconds"},"last_wedge_active_member_null":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Last Wedge Active Member Null"},"wifi_setup":{"anyOf":[{"$ref":"#/components/schemas/WifiSetupIn"},{"type":"null"}]},"wifi_setup_state":{"type":"string","title":"Wifi Setup State","default":"unknown"},"wifi_setup_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wifi Setup Reason"}},"type":"object","required":["device_id","name","device_type"],"title":"KioskDeviceOut","description":"Admin device view row (cycle 225) — versions + OTA result per unit."},"KioskHeartbeatIn":{"properties":{"app_version_name":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"App Version Name"},"app_version_code":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"App Version Code"},"current_route":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Current Route"},"online":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Online"},"last_reading_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Reading At"},"last_alarm_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Alarm At"},"last_ota_result":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}],"title":"Last Ota Result"},"last_wedge_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Wedge At"},"last_wedge_episode_age_seconds":{"anyOf":[{"type":"integer","maximum":2592000.0,"minimum":0.0},{"type":"null"}],"title":"Last Wedge Episode Age Seconds"},"last_wedge_active_member_null":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Last Wedge Active Member Null"},"wifi_setup":{"anyOf":[{"$ref":"#/components/schemas/WifiSetupIn"},{"type":"null"}]}},"type":"object","title":"KioskHeartbeatIn"},"KioskLabelIn":{"properties":{"label":{"type":"string","maxLength":100,"minLength":1,"title":"Label"}},"type":"object","required":["label"],"title":"KioskLabelIn"},"KioskOtaTriggerIn":{"properties":{"device_ids":{"anyOf":[{"items":{"type":"string","format":"uuid"},"type":"array"},{"type":"null"}],"title":"Device Ids"}},"type":"object","title":"KioskOtaTriggerIn","description":"Optional device-id scoping for the admin OTA nudge. Omitted/empty =\nevery kiosk device."},"KioskOtaTriggerOut":{"properties":{"sent":{"type":"integer","title":"Sent"},"targeted_devices":{"type":"integer","title":"Targeted Devices"}},"type":"object","required":["sent","targeted_devices"],"title":"KioskOtaTriggerOut"},"KioskStatusListResponse":{"properties":{"kiosks":{"items":{"$ref":"#/components/schemas/KioskStatusOut"},"type":"array","title":"Kiosks"},"notify_after_seconds":{"type":"integer","title":"Notify After Seconds"}},"type":"object","required":["kiosks","notify_after_seconds"],"title":"KioskStatusListResponse"},"KioskStatusOut":{"properties":{"device_id":{"type":"string","format":"uuid","title":"Device Id"},"name":{"type":"string","title":"Name"},"state":{"type":"string","title":"State"},"since":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Since"},"is_this_device":{"type":"boolean","title":"Is This Device","default":false}},"type":"object","required":["device_id","name","state"],"title":"KioskStatusOut","description":"Cycle 432 — one household-facing line per kiosk the caller can see:\nlabel, derived state, when it began. NO address, NO user agent, NO\nfingerprint — this is the shape the phone and web household views\nrender."},"LeadTimeStats":{"properties":{"p50":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"P50"},"p90":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"P90"},"mean":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Mean"}},"type":"object","title":"LeadTimeStats"},"LiveActivityTokenAck":{"properties":{"ok":{"type":"boolean","title":"Ok","default":true}},"type":"object","title":"LiveActivityTokenAck"},"LiveActivityTokenDeleteIn":{"properties":{"member_id":{"type":"string","format":"uuid","title":"Member Id"},"kind":{"type":"string","enum":["start","update"],"title":"Kind"},"token":{"type":"string","maxLength":4096,"minLength":1,"title":"Token"}},"type":"object","required":["member_id","kind","token"],"title":"LiveActivityTokenDeleteIn"},"LiveActivityTokenIn":{"properties":{"member_id":{"type":"string","format":"uuid","title":"Member Id"},"kind":{"type":"string","enum":["start","update"],"title":"Kind"},"token":{"type":"string","maxLength":4096,"minLength":1,"title":"Token"},"bundle_id":{"type":"string","maxLength":255,"minLength":1,"title":"Bundle Id"}},"type":"object","required":["member_id","kind","token","bundle_id"],"title":"LiveActivityTokenIn"},"LoginRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"password":{"type":"string","title":"Password"}},"type":"object","required":["email","password"],"title":"LoginRequest"},"MemberCreateIn":{"properties":{"display_name":{"type":"string","maxLength":100,"minLength":1,"title":"Display Name"},"relationship_label":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Relationship Label"}},"type":"object","required":["display_name"],"title":"MemberCreateIn"},"MemberLinkGrantItem":{"properties":{"user_id":{"type":"string","format":"uuid","title":"User Id"},"email":{"type":"string","title":"Email"},"display_name":{"type":"string","title":"Display Name"},"role":{"type":"string","enum":["owner","editor","viewer"],"title":"Role"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["user_id","email","display_name","role","created_at"],"title":"MemberLinkGrantItem","description":"One row of `GET /api/members/{id}/links` — a current grant of\naccess on this member to another user. The owner pane uses this to\nrender the \"Linked to X\" + Unlink row."},"MemberLinkGrantListOut":{"properties":{"links":{"items":{"$ref":"#/components/schemas/MemberLinkGrantItem"},"type":"array","title":"Links"}},"type":"object","required":["links"],"title":"MemberLinkGrantListOut"},"MemberLinkInviteAcceptIn":{"properties":{"code":{"type":"string","maxLength":6,"minLength":6,"title":"Code"}},"type":"object","required":["code"],"title":"MemberLinkInviteAcceptIn"},"MemberLinkInviteAcceptOut":{"properties":{"member_id":{"type":"string","format":"uuid","title":"Member Id"},"owner_user_id":{"type":"string","format":"uuid","title":"Owner User Id"},"owner_display_name":{"type":"string","title":"Owner Display Name"},"role":{"type":"string","enum":["owner","editor","viewer"],"title":"Role"}},"type":"object","required":["member_id","owner_user_id","owner_display_name","role"],"title":"MemberLinkInviteAcceptOut","description":"Returned by `POST /api/me/link_invites/accept`.\n\n`member_id` is the **canonical** member (the accepter's self-member\nafter merge). `owner_display_name` is the owner who issued the\ninvite, so the UI can show \"You're now sharing data with <owner>\"."},"MemberLinkInviteCreateIn":{"properties":{"email":{"type":"string","format":"email","title":"Email"}},"type":"object","required":["email"],"title":"MemberLinkInviteCreateIn"},"MemberLinkInviteListItem":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"member_id":{"type":"string","format":"uuid","title":"Member Id"},"invited_email":{"type":"string","title":"Invited Email"},"status":{"type":"string","enum":["pending","accepted","revoked","expired"],"title":"Status"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"accepted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Accepted At"},"accepted_by_user_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Accepted By User Id"}},"type":"object","required":["id","member_id","invited_email","status","expires_at","created_at"],"title":"MemberLinkInviteListItem","description":"List variant — same shape as `MemberLinkInviteOut` minus the\ncode. Owner sees the pending invites they've issued, no secret."},"MemberLinkInviteListOut":{"properties":{"invites":{"items":{"$ref":"#/components/schemas/MemberLinkInviteListItem"},"type":"array","title":"Invites"}},"type":"object","required":["invites"],"title":"MemberLinkInviteListOut"},"MemberLinkInviteOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"member_id":{"type":"string","format":"uuid","title":"Member Id"},"invited_email":{"type":"string","title":"Invited Email"},"code":{"type":"string","title":"Code"},"status":{"type":"string","enum":["pending","accepted","revoked","expired"],"title":"Status"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","member_id","invited_email","code","status","expires_at","created_at"],"title":"MemberLinkInviteOut","description":"Returned when the owner creates an invite. The 6-digit `code` is\nvisible **only on the create response** — `GET /api/members/{id}/link_invites`\nomits it (cycle-8 pattern: the code is the secret; surface it once\non issue, never again)."},"MemberLinkUnlinkOut":{"properties":{"member_id":{"type":"string","format":"uuid","title":"Member Id"},"unlinked_user_id":{"type":"string","format":"uuid","title":"Unlinked User Id"}},"type":"object","required":["member_id","unlinked_user_id"],"title":"MemberLinkUnlinkOut","description":"Returned by `DELETE /api/members/{id}/link/{user_id}` — confirms\nthe user_id whose grant was removed."},"MemberListOut":{"properties":{"members":{"items":{"$ref":"#/components/schemas/MemberOut"},"type":"array","title":"Members"},"active_member_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Active Member Id"}},"type":"object","required":["members"],"title":"MemberListOut"},"MemberOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"display_name":{"type":"string","title":"Display Name"},"relationship_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Relationship Label"},"is_self":{"type":"boolean","title":"Is Self"},"linked_user_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Linked User Id"},"owner_user_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Owner User Id"},"cgm_provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cgm Provider"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"archived_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Archived At"},"avatar_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Avatar Id"}},"type":"object","required":["id","display_name","is_self","created_at"],"title":"MemberOut"},"MemberPatchIn":{"properties":{"display_name":{"anyOf":[{"type":"string","maxLength":100,"minLength":1},{"type":"null"}],"title":"Display Name"},"relationship_label":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Relationship Label"}},"type":"object","title":"MemberPatchIn"},"MessageResponse":{"properties":{"message":{"type":"string","title":"Message"}},"type":"object","required":["message"],"title":"MessageResponse"},"MyEntitlementsResponse":{"properties":{"pack_ids":{"items":{"type":"string"},"type":"array","title":"Pack Ids"}},"type":"object","required":["pack_ids"],"title":"MyEntitlementsResponse"},"NativePushListOut":{"properties":{"tokens":{"items":{"$ref":"#/components/schemas/NativePushTokenOut"},"type":"array","title":"Tokens"},"apns_enabled":{"type":"boolean","title":"Apns Enabled"},"fcm_enabled":{"type":"boolean","title":"Fcm Enabled"}},"type":"object","required":["tokens","apns_enabled","fcm_enabled"],"title":"NativePushListOut"},"NativePushRegisterIn":{"properties":{"platform":{"type":"string","enum":["ios","android"],"title":"Platform"},"token":{"type":"string","maxLength":4096,"minLength":1,"title":"Token"},"bundle_id":{"type":"string","maxLength":255,"minLength":1,"title":"Bundle Id"},"device_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Device Id"},"user_agent":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"title":"User Agent"},"device_kind":{"type":"string","enum":["phone","watch"],"title":"Device Kind","default":"phone"}},"type":"object","required":["platform","token","bundle_id"],"title":"NativePushRegisterIn"},"NativePushTestOut":{"properties":{"sent":{"type":"integer","title":"Sent"},"failed":{"type":"integer","title":"Failed"}},"type":"object","required":["sent","failed"],"title":"NativePushTestOut"},"NativePushTokenOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"platform":{"type":"string","enum":["ios","android"],"title":"Platform"},"device_kind":{"type":"string","enum":["phone","watch"],"title":"Device Kind","default":"phone"},"bundle_id":{"type":"string","title":"Bundle Id"},"device_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Device Id"},"user_agent":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Agent"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"last_success_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Success At"},"last_failure_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Failure At"},"failure_count":{"type":"integer","title":"Failure Count"},"disabled_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Disabled At"},"last_failure_class":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Failure Class"},"last_failure_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Failure Reason"}},"type":"object","required":["id","platform","bundle_id","device_id","user_agent","created_at","last_success_at","last_failure_at","failure_count","disabled_at"],"title":"NativePushTokenOut"},"OAuthAppleIn":{"properties":{"identity_token":{"type":"string","maxLength":8192,"minLength":1,"title":"Identity Token"},"display_name":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Display Name"}},"type":"object","required":["identity_token"],"title":"OAuthAppleIn"},"OAuthGoogleIn":{"properties":{"id_token":{"type":"string","maxLength":8192,"minLength":1,"title":"Id Token"},"display_name":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Display Name"}},"type":"object","required":["id_token"],"title":"OAuthGoogleIn"},"PairingApproveIn":{"properties":{"code":{"type":"string","maxLength":6,"minLength":6,"title":"Code"},"device_name":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Device Name"},"device_type":{"anyOf":[{"type":"string","enum":["kiosk","web","mobile","other"]},{"type":"null"}],"title":"Device Type"}},"type":"object","required":["code"],"title":"PairingApproveIn","description":"Body for `POST /api/pairing/approve`. Auth required (JWT only)."},"PairingClientInfo":{"properties":{"screen_w":{"anyOf":[{"type":"integer","maximum":20000.0,"minimum":0.0},{"type":"null"}],"title":"Screen W"},"screen_h":{"anyOf":[{"type":"integer","maximum":20000.0,"minimum":0.0},{"type":"null"}],"title":"Screen H"},"locale":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Locale"},"timezone":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Timezone"},"spa_build":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Spa Build"}},"additionalProperties":false,"type":"object","title":"PairingClientInfo","description":"Cycle 432 — the SPA's bounded self-report at pairing: what the\nserver cannot determine itself. Scalars only, every one optional; the\naddress and the user agent are NEVER here (server-derived)."},"PairingPollOut":{"properties":{"status":{"type":"string","enum":["pending","approved","consumed","expired","revoked"],"title":"Status"},"device_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Device Token"},"device_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Device Id"}},"type":"object","required":["status"],"title":"PairingPollOut","description":"Body for `GET /api/pairing/poll/{pairing_id}`.\n\nOn the first poll after approval, `device_token` and `device_id`\nare populated and the row's status flips to `consumed` server-side.\nSubsequent polls return `consumed` with both fields omitted."},"PairingRequestIn":{"properties":{"requested_device_name":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Requested Device Name"},"requested_device_type":{"anyOf":[{"type":"string","enum":["kiosk","web","mobile","other"]},{"type":"null"}],"title":"Requested Device Type"},"client_device_id":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Client Device Id"},"client_info":{"anyOf":[{"$ref":"#/components/schemas/PairingClientInfo"},{"type":"null"}]}},"type":"object","title":"PairingRequestIn","description":"Body for `POST /api/pairing/request`. No auth — the whole point\nis that the kiosk has no credentials yet."},"PairingRequestOut":{"properties":{"pairing_id":{"type":"string","format":"uuid","title":"Pairing Id"},"code":{"type":"string","title":"Code"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"},"poll_interval_seconds":{"type":"integer","title":"Poll Interval Seconds","default":2},"poll_bound_seconds":{"type":"integer","title":"Poll Bound Seconds","default":1800}},"type":"object","required":["pairing_id","code","expires_at"],"title":"PairingRequestOut"},"PasskeyAuthBeginIn":{"properties":{"email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Email"}},"type":"object","title":"PasskeyAuthBeginIn"},"PasskeyAuthFinishIn":{"properties":{"challenge_id":{"type":"string","format":"uuid","title":"Challenge Id"},"credential":{"additionalProperties":true,"type":"object","title":"Credential"}},"type":"object","required":["challenge_id","credential"],"title":"PasskeyAuthFinishIn"},"PasskeyCredentialOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Used At"}},"type":"object","required":["id","created_at"],"title":"PasskeyCredentialOut"},"PasskeyOptionsOut":{"properties":{"challenge_id":{"type":"string","format":"uuid","title":"Challenge Id"},"options":{"additionalProperties":true,"type":"object","title":"Options"}},"type":"object","required":["challenge_id","options"],"title":"PasskeyOptionsOut","description":"A WebAuthn ceremony's server half: the single-use challenge row id\nplus the browser-ready options JSON (PublicKeyCredentialCreation/\nRequestOptions in WebAuthn JSON encoding)."},"PasskeyRegisterFinishIn":{"properties":{"challenge_id":{"type":"string","format":"uuid","title":"Challenge Id"},"credential":{"additionalProperties":true,"type":"object","title":"Credential"},"label":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Label"}},"type":"object","required":["challenge_id","credential"],"title":"PasskeyRegisterFinishIn"},"PhotoEstimateOut":{"properties":{"items":{"items":{"$ref":"#/components/schemas/PhotoItem"},"type":"array","title":"Items"},"total_carbs_g":{"type":"number","minimum":0.0,"title":"Total Carbs G"},"confidence":{"type":"string","enum":["high","medium","low"],"title":"Confidence"},"notes":{"anyOf":[{"type":"string","maxLength":400},{"type":"null"}],"title":"Notes"},"model":{"type":"string","title":"Model"},"request_id":{"type":"string","format":"uuid","title":"Request Id"}},"type":"object","required":["items","total_carbs_g","confidence","model","request_id"],"title":"PhotoEstimateOut","description":"Response for `POST /api/photo/estimate_carbs`.\n\n`total_carbs_g` MUST equal the sum of `items[*].carbs_g`. The\nservice patches it on the server side if the model returns\ninconsistent numbers (logged as a WARN) — the wire is always\nconsistent."},"PhotoItem":{"properties":{"name":{"type":"string","maxLength":120,"minLength":1,"title":"Name"},"portion":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}],"title":"Portion"},"carbs_g":{"type":"number","minimum":0.0,"title":"Carbs G"}},"type":"object","required":["name","carbs_g"],"title":"PhotoItem"},"PredictionAcknowledgeAllResponse":{"properties":{"acknowledged":{"type":"integer","title":"Acknowledged"}},"type":"object","required":["acknowledged"],"title":"PredictionAcknowledgeAllResponse"},"PredictionHistoryResponse":{"properties":{"count":{"type":"integer","title":"Count"},"predictions":{"items":{"$ref":"#/components/schemas/PredictionOut"},"type":"array","title":"Predictions"}},"type":"object","required":["count","predictions"],"title":"PredictionHistoryResponse"},"PredictionLevelStats":{"properties":{"count":{"type":"integer","title":"Count","default":0},"confirmed":{"type":"integer","title":"Confirmed","default":0},"false_positive":{"type":"integer","title":"False Positive","default":0},"superseded":{"type":"integer","title":"Superseded","default":0},"hit_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Hit Rate"}},"type":"object","title":"PredictionLevelStats"},"PredictionOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"member_id":{"type":"string","format":"uuid","title":"Member Id"},"reading_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Reading Id"},"predicted_level":{"type":"string","title":"Predicted Level"},"predicted_at":{"type":"string","format":"date-time","title":"Predicted At"},"horizon_minutes":{"type":"integer","title":"Horizon Minutes"},"predicted_sgv":{"type":"integer","title":"Predicted Sgv"},"slope_mgdl_per_min":{"type":"number","title":"Slope Mgdl Per Min"},"slope_r_squared":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Slope R Squared"},"fired_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Fired At"},"acknowledged_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Acknowledged At"},"outcome":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Outcome"},"outcome_evaluated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Outcome Evaluated At"},"outcome_reading_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Outcome Reading Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","member_id","predicted_level","predicted_at","horizon_minutes","predicted_sgv","slope_mgdl_per_min","created_at"],"title":"PredictionOut","description":"Full prediction row — used for history, ack responses, and the\nWS `prediction` frame payload."},"PredictionStatsResponse":{"properties":{"window_days":{"type":"integer","title":"Window Days"},"total_predictions":{"type":"integer","title":"Total Predictions"},"by_level":{"additionalProperties":{"$ref":"#/components/schemas/PredictionLevelStats"},"type":"object","title":"By Level"},"lead_time_seconds":{"$ref":"#/components/schemas/LeadTimeStats"},"pending":{"type":"integer","title":"Pending"}},"type":"object","required":["window_days","total_predictions","by_level","lead_time_seconds","pending"],"title":"PredictionStatsResponse"},"PreorderCheckoutIn":{"properties":{"sku":{"type":"string","enum":["mini","plus"],"title":"Sku"},"quantity":{"type":"integer","maximum":5.0,"minimum":1.0,"title":"Quantity","default":1},"service_tier":{"type":"string","enum":["core","household"],"title":"Service Tier"},"care_plan":{"type":"boolean","title":"Care Plan","default":false},"terms_version":{"type":"string","maxLength":64,"minLength":1,"pattern":"^[A-Za-z0-9._-]+$","title":"Terms Version"},"terms_accepted_at":{"type":"string","format":"date-time","title":"Terms Accepted At"},"shipping_quote":{"anyOf":[{"type":"string","maxLength":4096},{"type":"null"}],"title":"Shipping Quote"},"shipping_service":{"anyOf":[{"type":"string","enum":["ground","two_day","overnight"]},{"type":"null"}],"title":"Shipping Service"}},"type":"object","required":["sku","service_tier","terms_version","terms_accepted_at"],"title":"PreorderCheckoutIn","description":"What the preorder button sends. Nothing else is read.\n\nThe two `terms_*` fields are REQUIRED, so a request that never ran the\nacknowledgment gate is refused here before any Stripe session exists.\nThe checkbox in the page is a UX affordance; this is the control.\n\n⚠ THEY ARE VALIDATED FOR SHAPE, NOT MATCHED AGAINST AN ALLOWLIST.\nPinning `terms_version` to a server-side constant would couple the\nCloudflare Pages upload and the Fly deploy into one ordered operation:\npublish a new policy version first and every checkout 422s until the\nAPI catches up -- a self-inflicted outage on the checkout path. The\ncharset below is deliberately free of HTML metacharacters, so the\nvalue can never carry markup into any surface that renders it.\n\n⚠ `terms_accepted_at` PROVES THE GATE RAN; IT IS NOT THE STORED TIME.\nThe server stamps its own clock for the persisted value. A browser\nclock is attacker-controlled, and skewed even when it is honest."},"PreorderCheckoutOut":{"properties":{"checkout_url":{"type":"string","title":"Checkout Url"}},"type":"object","required":["checkout_url"],"title":"PreorderCheckoutOut","description":"Where to send the browser next — and nothing more.\n\nDeliberately does NOT return the session id, the order id, the order\nnumber or the amount. The browser needs one URL to redirect to; every\nother fact about the order is reachable only after Stripe confirms\npayment, through the session lookup below."},"PreorderConsentOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"order_number":{"type":"string","title":"Order Number"},"status":{"type":"string","title":"Status"},"sku":{"type":"string","title":"Sku"},"quantity":{"type":"integer","title":"Quantity"},"service_tier":{"type":"string","title":"Service Tier"},"amount_total_cents":{"type":"integer","title":"Amount Total Cents"},"currency":{"type":"string","title":"Currency"},"email":{"type":"string","title":"Email"},"shipping_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Shipping Name"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"terms_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Terms Version"},"terms_accepted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Terms Accepted At"}},"type":"object","required":["id","order_number","status","sku","quantity","service_tier","amount_total_cents","currency","email","shipping_name","phone","created_at","terms_version","terms_accepted_at"],"title":"PreorderConsentOut","description":"One order, as an operator needs to see it.\n\n⚠ CARRIES PII (email, name, address) BY NECESSITY — this is the\nfulfilment view, and it sits behind `require_admin`, which 404s a\nnon-admin so the surface is indistinguishable from \"route does not\nexist\". Nothing here is logged."},"PreorderListOut":{"properties":{"orders":{"items":{"$ref":"#/components/schemas/PreorderConsentOut"},"type":"array","title":"Orders"},"total":{"type":"integer","title":"Total"},"missing_consent":{"type":"integer","title":"Missing Consent"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["orders","total","missing_consent","limit","offset"],"title":"PreorderListOut"},"PreorderSessionOut":{"properties":{"order_number":{"type":"string","title":"Order Number"},"sku":{"type":"string","enum":["mini","plus"],"title":"Sku"},"quantity":{"type":"integer","title":"Quantity"},"amount_total_cents":{"type":"integer","title":"Amount Total Cents"},"currency":{"type":"string","title":"Currency"},"ship_date":{"type":"string","title":"Ship Date"},"care_plan":{"type":"boolean","title":"Care Plan","default":false}},"type":"object","required":["order_number","sku","quantity","amount_total_cents","currency","ship_date"],"title":"PreorderSessionOut","description":"The receipt shown on thank-you.html. Paid orders only."},"ProvidersOut":{"properties":{"google":{"type":"boolean","title":"Google"},"apple":{"type":"boolean","title":"Apple"},"passkey":{"type":"boolean","title":"Passkey"},"google_client_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Google Client Id"},"apple_client_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Apple Client Id"},"rp_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rp Id"},"invite_only":{"type":"boolean","title":"Invite Only","default":false}},"type":"object","required":["google","apple","passkey"],"title":"ProvidersOut","description":"Which sign-in methods the server is configured for. The client\nIDs are PUBLIC identifiers (they ship in every OAuth web page) — the\nSPA needs them to initialize the Google/Apple JS SDKs; the first\nconfigured ID is the web one by convention. `rp_id` lets the SPA\nshow the passkey button only on origins the RP actually covers."},"PushKeysIn":{"properties":{"p256dh":{"type":"string","maxLength":512,"minLength":1,"title":"P256Dh"},"auth":{"type":"string","maxLength":256,"minLength":1,"title":"Auth"}},"type":"object","required":["p256dh","auth"],"title":"PushKeysIn","description":"The `keys` block from `pushManager.subscribe().toJSON()`."},"PushSubscribeIn":{"properties":{"endpoint":{"type":"string","maxLength":2048,"minLength":1,"title":"Endpoint"},"keys":{"$ref":"#/components/schemas/PushKeysIn"},"user_agent":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"title":"User Agent"},"device_id":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Device Id"}},"type":"object","required":["endpoint","keys"],"title":"PushSubscribeIn","description":"Body for `POST /api/push/subscriptions`."},"PushSubscriptionListOut":{"properties":{"subscriptions":{"items":{"$ref":"#/components/schemas/PushSubscriptionOut"},"type":"array","title":"Subscriptions"},"vapid_public_key":{"type":"string","title":"Vapid Public Key"}},"type":"object","required":["subscriptions","vapid_public_key"],"title":"PushSubscriptionListOut","description":"List response — also carries the VAPID public key so a Settings\nre-render can fetch list + key in one call."},"PushSubscriptionOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"endpoint":{"type":"string","title":"Endpoint"},"user_agent":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Agent"},"device_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Device Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"last_success_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Success At"},"last_failure_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Failure At"},"failure_count":{"type":"integer","title":"Failure Count"},"disabled_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Disabled At"}},"type":"object","required":["id","endpoint","user_agent","device_id","created_at","last_success_at","last_failure_at","failure_count","disabled_at"],"title":"PushSubscriptionOut","description":"Per-row response for the user's push subscriptions."},"PushTestOut":{"properties":{"sent":{"type":"integer","title":"Sent"},"failed":{"type":"integer","title":"Failed"}},"type":"object","required":["sent","failed"],"title":"PushTestOut"},"PushVapidOut":{"properties":{"vapid_public_key":{"type":"string","title":"Vapid Public Key"}},"type":"object","required":["vapid_public_key"],"title":"PushVapidOut","description":"Standalone response for the initial subscribe handshake."},"RefreshRequest":{"properties":{"refresh_token":{"type":"string","title":"Refresh Token"}},"type":"object","required":["refresh_token"],"title":"RefreshRequest"},"RegisterRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"password":{"type":"string","maxLength":128,"minLength":8,"title":"Password"},"display_name":{"type":"string","maxLength":100,"minLength":1,"title":"Display Name"}},"type":"object","required":["email","password","display_name"],"title":"RegisterRequest"},"RegisterResponse":{"properties":{"user":{"$ref":"#/components/schemas/UserResponse"},"tokens":{"$ref":"#/components/schemas/TokenResponse"}},"type":"object","required":["user","tokens"],"title":"RegisterResponse"},"ReminderCreate":{"properties":{"message":{"type":"string","maxLength":500,"minLength":1,"title":"Message"},"time_of_day":{"type":"string","maxLength":5,"minLength":4,"title":"Time Of Day"},"timezone":{"type":"string","maxLength":64,"minLength":1,"title":"Timezone"},"weekdays":{"items":{"type":"string","enum":["mon","tue","wed","thu","fri","sat","sun"]},"type":"array","title":"Weekdays"},"one_off_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"One Off Date"},"member_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Member Id"},"enabled":{"type":"boolean","title":"Enabled","default":true}},"type":"object","required":["message","time_of_day","timezone"],"title":"ReminderCreate"},"ReminderOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"user_id":{"type":"string","format":"uuid","title":"User Id"},"member_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Member Id"},"member_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Member Name"},"message":{"type":"string","title":"Message"},"time_of_day":{"type":"string","title":"Time Of Day"},"timezone":{"type":"string","title":"Timezone"},"weekdays":{"items":{"type":"string","enum":["mon","tue","wed","thu","fri","sat","sun"]},"type":"array","title":"Weekdays"},"one_off_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"One Off Date"},"enabled":{"type":"boolean","title":"Enabled"},"last_fired_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Fired At"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","user_id","member_id","member_name","message","time_of_day","timezone","weekdays","one_off_date","enabled","last_fired_at","created_at"],"title":"ReminderOut"},"ReminderSnoozeRequest":{"properties":{"duration_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Seconds"}},"type":"object","title":"ReminderSnoozeRequest"},"ReminderSnoozeResponse":{"properties":{"snooze_until_ms":{"type":"integer","title":"Snooze Until Ms"}},"type":"object","required":["snooze_until_ms"],"title":"ReminderSnoozeResponse"},"ReminderUpdate":{"properties":{"message":{"anyOf":[{"type":"string","maxLength":500,"minLength":1},{"type":"null"}],"title":"Message"},"time_of_day":{"anyOf":[{"type":"string","maxLength":5,"minLength":4},{"type":"null"}],"title":"Time Of Day"},"timezone":{"anyOf":[{"type":"string","maxLength":64,"minLength":1},{"type":"null"}],"title":"Timezone"},"weekdays":{"anyOf":[{"items":{"type":"string","enum":["mon","tue","wed","thu","fri","sat","sun"]},"type":"array"},{"type":"null"}],"title":"Weekdays"},"one_off_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"One Off Date"},"member_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Member Id"},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"}},"type":"object","title":"ReminderUpdate","description":"Partial update for PATCH /api/reminders/{id}.\n\nEmpty patch → 422 (matches TreatmentUpdate). Setting non-empty\n`weekdays` switches the reminder to recurring (clears one_off_date);\nsetting `one_off_date` switches it to one-off (clears days_mask). The\nroute owns that mutually-exclusive application; the schema only\nrejects a patch that sets BOTH in the same body."},"ReorderContactsIn":{"properties":{"ordered_ids":{"items":{"type":"string","format":"uuid"},"type":"array","minItems":1,"title":"Ordered Ids"}},"type":"object","required":["ordered_ids"],"title":"ReorderContactsIn","description":"Cycle 128: rewrite `call_order` to match the array position."},"ResetPasswordRequest":{"properties":{"token":{"type":"string","minLength":1,"title":"Token"},"new_password":{"type":"string","maxLength":128,"minLength":8,"title":"New Password"}},"type":"object","required":["token","new_password"],"title":"ResetPasswordRequest","description":"Cycle 95: public reset consume. Same strength rules as register."},"SelfRevokeIn":{"properties":{"push_tokens":{"anyOf":[{"items":{"type":"string","maxLength":4096,"minLength":1},"type":"array","maxItems":32},{"type":"null"}],"title":"Push Tokens"}},"additionalProperties":false,"type":"object","title":"SelfRevokeIn","description":"Cycle 471 — a kiosk's EXPLICIT sign-out revokes its OWN device token.\n\n⚠ NO `device_id` FIELD, DELIBERATELY. The subject is the CALLING device,\nresolved from the `dt_` credential by the route (the `/self/*` posture of\ncycle 200): a device can only ever revoke itself, so there is no row to\nname and no IDOR surface. `push_tokens` names the FCM / APNs tokens this\ninstall remembers registering (`sugalarm.lastPushToken` plus the cycle-470\nhistory) so they are released with the row; the server also deletes every\npush row linked to the device by `device_id`, so an empty list is a valid\nbody. Bounded like `DeviceReleaseIn` (32). `extra=\"forbid\"`."},"SelfRevokeOut":{"properties":{"revoked":{"type":"boolean","title":"Revoked"},"push_tokens_released":{"type":"integer","title":"Push Tokens Released"}},"type":"object","required":["revoked","push_tokens_released"],"title":"SelfRevokeOut","description":"What the self-revoke did: whether a live token was cleared, and how\nmany push rows went with it. Counts only — never a token."},"SensorPauseIn":{"properties":{"reason":{"type":"string","enum":["sensor_change","away"],"title":"Reason"},"duration_minutes":{"anyOf":[{"type":"integer","maximum":100000.0,"minimum":1.0},{"type":"null"}],"title":"Duration Minutes"}},"additionalProperties":false,"type":"object","required":["reason"],"title":"SensorPauseIn","description":"Cycle 354 — POST /api/members/{id}/sensor_pause body. The server\nowns the clock: `duration_minutes` is optional and CLAMPED per reason\n(sensor_change ≤3h, away ≤24h) — there is no permanent hold."},"SensorPauseSettings":{"properties":{"reason":{"type":"string","enum":["sensor_change","away"],"title":"Reason"},"until":{"type":"string","format":"date-time","title":"Until"},"set_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Set By"}},"additionalProperties":false,"type":"object","required":["reason","until"],"title":"SensorPauseSettings","description":"Cycle 354 — an active sensor-pause hold: the household declared the\nmember's feed is EXPECTEDLY dark (changing the sensor / away), so the\ncycle-353 blackout pages stand down until `until`. Bounded by\nconstruction (the write endpoint clamps durations; there is no\npermanent hold) and it gates ONLY the blackout push rail — glucose\nalarms never consult it. `set_by` is the acknowledging user (audit)."},"SetAdminRequest":{"properties":{"is_admin":{"type":"boolean","title":"Is Admin"}},"type":"object","required":["is_admin"],"title":"SetAdminRequest"},"ShippingOptionOut":{"properties":{"service":{"type":"string","enum":["ground","two_day","overnight"],"title":"Service"},"label":{"type":"string","title":"Label"},"amount_cents":{"type":"integer","title":"Amount Cents"},"days_min":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Days Min"},"days_max":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Days Max"},"carrier":{"type":"string","title":"Carrier","default":""}},"type":"object","required":["service","label","amount_cents"],"title":"ShippingOptionOut"},"ShippingQuoteIn":{"properties":{"sku":{"type":"string","enum":["mini","plus"],"title":"Sku"},"quantity":{"type":"integer","maximum":5.0,"minimum":1.0,"title":"Quantity","default":1},"zip":{"type":"string","pattern":"^[0-9]{5}$","title":"Zip"}},"type":"object","required":["sku","zip"],"title":"ShippingQuoteIn","description":"Cycle 517: what the page sends to get live rates. A 5-digit US ZIP."},"ShippingQuoteOut":{"properties":{"quote":{"type":"string","title":"Quote"},"options":{"items":{"$ref":"#/components/schemas/ShippingOptionOut"},"type":"array","title":"Options"}},"type":"object","required":["quote","options"],"title":"ShippingQuoteOut","description":"The choices to show and the signed quote to send back at checkout."},"SmsTestOut":{"properties":{"sent":{"type":"boolean","title":"Sent"}},"type":"object","required":["sent"],"title":"SmsTestOut"},"SpeakIn":{"properties":{"text":{"type":"string","maxLength":2000,"minLength":1,"title":"Text"},"voice":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Voice"},"purpose":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Purpose"}},"type":"object","required":["text"],"title":"SpeakIn"},"StartDrillIn":{"properties":{"member_id":{"type":"string","format":"uuid","title":"Member Id"},"scenario":{"type":"string","title":"Scenario"}},"type":"object","required":["member_id","scenario"],"title":"StartDrillIn"},"SyncRequest":{"properties":{"readings":{"anyOf":[{"items":{"$ref":"#/components/schemas/CannedReading"},"type":"array"},{"type":"null"}],"title":"Readings"}},"type":"object","title":"SyncRequest","description":"Optional body for /api/glucose/sync. Same semantics as cycle 5."},"SyncTriggerResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"rows_inserted":{"type":"integer","title":"Rows Inserted"},"message":{"type":"string","title":"Message"}},"type":"object","required":["success","rows_inserted","message"],"title":"SyncTriggerResponse"},"TIRBuckets":{"properties":{"urgent_low_pct":{"type":"number","title":"Urgent Low Pct","default":0.0},"low_pct":{"type":"number","title":"Low Pct","default":0.0},"in_range_pct":{"type":"number","title":"In Range Pct","default":0.0},"high_pct":{"type":"number","title":"High Pct","default":0.0},"urgent_high_pct":{"type":"number","title":"Urgent High Pct","default":0.0}},"type":"object","title":"TIRBuckets","description":"Time-in-range percentages (0–100) across five buckets.\n\nThe buckets partition the sgv axis using the user's effective\n`urgent_low` / `target_low` / `target_high` / `urgent_high`. When at\nleast one reading falls in the window, the values sum to exactly\n100.0 (rounding drift is corrected on the largest bucket). When the\nwindow has zero readings every bucket is 0.0."},"ThemePackCreateIn":{"properties":{"name":{"type":"string","maxLength":120,"minLength":1,"title":"Name"},"category":{"type":"string","maxLength":64,"minLength":1,"title":"Category"},"is_free":{"type":"boolean","title":"Is Free","default":false},"price_cents":{"anyOf":[{"type":"integer","maximum":10000000.0,"minimum":0.0},{"type":"null"}],"title":"Price Cents"},"currency":{"type":"string","maxLength":8,"title":"Currency","default":"usd"},"published":{"type":"boolean","title":"Published","default":false},"preset_ids":{"items":{"type":"string"},"type":"array","maxItems":64,"title":"Preset Ids"}},"type":"object","required":["name","category"],"title":"ThemePackCreateIn"},"ThemePackOut":{"properties":{"pack_id":{"type":"string","title":"Pack Id"},"title":{"type":"string","title":"Title"},"description":{"type":"string","title":"Description"},"price_display":{"type":"string","title":"Price Display"},"is_free":{"type":"boolean","title":"Is Free"},"preset_ids":{"items":{"type":"string"},"type":"array","title":"Preset Ids"},"owned":{"type":"boolean","title":"Owned"},"image_presets":{"items":{"$ref":"#/components/schemas/ImagePresetOut"},"type":"array","title":"Image Presets","default":[]}},"type":"object","required":["pack_id","title","description","price_display","is_free","preset_ids","owned"],"title":"ThemePackOut"},"ThemePackOwnerOut":{"properties":{"user_id":{"type":"string","title":"User Id"},"email":{"type":"string","title":"Email"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"source":{"type":"string","title":"Source"},"granted_at":{"type":"string","format":"date-time","title":"Granted At"}},"type":"object","required":["user_id","email","source","granted_at"],"title":"ThemePackOwnerOut","description":"Cycle 191: one account that owns a pack (an `entitlements` row joined\nto `users`), for the admin Ownership panel. Admin-visible account fields\nonly — never logged."},"ThemePackOwnersResponse":{"properties":{"owners":{"items":{"$ref":"#/components/schemas/ThemePackOwnerOut"},"type":"array","title":"Owners"}},"type":"object","required":["owners"],"title":"ThemePackOwnersResponse"},"ThemePackPublishIn":{"properties":{"published":{"type":"boolean","title":"Published"}},"type":"object","required":["published"],"title":"ThemePackPublishIn"},"ThemePackUpdateIn":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":120,"minLength":1},{"type":"null"}],"title":"Name"},"category":{"anyOf":[{"type":"string","maxLength":64,"minLength":1},{"type":"null"}],"title":"Category"},"is_free":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Free"},"price_cents":{"anyOf":[{"type":"integer","maximum":10000000.0,"minimum":0.0},{"type":"null"}],"title":"Price Cents"},"currency":{"anyOf":[{"type":"string","maxLength":8},{"type":"null"}],"title":"Currency"},"published":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Published"},"sort_order":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Sort Order"},"preset_ids":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":64},{"type":"null"}],"title":"Preset Ids"}},"type":"object","title":"ThemePackUpdateIn","description":"All fields optional — only supplied fields are changed. When\n`preset_ids` is present the membership is replaced atomically."},"ThemePacksResponse":{"properties":{"packs":{"items":{"$ref":"#/components/schemas/ThemePackOut"},"type":"array","title":"Packs"}},"type":"object","required":["packs"],"title":"ThemePacksResponse"},"TokenResponse":{"properties":{"access_token":{"type":"string","title":"Access Token"},"refresh_token":{"type":"string","title":"Refresh Token"},"token_type":{"type":"string","title":"Token Type","default":"bearer"},"expires_in":{"type":"integer","title":"Expires In"}},"type":"object","required":["access_token","refresh_token","expires_in"],"title":"TokenResponse"},"TreatingByOut":{"properties":{"hero_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hero Id"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"avatar_preset":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar Preset"},"source":{"type":"string","title":"Source"},"at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"At"},"avatar_photo":{"anyOf":[{"$ref":"#/components/schemas/TreatingByPhotoOut"},{"type":"null"}]}},"type":"object","required":["source"],"title":"TreatingByOut","description":"Cycle 456: who took a treating window (see `AlertOut.treating_by`)."},"TreatingByPhotoOut":{"properties":{"url":{"type":"string","title":"Url"},"v":{"type":"string","title":"V"}},"type":"object","required":["url","v"],"title":"TreatingByPhotoOut","description":"Cycle 457: the attributed hero's photo (authenticated path + `v`)."},"TreatmentCreate":{"properties":{"event_type":{"type":"string","enum":["carbs","insulin","bg_check","note","exercise"],"title":"Event Type"},"timestamp":{"type":"string","format":"date-time","title":"Timestamp"},"carbs_g":{"anyOf":[{"type":"number","ge":0,"le":999999.99},{"type":"null"}],"title":"Carbs G"},"insulin_u":{"anyOf":[{"type":"number","gt":0,"le":999999.99},{"type":"null"}],"title":"Insulin U"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"entered_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entered By"},"provenance":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Provenance"},"insulin_kind":{"type":"string","enum":["bolus","basal"],"title":"Insulin Kind","default":"bolus"},"insulin_duration_min":{"anyOf":[{"type":"integer","maximum":2147483647.0,"exclusiveMinimum":0.0},{"type":"null"}],"title":"Insulin Duration Min"},"insulin_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Insulin Label"},"dose_intent":{"anyOf":[{"type":"string","enum":["meal","correction"]},{"type":"null"}],"title":"Dose Intent"}},"type":"object","required":["event_type","timestamp"],"title":"TreatmentCreate"},"TreatmentHistoryResponse":{"properties":{"count":{"type":"integer","title":"Count"},"treatments":{"items":{"$ref":"#/components/schemas/TreatmentOut"},"type":"array","title":"Treatments"}},"type":"object","required":["count","treatments"],"title":"TreatmentHistoryResponse"},"TreatmentOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"member_id":{"type":"string","format":"uuid","title":"Member Id"},"user_id":{"type":"string","format":"uuid","title":"User Id"},"event_type":{"type":"string","title":"Event Type"},"timestamp":{"type":"string","format":"date-time","title":"Timestamp"},"carbs_g":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Carbs G"},"insulin_u":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Insulin U"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"entered_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entered By"},"provenance":{"additionalProperties":true,"type":"object","title":"Provenance"},"insulin_kind":{"type":"string","title":"Insulin Kind","default":"bolus"},"insulin_duration_min":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Insulin Duration Min"},"insulin_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Insulin Label"},"dose_intent":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dose Intent"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","member_id","user_id","event_type","timestamp","created_at"],"title":"TreatmentOut"},"TreatmentUpdate":{"properties":{"event_type":{"anyOf":[{"type":"string","enum":["carbs","insulin","bg_check","note","exercise"]},{"type":"null"}],"title":"Event Type"},"timestamp":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Timestamp"},"carbs_g":{"anyOf":[{"type":"number","ge":0,"le":999999.99},{"type":"null"}],"title":"Carbs G"},"insulin_u":{"anyOf":[{"type":"number","gt":0,"le":999999.99},{"type":"null"}],"title":"Insulin U"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"entered_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entered By"},"provenance":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Provenance"},"insulin_kind":{"anyOf":[{"type":"string","enum":["bolus","basal"]},{"type":"null"}],"title":"Insulin Kind"},"insulin_duration_min":{"anyOf":[{"type":"integer","maximum":2147483647.0,"exclusiveMinimum":0.0},{"type":"null"}],"title":"Insulin Duration Min"},"insulin_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Insulin Label"},"dose_intent":{"anyOf":[{"type":"string","enum":["meal","correction"]},{"type":"null"}],"title":"Dose Intent"}},"type":"object","title":"TreatmentUpdate","description":"Cycle 34.20 — partial update for `PATCH /api/treatments/{id}`.\n\nEvery field is optional; unset fields stay untouched. Sentinel\nhandling matches Pydantic's `model_fields_set` so an explicit\n`null` payload clears the column (used by the edit-meal UI when\nthe user blanks the notes field)."},"TriggerIn":{"properties":{"level":{"type":"string","enum":["high","urgent_high","low","urgent_low","normal"],"title":"Level"}},"additionalProperties":false,"type":"object","required":["level"],"title":"TriggerIn"},"UserResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"email":{"type":"string","title":"Email"},"display_name":{"type":"string","title":"Display Name"},"cgm_provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cgm Provider"},"settings":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Settings"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"last_login":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Login"},"owner_key":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Owner Key"}},"type":"object","required":["id","email","display_name","created_at"],"title":"UserResponse"},"UserSettingsOut":{"properties":{"units":{"type":"string","enum":["mg/dL","mmol/L"],"title":"Units","default":"mg/dL"},"target_low":{"type":"integer","maximum":400.0,"minimum":20.0,"title":"Target Low","default":70},"target_high":{"type":"integer","maximum":400.0,"minimum":20.0,"title":"Target High","default":180},"urgent_low":{"type":"integer","maximum":400.0,"minimum":20.0,"title":"Urgent Low","default":55},"urgent_high":{"type":"integer","maximum":600.0,"minimum":20.0,"title":"Urgent High","default":250},"alerts_enabled":{"type":"boolean","title":"Alerts Enabled","default":true},"alarm_repeat_enabled":{"type":"boolean","title":"Alarm Repeat Enabled","default":true},"alarm_repeat_interval_seconds":{"type":"integer","maximum":1800.0,"minimum":120.0,"title":"Alarm Repeat Interval Seconds","default":300},"display_24h":{"type":"boolean","title":"Display 24H","default":true},"display_dark_mode":{"type":"boolean","title":"Display Dark Mode","default":true},"iob_meal_color":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Iob Meal Color"},"iob_correction_color":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Iob Correction Color"},"iob_basal_color":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Iob Basal Color"},"iob_card_dismissed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Iob Card Dismissed At"},"display_theme":{"type":"string","enum":["midnight","deep-sea","evergreen","twilight","slate","lagoon"],"title":"Display Theme","default":"midnight"},"display_background_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Display Background Id"},"display_mobile_background":{"type":"string","title":"Display Mobile Background","default":"aurora"},"nav_position":{"type":"string","enum":["bottom","side"],"title":"Nav Position","default":"side"},"prediction_enabled":{"type":"boolean","title":"Prediction Enabled","default":true},"prediction_horizon_minutes":{"type":"integer","maximum":30.0,"minimum":5.0,"title":"Prediction Horizon Minutes","default":10},"prediction_min_slope_abs":{"type":"number","exclusiveMinimum":0.0,"title":"Prediction Min Slope Abs","default":1.0},"prediction_min_r_squared":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Prediction Min R Squared","default":0.7},"tts_voice":{"type":"string","maxLength":64,"minLength":1,"title":"Tts Voice","default":"XrExE9yKIg1WjnnlVkGX"},"tts_announce_interval_minutes":{"type":"integer","maximum":60.0,"minimum":0.0,"title":"Tts Announce Interval Minutes","default":0},"tts_quiet_hours_enabled":{"type":"boolean","title":"Tts Quiet Hours Enabled","default":true},"tts_quiet_hours_start":{"type":"string","title":"Tts Quiet Hours Start","default":"22:00"},"tts_quiet_hours_end":{"type":"string","title":"Tts Quiet Hours End","default":"07:00"},"alarm_clock":{"$ref":"#/components/schemas/AlarmClockSettings"},"sensor_pause":{"anyOf":[{"$ref":"#/components/schemas/SensorPauseSettings"},{"type":"null"}]},"alarm_sound_urgent_low":{"type":"string","title":"Alarm Sound Urgent Low","default":"default"},"alarm_sound_low":{"type":"string","title":"Alarm Sound Low","default":"default"},"alarm_sound_inrange":{"type":"string","title":"Alarm Sound Inrange","default":"default"},"alarm_sound_high":{"type":"string","title":"Alarm Sound High","default":"default"},"alarm_sound_urgent_high":{"type":"string","title":"Alarm Sound Urgent High","default":"default"},"recovery_advisory":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recovery Advisory"},"glance_reminder_off":{"type":"boolean","title":"Glance Reminder Off","default":false},"glance_reminder_dismissed_gaps":{"items":{"type":"string"},"type":"array","title":"Glance Reminder Dismissed Gaps"}},"type":"object","title":"UserSettingsOut","description":"The settings WIRE shape — `UserSettings` plus anything the server\nwants to say about them.\n\n⚠ A RESPONSE MODEL, NEVER A STORED ONE. `UserSettings` is what\n`_materialize_settings` round-trips into `members.settings`; putting a\ncomputed field on it would persist the advisory into the JSONB and then\nread it back as configuration. This subclass exists so the wire can\ncarry it and storage cannot.\n\nAdditive and nullable, so a client that booted before the deploy\ndeserialises cleanly."},"UserSettingsPatch":{"properties":{"units":{"anyOf":[{"type":"string","enum":["mg/dL","mmol/L"]},{"type":"null"}],"title":"Units"},"target_low":{"anyOf":[{"type":"integer","maximum":400.0,"minimum":20.0},{"type":"null"}],"title":"Target Low"},"target_high":{"anyOf":[{"type":"integer","maximum":400.0,"minimum":20.0},{"type":"null"}],"title":"Target High"},"urgent_low":{"anyOf":[{"type":"integer","maximum":400.0,"minimum":20.0},{"type":"null"}],"title":"Urgent Low"},"urgent_high":{"anyOf":[{"type":"integer","maximum":600.0,"minimum":20.0},{"type":"null"}],"title":"Urgent High"},"alerts_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Alerts Enabled"},"alarm_repeat_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Alarm Repeat Enabled"},"alarm_repeat_interval_seconds":{"anyOf":[{"type":"integer","maximum":1800.0,"minimum":120.0},{"type":"null"}],"title":"Alarm Repeat Interval Seconds"},"display_24h":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Display 24H"},"display_dark_mode":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Display Dark Mode"},"iob_meal_color":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Iob Meal Color"},"iob_correction_color":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Iob Correction Color"},"iob_basal_color":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Iob Basal Color"},"iob_card_dismissed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Iob Card Dismissed At"},"display_theme":{"anyOf":[{"type":"string","enum":["midnight","deep-sea","evergreen","twilight","slate","lagoon"]},{"type":"null"}],"title":"Display Theme"},"display_background_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Display Background Id"},"display_mobile_background":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Mobile Background"},"nav_position":{"anyOf":[{"type":"string","enum":["bottom","side"]},{"type":"null"}],"title":"Nav Position"},"prediction_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Prediction Enabled"},"prediction_horizon_minutes":{"anyOf":[{"type":"integer","maximum":30.0,"minimum":5.0},{"type":"null"}],"title":"Prediction Horizon Minutes"},"prediction_min_slope_abs":{"anyOf":[{"type":"number","exclusiveMinimum":0.0},{"type":"null"}],"title":"Prediction Min Slope Abs"},"prediction_min_r_squared":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Prediction Min R Squared"},"tts_voice":{"anyOf":[{"type":"string","maxLength":64,"minLength":1},{"type":"null"}],"title":"Tts Voice"},"tts_announce_interval_minutes":{"anyOf":[{"type":"integer","maximum":60.0,"minimum":0.0},{"type":"null"}],"title":"Tts Announce Interval Minutes"},"tts_quiet_hours_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Tts Quiet Hours Enabled"},"tts_quiet_hours_start":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tts Quiet Hours Start"},"tts_quiet_hours_end":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tts Quiet Hours End"},"alarm_clock":{"anyOf":[{"$ref":"#/components/schemas/AlarmClockSettings"},{"type":"null"}]},"alarm_sound_urgent_low":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Alarm Sound Urgent Low"},"alarm_sound_low":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Alarm Sound Low"},"alarm_sound_inrange":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Alarm Sound Inrange"},"alarm_sound_high":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Alarm Sound High"},"alarm_sound_urgent_high":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Alarm Sound Urgent High"},"glance_reminder_off":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Glance Reminder Off"},"glance_reminder_dismissed_gaps":{"anyOf":[{"items":{"type":"string","enum":["live_activities_off","no_widget"]},"type":"array","maxItems":4},{"type":"null"}],"title":"Glance Reminder Dismissed Gaps"}},"additionalProperties":false,"type":"object","title":"UserSettingsPatch","description":"Partial update — every field optional. Cross-field validation runs\non the *merged* result inside the service, not on the patch itself."},"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"},"VeracityEventIn":{"properties":{"kind":{"type":"string","pattern":"^(abort|rewrite_recovery|rewrite_stale|suppress_synthetic|suppress_resume|suppress_quiet_hours|cue|wake|audio_started|prime|pagehide|reload)$","title":"Kind"},"surface":{"type":"string","pattern":"^[a-z0-9_.-]{1,32}$","title":"Surface"},"template_classification":{"anyOf":[{"type":"string","pattern":"^[a-z_]{1,16}$"},{"type":"null"}],"title":"Template Classification"},"context_classification":{"anyOf":[{"type":"string","pattern":"^[a-z_]{1,16}$"},{"type":"null"}],"title":"Context Classification"},"cue_kind":{"anyOf":[{"type":"string","pattern":"^[a-z_]{1,16}$"},{"type":"null"}],"title":"Cue Kind"},"outcome":{"anyOf":[{"type":"string","pattern":"^[a-z_]{1,16}$"},{"type":"null"}],"title":"Outcome"},"in_settle":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"In Settle"},"ms_since_resume":{"anyOf":[{"type":"integer","maximum":86400000.0,"minimum":0.0},{"type":"null"}],"title":"Ms Since Resume"},"reason":{"anyOf":[{"type":"string","pattern":"^[a-z_]{1,16}$"},{"type":"null"}],"title":"Reason"},"ended_by":{"anyOf":[{"type":"string","pattern":"^[a-z_]{1,16}$"},{"type":"null"}],"title":"Ended By"},"hidden_ms":{"anyOf":[{"type":"integer","maximum":604800000.0,"minimum":0.0},{"type":"null"}],"title":"Hidden Ms"},"freeze":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Freeze"},"settle_ms":{"anyOf":[{"type":"integer","maximum":600000.0,"minimum":0.0},{"type":"null"}],"title":"Settle Ms"},"muted":{"anyOf":[{"type":"string","pattern":"^(muted|unmuted)$"},{"type":"null"}],"title":"Muted"},"visibility":{"anyOf":[{"type":"string","pattern":"^(visible|hidden|prerender|unknown)$"},{"type":"null"}],"title":"Visibility"},"cue_requested":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Cue Requested"},"ms_since_cue":{"anyOf":[{"type":"integer","maximum":604800000.0,"minimum":0.0},{"type":"null"}],"title":"Ms Since Cue"},"ms_since_load":{"anyOf":[{"type":"integer","maximum":604800000.0,"minimum":0.0},{"type":"null"}],"title":"Ms Since Load"},"ms_since_touch":{"anyOf":[{"type":"integer","maximum":604800000.0,"minimum":0.0},{"type":"null"}],"title":"Ms Since Touch"},"ms_since_hidden":{"anyOf":[{"type":"integer","maximum":604800000.0,"minimum":0.0},{"type":"null"}],"title":"Ms Since Hidden"},"repeats":{"anyOf":[{"type":"integer","maximum":10000.0,"minimum":0.0},{"type":"null"}],"title":"Repeats"},"repeats_pending":{"anyOf":[{"type":"integer","maximum":10000.0,"minimum":0.0},{"type":"null"}],"title":"Repeats Pending"},"primed":{"anyOf":[{"type":"integer","maximum":32.0,"minimum":0.0},{"type":"null"}],"title":"Primed"},"settled":{"anyOf":[{"type":"integer","maximum":32.0,"minimum":0.0},{"type":"null"}],"title":"Settled"},"pending":{"anyOf":[{"type":"integer","maximum":32.0,"minimum":0.0},{"type":"null"}],"title":"Pending"},"persisted":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Persisted"},"ms_to_fresh_reading":{"anyOf":[{"type":"integer","maximum":600000.0,"minimum":0.0},{"type":"null"}],"title":"Ms To Fresh Reading"},"no_data_shown_during_settle":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"No Data Shown During Settle"},"resume_fetch_outcome":{"anyOf":[{"type":"string","pattern":"^(fresh|stale|empty|failed|timeout|pending|none)$"},{"type":"null"}],"title":"Resume Fetch Outcome"},"error_name":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9_$]{1,40}$"},{"type":"null"}],"title":"Error Name"},"stack_hash":{"anyOf":[{"type":"string","pattern":"^[0-9a-f]{8}$"},{"type":"null"}],"title":"Stack Hash"}},"type":"object","required":["kind","surface"],"title":"VeracityEventIn"},"VerifyIn":{"properties":{"email":{"type":"string","maxLength":320,"minLength":1,"title":"Email"},"code":{"type":"string","maxLength":16,"minLength":1,"title":"Code"}},"type":"object","required":["email","code"],"title":"VerifyIn"},"VerifyStartOut":{"properties":{"sent":{"type":"boolean","title":"Sent"},"cooldown_seconds":{"type":"integer","title":"Cooldown Seconds"}},"type":"object","required":["sent","cooldown_seconds"],"title":"VerifyStartOut"},"VoiceInfo":{"properties":{"voice_id":{"type":"string","title":"Voice Id","examples":["XrExE9yKIg1WjnnlVkGX"]},"name":{"type":"string","title":"Name","examples":["Matilda"]},"friendly_name":{"type":"string","title":"Friendly Name","description":"Humanised label rendered in the voice picker.","examples":["Matilda"]}},"type":"object","required":["voice_id","name","friendly_name"],"title":"VoiceInfo","description":"A single voice option exposed to the frontend."},"VoiceListOut":{"properties":{"voices":{"items":{"$ref":"#/components/schemas/VoiceInfo"},"type":"array","title":"Voices"},"default_voice":{"type":"string","title":"Default Voice"}},"type":"object","required":["voices","default_voice"],"title":"VoiceListOut","description":"Response for `GET /api/tts/voices`."},"VoiceTestOut":{"properties":{"placed":{"type":"boolean","title":"Placed"}},"type":"object","required":["placed"],"title":"VoiceTestOut"},"WidgetGlucoseSnapshot":{"properties":{"signed_in":{"type":"boolean","title":"Signed In"},"mgdl":{"type":"integer","title":"Mgdl"},"trend":{"type":"string","title":"Trend"},"delta":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Delta"},"iob_u":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Iob U"},"zone":{"type":"string","title":"Zone"},"stale":{"type":"boolean","title":"Stale"},"signal_lost":{"type":"boolean","title":"Signal Lost"},"ts":{"type":"integer","title":"Ts"},"member_name":{"type":"string","title":"Member Name"},"member_id":{"type":"string","title":"Member Id"},"units":{"type":"string","title":"Units"},"recent":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Recent"},"iob_rings":{"anyOf":[{"$ref":"#/components/schemas/WidgetIobRings"},{"type":"null"}]},"owner_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Owner Key"}},"type":"object","required":["signed_in","mgdl","trend","zone","stale","signal_lost","ts","member_name","member_id","units"],"title":"WidgetGlucoseSnapshot","description":"Mirrors `mobile/ios/App/SugalarmWidgets/GlucoseWidgetSnapshot.swift`\n(the widget's `Codable`), so the widget decodes the response directly.\n\nCycle 270 adds the optional `iob_rings` field consumed by the Apple\nWatch glance; every existing consumer ignores the new key."},"WidgetIobRing":{"properties":{"kind":{"type":"string","title":"Kind"},"units":{"type":"number","title":"Units"},"remaining_frac":{"type":"number","title":"Remaining Frac"},"remaining_seconds":{"type":"integer","title":"Remaining Seconds"},"due":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Due"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"}},"type":"object","required":["kind","units","remaining_frac","remaining_seconds"],"title":"WidgetIobRing","description":"One concentric IOB ring (cycle 270, watch part 1). `kind` selects\nthe ring color natively on the watch; `remaining_frac` drives the arc\nand `remaining_seconds` the decay countdown. Derived server-side from\nthe same source as `iob_u` / the phone `BolusRings` — the watch never\nre-derives IOB math."},"WidgetIobRings":{"properties":{"total_u":{"type":"number","title":"Total U"},"rapid":{"items":{"$ref":"#/components/schemas/WidgetIobRing"},"type":"array","title":"Rapid"},"basal":{"anyOf":[{"$ref":"#/components/schemas/WidgetIobRing"},{"type":"null"}]}},"type":"object","required":["total_u","rapid"],"title":"WidgetIobRings","description":"The IOB Dual Circular Display Timer ring state. Present only when\ninsulin is actually on board; absent/None otherwise so the watch hides\nthe rings entirely. Additive + optional — existing snapshot consumers\n(the iOS home-screen widget, the Live Activity tile) ignore it."},"WifiSetupIn":{"properties":{"device_owner":{"type":"boolean","title":"Device Owner"},"perms_ok":{"type":"boolean","title":"Perms Ok"},"location_on":{"type":"boolean","title":"Location On"},"wifi_on":{"type":"boolean","title":"Wifi On"},"can_scan":{"type":"boolean","title":"Can Scan"},"join_path":{"type":"string","enum":["device_owner","add_networks_dialog","suggestion","system_panel","none"],"title":"Join Path"}},"additionalProperties":false,"type":"object","required":["device_owner","perms_ok","location_on","wifi_on","can_scan","join_path"],"title":"WifiSetupIn","description":"Exactly the six contract keys; strict booleans; no extras. Never an\nSSID, BSSID or location — scan data is location data."},"_BroadcastTarget":{"properties":{"user_ids":{"anyOf":[{"items":{"type":"string","format":"uuid"},"type":"array"},{"type":"null"}],"title":"User Ids"},"member_ids":{"anyOf":[{"items":{"type":"string","format":"uuid"},"type":"array"},{"type":"null"}],"title":"Member Ids"}},"type":"object","title":"_BroadcastTarget"}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}}}