{"openapi":"3.1.0","info":{"title":"WearLink API","description":"\nWearLink wearable-data API.\n\n## Authentication\n\nWearLink uses **two-tier authentication**, and the right credential depends\non what you're trying to do:\n\n| Header / scheme                      | Path                | Can do                                                       |\n|--------------------------------------|---------------------|--------------------------------------------------------------|\n| `X-WearLink-API-Key: sk-...`         | Server-to-server    | Read user data, ingest manual nutrition, manage connections. |\n| `app_id` + `app_secret` in body      | Mint user tokens    | `POST /users/{id}/token`, then act as that user via SDK.     |\n| `Authorization: Bearer <jwt>`        | Dashboard / admin   | Everything an API key can do, plus mint user tokens.         |\n\nA common stumble: `POST /users/{id}/token` rejects a plain\n`X-WearLink-API-Key` because key-scope is data-only. To mint per-user SDK\ntokens you must either pass `app_id` + `app_secret` in the body, or\nauthenticate with the dashboard JWT.\n\n`GET /setup-status` returns one screen showing which tier you're on\n(`api_key_scope`), whether app credentials are registered\n(`app_credentials_present`), which providers are wired up\n(`providers_configured` / `providers_pending` / `providers_native`), and\nwhich webhook endpoints are receiving events. Hit it after any onboarding\nstep to confirm the next dependency is in place.\n\n## Provider connect flow\n\n`GET /oauth/providers` returns every provider with these flags:\n\n* `is_enabled`      — admin master switch.\n* `is_configured`   — true iff client_id + client_secret are loaded for OAuth providers.\n* `is_oauth_flow`   — false for native-SDK providers (Apple HealthKit, Samsung Health, Google Health Connect).\n* `oauth_ready`     — convenience: `is_enabled && is_configured && is_oauth_flow`.\n\nPass `?ready_only=true` when rendering a Connect button list — it filters\nout coming-soon providers and on-device-only paths in one go.\n","version":"0.1.0"},"paths":{"/":{"get":{"summary":"Root","operationId":"root__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Root  Get"}}}}}}},"/api/v1/users":{"get":{"tags":["External: Users"],"summary":"List Users","description":"List the users owned by the authenticated developer.\n\nSync `def` (not `async def`) so FastAPI runs the sync DB query in a\nthread-pool worker rather than blocking the event loop — this endpoint\nis a hot dashboard call.","operationId":"list_users_api_v1_users_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number (1-based)","default":1,"title":"Page"},"description":"Page number (1-based)"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Number of results per page","default":20,"title":"Limit"},"description":"Number of results per page"},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"enum":["created_at","email","first_name","last_name","last_synced_at"],"type":"string"},{"type":"null"}],"description":"Field to sort by","default":"created_at","title":"Sort By"},"description":"Field to sort by"},{"name":"sort_order","in":"query","required":false,"schema":{"enum":["asc","desc"],"type":"string","description":"Sort order","default":"desc","title":"Sort Order"},"description":"Sort order"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search across first_name, last_name, and email (partial match)","title":"Search"},"description":"Search across first_name, last_name, and email (partial match)"},{"name":"email","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by exact email","title":"Email"},"description":"Filter by exact email"},{"name":"external_user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by external user ID. Deprecated: no data-fetching endpoint (timeseries, workouts, sleep, summaries, health-scores, etc.) accepts external_user_id - they all require the WearLink UUID. This field was added early in the project but never wired into those endpoints, so it only works as a filter on GET /users. Store the UUID returned by POST /users in your own system instead.","deprecated":true,"title":"External User Id"},"description":"Filter by external user ID. Deprecated: no data-fetching endpoint (timeseries, workouts, sleep, summaries, health-scores, etc.) accepts external_user_id - they all require the WearLink UUID. This field was added early in the project but never wired into those endpoints, so it only works as a filter on GET /users. Store the UUID returned by POST /users in your own system instead.","deprecated":true},{"name":"X-WearLink-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Wearlink-Api-Key"}},{"name":"X-HealthChain-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Healthchain-Api-Key"}},{"name":"X-Open-Wearables-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Open-Wearables-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OldPaginatedResponse_UserRead_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["External: Users"],"summary":"Create User","operationId":"create_user_api_v1_users_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"X-WearLink-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Wearlink-Api-Key"}},{"name":"X-HealthChain-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Healthchain-Api-Key"}},{"name":"X-Open-Wearables-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Open-Wearables-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/users/{user_id}":{"get":{"tags":["External: Users"],"summary":"Get User","operationId":"get_user_api_v1_users__user_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}},{"name":"X-WearLink-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Wearlink-Api-Key"}},{"name":"X-HealthChain-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Healthchain-Api-Key"}},{"name":"X-Open-Wearables-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Open-Wearables-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserRead"}}}},"401":{"description":"Authentication required","content":{"application/json":{"example":{"detail":"Authentication required: provide JWT token or API key"}}}},"404":{"description":"User not found","content":{"application/json":{"example":{"detail":"User with ID: 123e4567-e89b-12d3-a456-426614174000 not found."}}}},"400":{"description":"Validation error","content":{"application/json":{"example":{"detail":"Input should be a valid UUID"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["External: Users"],"summary":"Delete User","operationId":"delete_user_api_v1_users__user_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}},{"name":"X-WearLink-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Wearlink-Api-Key"}},{"name":"X-HealthChain-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Healthchain-Api-Key"}},{"name":"X-Open-Wearables-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Open-Wearables-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["External: Users"],"summary":"Update User","operationId":"update_user_api_v1_users__user_id__patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}},{"name":"X-WearLink-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Wearlink-Api-Key"}},{"name":"X-HealthChain-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Healthchain-Api-Key"}},{"name":"X-Open-Wearables-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Open-Wearables-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/users/{user_id}/energy_balance":{"get":{"tags":["External: Users"],"summary":"Daily calories-in (nutrition) vs calories-out (wearable) for the user.","operationId":"get_energy_balance_api_v1_users__user_id__energy_balance_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}},{"name":"date_from","in":"query","required":true,"schema":{"type":"string","format":"date","description":"Inclusive lower bound (UTC date).","title":"Date From"},"description":"Inclusive lower bound (UTC date)."},{"name":"date_to","in":"query","required":true,"schema":{"type":"string","format":"date","description":"Inclusive upper bound (UTC date).","title":"Date To"},"description":"Inclusive upper bound (UTC date)."},{"name":"X-WearLink-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Wearlink-Api-Key"}},{"name":"X-HealthChain-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Healthchain-Api-Key"}},{"name":"X-Open-Wearables-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Open-Wearables-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__schemas__users__energy_balance__EnergyBalanceResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/nutrition/log/image":{"post":{"tags":["External: Nutrition"],"summary":"Upload Meal Image","operationId":"upload_meal_image_api_v1_nutrition_log_image_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"query","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}},{"name":"X-WearLink-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Wearlink-Api-Key"}},{"name":"X-HealthChain-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Healthchain-Api-Key"}},{"name":"X-Open-Wearables-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Open-Wearables-Api-Key"}}],"requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_meal_image_api_v1_nutrition_log_image_post"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NutritionLogImageAccepted"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/nutrition/log/manual":{"post":{"tags":["External: Nutrition"],"summary":"Create Manual Log","operationId":"create_manual_log_api_v1_nutrition_log_manual_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"query","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}},{"name":"X-WearLink-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Wearlink-Api-Key"}},{"name":"X-HealthChain-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Healthchain-Api-Key"}},{"name":"X-Open-Wearables-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Open-Wearables-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NutritionLogCreateManual"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NutritionLogRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/nutrition/log":{"get":{"tags":["External: Nutrition"],"summary":"List Logs","operationId":"list_logs_api_v1_nutrition_log_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Date From"}},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Date To"}},{"name":"meal_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Meal Type"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"user_id","in":"query","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}},{"name":"X-WearLink-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Wearlink-Api-Key"}},{"name":"X-HealthChain-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Healthchain-Api-Key"}},{"name":"X-Open-Wearables-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Open-Wearables-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/NutritionLogRead"},"title":"Response List Logs Api V1 Nutrition Log Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/nutrition/log/{log_id}":{"get":{"tags":["External: Nutrition"],"summary":"Get Log","operationId":"get_log_api_v1_nutrition_log__log_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"log_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Log Id"}},{"name":"user_id","in":"query","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}},{"name":"X-WearLink-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Wearlink-Api-Key"}},{"name":"X-HealthChain-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Healthchain-Api-Key"}},{"name":"X-Open-Wearables-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Open-Wearables-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NutritionLogRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["External: Nutrition"],"summary":"Soft Delete Log","operationId":"soft_delete_log_api_v1_nutrition_log__log_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"log_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Log Id"}},{"name":"user_id","in":"query","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}},{"name":"X-WearLink-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Wearlink-Api-Key"}},{"name":"X-HealthChain-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Healthchain-Api-Key"}},{"name":"X-Open-Wearables-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Open-Wearables-Api-Key"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/nutrition/log/{log_id}/items/{item_id}":{"patch":{"tags":["External: Nutrition"],"summary":"Patch Item","operationId":"patch_item_api_v1_nutrition_log__log_id__items__item_id__patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"log_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Log Id"}},{"name":"item_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Item Id"}},{"name":"user_id","in":"query","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}},{"name":"X-WearLink-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Wearlink-Api-Key"}},{"name":"X-HealthChain-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Healthchain-Api-Key"}},{"name":"X-Open-Wearables-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Open-Wearables-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NutritionLogItemPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NutritionLogItemRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/nutrition/summary":{"get":{"tags":["External: Nutrition"],"summary":"Get Summary","operationId":"get_summary_api_v1_nutrition_summary_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"date_from","in":"query","required":true,"schema":{"type":"string","format":"date","title":"Date From"}},{"name":"date_to","in":"query","required":true,"schema":{"type":"string","format":"date","title":"Date To"}},{"name":"user_id","in":"query","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}},{"name":"X-WearLink-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Wearlink-Api-Key"}},{"name":"X-HealthChain-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Healthchain-Api-Key"}},{"name":"X-Open-Wearables-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Open-Wearables-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NutritionSummaryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/nutrition/admin/accuracy_metrics":{"get":{"tags":["External: Nutrition"],"summary":"Admin Accuracy Metrics","description":"Operations dashboard: pipeline accuracy at a glance.\n\nDrives the next seed iteration — top dishes that the pipeline failed to\nresolve to ``food_db`` are the ones to add to the IFCT_REGIONAL list,\nand dishes with high correction-rates are the ones with bad seed values.","operationId":"admin_accuracy_metrics_api_v1_nutrition_admin_accuracy_metrics_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":92,"minimum":1,"default":7,"title":"Days"}},{"name":"user_id","in":"query","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}},{"name":"X-WearLink-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Wearlink-Api-Key"}},{"name":"X-HealthChain-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Healthchain-Api-Key"}},{"name":"X-Open-Wearables-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Open-Wearables-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/users/{user_id}/energy-balance":{"get":{"tags":["External: Nutrition"],"summary":"Get Energy Balance","description":"Return per-day kcal-in / kcal-out / net for the last ``days`` UTC days.","operationId":"get_energy_balance_api_v1_users__user_id__energy_balance_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":31,"minimum":1,"default":7,"title":"Days"}},{"name":"X-WearLink-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Wearlink-Api-Key"}},{"name":"X-HealthChain-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Healthchain-Api-Key"}},{"name":"X-Open-Wearables-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Open-Wearables-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api__routes__v1__energy_balance__EnergyBalanceResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/users/{user_id}/connections":{"get":{"tags":["External: Connections"],"summary":"Get Connections Endpoint","description":"Get all connections for a user, enriched with provider capability metadata.","operationId":"get_connections_endpoint_api_v1_users__user_id__connections_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}},{"name":"X-WearLink-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Wearlink-Api-Key"}},{"name":"X-HealthChain-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Healthchain-Api-Key"}},{"name":"X-Open-Wearables-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Open-Wearables-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/UserConnectionWithCapabilities"},"title":"Response Get Connections Endpoint Api V1 Users  User Id  Connections Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/users/{user_id}/connections/{provider}":{"delete":{"tags":["External: Connections"],"summary":"Disconnect Provider Endpoint","description":"Disconnect a user from a provider, revoking the connection and clearing tokens.","operationId":"disconnect_provider_endpoint_api_v1_users__user_id__connections__provider__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"provider","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ProviderName"}},{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}},{"name":"X-WearLink-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Wearlink-Api-Key"}},{"name":"X-HealthChain-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Healthchain-Api-Key"}},{"name":"X-Open-Wearables-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Open-Wearables-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/users/{user_id}/connections/{provider}/revoke":{"post":{"tags":["External: Connections"],"summary":"Revoke Provider Endpoint","description":"Alias for DELETE /connections/{provider}.\n\nThe HealthChain iOS app calls POST .../revoke; we accept it so the\niOS revoke flow doesn't 404 (which previously left the local connection\nin a stuck state and caused disconnect/reconnect loops).","operationId":"revoke_provider_endpoint_api_v1_users__user_id__connections__provider__revoke_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"provider","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ProviderName"}},{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}},{"name":"X-WearLink-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Wearlink-Api-Key"}},{"name":"X-HealthChain-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Healthchain-Api-Key"}},{"name":"X-Open-Wearables-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Open-Wearables-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/diagnose/{provider}":{"get":{"tags":["External: Connections"],"summary":"Diagnose Provider","description":"Diagnose why a provider connection isn't flowing data.\n\nReturns a structured snapshot:\n  - is OAuth env populated for this provider\n  - is there a user_connection row, and what's its status\n  - is there a recent token-refresh failure\n  - are recent sync tasks succeeding\n\nDesigned for the Fitbit \"iOS says connected but WearLink reports zero\nconnections\" class of bug. Per-tenant + per-user scoped.","operationId":"diagnose_provider_api_v1_diagnose__provider__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"provider","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ProviderName"}},{"name":"user_id","in":"query","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}},{"name":"X-WearLink-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Wearlink-Api-Key"}},{"name":"X-HealthChain-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Healthchain-Api-Key"}},{"name":"X-Open-Wearables-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Open-Wearables-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/users/{user_id}/summaries/activity":{"get":{"tags":["External: Summaries"],"summary":"Get Activity Summary","description":"Returns daily aggregated activity metrics for a user owned by the caller.","operationId":"get_activity_summary_api_v1_users__user_id__summaries_activity_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}},{"name":"start_date","in":"query","required":true,"schema":{"type":"string","title":"Start Date"}},{"name":"end_date","in":"query","required":true,"schema":{"type":"string","title":"End Date"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":400,"minimum":1,"default":50,"title":"Limit"}},{"name":"sort_order","in":"query","required":false,"schema":{"type":"string","pattern":"^(asc|desc)$","default":"asc","title":"Sort Order"}},{"name":"X-WearLink-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Wearlink-Api-Key"}},{"name":"X-HealthChain-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Healthchain-Api-Key"}},{"name":"X-Open-Wearables-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Open-Wearables-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResponse_ActivitySummary_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/users/{user_id}/summaries/sleep":{"get":{"tags":["External: Summaries"],"summary":"Get Sleep Summary","description":"Returns daily sleep metrics for a user owned by the caller.","operationId":"get_sleep_summary_api_v1_users__user_id__summaries_sleep_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}},{"name":"start_date","in":"query","required":true,"schema":{"type":"string","title":"Start Date"}},{"name":"end_date","in":"query","required":true,"schema":{"type":"string","title":"End Date"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}},{"name":"X-WearLink-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Wearlink-Api-Key"}},{"name":"X-HealthChain-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Healthchain-Api-Key"}},{"name":"X-Open-Wearables-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Open-Wearables-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResponse_SleepSummary_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/users/{user_id}/summaries/recovery":{"get":{"tags":["External: Summaries"],"summary":"Get Recovery Summary","description":"Returns daily recovery metrics (Sleep + HRV + RHR).","operationId":"get_recovery_summary_api_v1_users__user_id__summaries_recovery_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}},{"name":"start_date","in":"query","required":true,"schema":{"type":"string","title":"Start Date"}},{"name":"end_date","in":"query","required":true,"schema":{"type":"string","title":"End Date"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}},{"name":"X-WearLink-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Wearlink-Api-Key"}},{"name":"X-HealthChain-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Healthchain-Api-Key"}},{"name":"X-Open-Wearables-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Open-Wearables-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResponse_RecoverySummary_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/users/{user_id}/summaries/body":{"get":{"tags":["External: Summaries"],"summary":"Get Body Summary","description":"Returns comprehensive body metrics with semantic grouping.\n\nResponse is organized into three categories:\n- **static**: Slow-changing values (weight, height, body fat, muscle mass, BMI, age)\n  Returns the most recent recorded value for each field.\n- **averaged**: Vitals averaged over a period (resting HR, HRV)\n  Period is configurable via `average_period` parameter (1-7 days).\n- **latest**: Point-in-time readings (body temperature, blood pressure)\n  Only returned if measured within `latest_window_hours` (default 4 hours).\n\nReturns null if no body data exists for the user.","operationId":"get_body_summary_api_v1_users__user_id__summaries_body_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}},{"name":"average_period","in":"query","required":false,"schema":{"type":"integer","maximum":7,"minimum":1,"description":"Days to average vitals (1-7)","default":7,"title":"Average Period"},"description":"Days to average vitals (1-7)"},{"name":"latest_window_hours","in":"query","required":false,"schema":{"type":"integer","maximum":24,"minimum":1,"description":"Hours for latest readings to be considered valid (1-24)","default":4,"title":"Latest Window Hours"},"description":"Hours for latest readings to be considered valid (1-24)"},{"name":"X-WearLink-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Wearlink-Api-Key"}},{"name":"X-HealthChain-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Healthchain-Api-Key"}},{"name":"X-Open-Wearables-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Open-Wearables-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/BodySummary"},{"type":"null"}],"title":"Response Get Body Summary Api V1 Users  User Id  Summaries Body Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/users/{user_id}/summaries/data":{"get":{"tags":["External: Summaries"],"summary":"Get Data Summary","description":"Returns per-user data counts grouped by series type, event type, and provider.","operationId":"get_data_summary_api_v1_users__user_id__summaries_data_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}},{"name":"X-WearLink-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Wearlink-Api-Key"}},{"name":"X-HealthChain-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Healthchain-Api-Key"}},{"name":"X-Open-Wearables-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Open-Wearables-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserDataSummaryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/users/{user_id}/timeseries":{"get":{"tags":["External: Timeseries"],"summary":"Get Timeseries","description":"Returns granular time series data (biometrics or activity) for a user owned by the caller.\n\nDate params: ``start_time``/``end_time`` (canonical) or ``start_date``/``end_date``\n(alias matching every other endpoint). Either pair is accepted. Both as ISO 8601\nor Unix-seconds. ``start_*`` and ``end_*`` are required (no default window —\ncallers must specify intent to avoid accidental full-history scans).","operationId":"get_timeseries_api_v1_users__user_id__timeseries_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}},{"name":"start_time","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Time"}},{"name":"end_time","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Time"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Date"}},{"name":"types","in":"query","required":false,"schema":{"type":"array","items":{"$ref":"#/components/schemas/SeriesType"},"default":[],"title":"Types"}},{"name":"resolution","in":"query","required":false,"schema":{"enum":["raw","1min","5min","15min","1hour"],"type":"string","default":"raw","title":"Resolution"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}},{"name":"X-WearLink-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Wearlink-Api-Key"}},{"name":"X-HealthChain-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Healthchain-Api-Key"}},{"name":"X-Open-Wearables-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Open-Wearables-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResponse_TimeSeriesSample_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/users/{user_id}/events/workouts":{"get":{"tags":["External: Events"],"summary":"List Workouts","description":"Returns workout sessions for a user owned by the caller.","operationId":"list_workouts_api_v1_users__user_id__events_workouts_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}},{"name":"start_date","in":"query","required":true,"schema":{"type":"string","title":"Start Date"}},{"name":"end_date","in":"query","required":true,"schema":{"type":"string","title":"End Date"}},{"name":"record_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Record Type"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}},{"name":"X-WearLink-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Wearlink-Api-Key"}},{"name":"X-HealthChain-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Healthchain-Api-Key"}},{"name":"X-Open-Wearables-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Open-Wearables-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResponse_Workout_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/users/{user_id}/events/sleep":{"get":{"tags":["External: Events"],"summary":"List Sleep Sessions","description":"Returns sleep sessions (including naps) for a user owned by the caller.","operationId":"list_sleep_sessions_api_v1_users__user_id__events_sleep_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}},{"name":"start_date","in":"query","required":true,"schema":{"type":"string","title":"Start Date"}},{"name":"end_date","in":"query","required":true,"schema":{"type":"string","title":"End Date"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}},{"name":"X-WearLink-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Wearlink-Api-Key"}},{"name":"X-HealthChain-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Healthchain-Api-Key"}},{"name":"X-Open-Wearables-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Open-Wearables-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResponse_SleepSession_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/users/{user_id}/records":{"get":{"tags":["External: Records"],"summary":"List Records","description":"List event records for a user, filtered by category/type/source/date.\n\nBy default returns workout records (matches /workouts). Pass\n``category=sleep`` or ``category=body_metric`` etc. to switch domains.\nStandard pagination via ``limit`` (1-1000, default 50) and ``offset``.","operationId":"list_records_api_v1_users__user_id__records_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"start_datetime","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Start Datetime"}},{"name":"end_datetime","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"End Datetime"}},{"name":"category","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":"workout","title":"Category"}},{"name":"record_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Record Type"}},{"name":"device_model","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Device Model"}},{"name":"source_name","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Name"}},{"name":"source","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"}},{"name":"data_source_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Data Source Id"}},{"name":"min_duration","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Min Duration"}},{"name":"max_duration","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Duration"}},{"name":"sort_by","in":"query","required":false,"schema":{"enum":["start_datetime","end_datetime","duration_seconds","type","source_name"],"type":"string","default":"start_datetime","title":"Sort By"}},{"name":"sort_order","in":"query","required":false,"schema":{"enum":["asc","desc"],"type":"string","default":"desc","title":"Sort Order"}},{"name":"X-WearLink-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Wearlink-Api-Key"}},{"name":"X-HealthChain-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Healthchain-Api-Key"}},{"name":"X-Open-Wearables-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Open-Wearables-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EventRecordResponse"},"title":"Response List Records Api V1 Users  User Id  Records Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/users/{user_id}/health-scores":{"get":{"tags":["External: Health Scores"],"summary":"List Health Scores","description":"Returns health scores (sleep, recovery, readiness, etc.) for a user owned by the caller.","operationId":"list_health_scores_api_v1_users__user_id__health_scores_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Date"}},{"name":"category","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/HealthScoreCategory"},{"type":"null"}],"title":"Category"}},{"name":"provider","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/ProviderName"},{"type":"null"}],"title":"Provider"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"X-WearLink-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Wearlink-Api-Key"}},{"name":"X-HealthChain-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Healthchain-Api-Key"}},{"name":"X-Open-Wearables-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Open-Wearables-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResponse_HealthScoreResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/oauth/{provider}/authorize":{"get":{"tags":["External: Providers"],"summary":"Get Provider Authorization URL","description":"Initiate OAuth flow for a provider.\n\nRequires developer auth (JWT or API key) and that ``user_id`` belongs to\nthe caller's tenant — otherwise the previous unauthenticated handler let\nany caller mint an OAuth state for any user_id, so when the provider\nredirected back the resulting tokens were stamped onto the victim's user.","operationId":"authorize_provider_api_v1_oauth__provider__authorize_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"provider","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ProviderName"}},{"name":"redirect_uri","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional redirect URI after authorization","title":"Redirect Uri"},"description":"Optional redirect URI after authorization"},{"name":"user_id","in":"query","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}},{"name":"X-WearLink-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Wearlink-Api-Key"}},{"name":"X-HealthChain-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Healthchain-Api-Key"}},{"name":"X-Open-Wearables-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Open-Wearables-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthorizationURLResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/oauth/{provider}/callback":{"get":{"tags":["System: OAuth"],"summary":"Oauth Callback","description":"OAuth callback endpoint.\n\nProvider redirects here after user authorizes. Exchanges code for tokens.","operationId":"oauth_callback_api_v1_oauth__provider__callback_get","parameters":[{"name":"provider","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ProviderName"}},{"name":"code","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Authorization code from provider","title":"Code"},"description":"Authorization code from provider"},{"name":"state","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"State parameter for CSRF protection","title":"State"},"description":"State parameter for CSRF protection"},{"name":"error","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},{"name":"error_description","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Description"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/oauth/success":{"get":{"tags":["System: OAuth"],"summary":"Oauth Success","description":"Simple success page after OAuth completion.","operationId":"oauth_success_api_v1_oauth_success_get","parameters":[{"name":"provider","in":"query","required":true,"schema":{"type":"string","title":"Provider"}},{"name":"user_id","in":"query","required":true,"schema":{"type":"string","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Oauth Success Api V1 Oauth Success Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/oauth/error":{"get":{"tags":["System: OAuth"],"summary":"Oauth Error","description":"OAuth error page.","operationId":"oauth_error_api_v1_oauth_error_get","parameters":[{"name":"message","in":"query","required":false,"schema":{"type":"string","default":"OAuth authentication failed","title":"Message"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Oauth Error Api V1 Oauth Error Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/oauth/providers":{"get":{"tags":["External: Providers"],"summary":"Get Providers","description":"Get providers with their configuration and metadata.\n\nQuery params:\n- enabled_only: Filter to only enabled providers (default: False, returns all)\n- cloud_only: Filter to only providers with cloud OAuth API (default: False)\n- ready_only: Filter to only providers ready for OAuth connect (default: False)\n\nReturns full provider details including name, icon_url, has_cloud_api,\nis_enabled, is_configured, is_oauth_flow, and the convenience flag\noauth_ready. Use ``oauth_ready`` to render a 'Connect' button without\nmanually combining the three flags.","operationId":"get_providers_api_v1_oauth_providers_get","parameters":[{"name":"enabled_only","in":"query","required":false,"schema":{"type":"boolean","description":"Return only enabled providers","default":false,"title":"Enabled Only"},"description":"Return only enabled providers"},{"name":"cloud_only","in":"query","required":false,"schema":{"type":"boolean","description":"Return only cloud (OAuth) providers","default":false,"title":"Cloud Only"},"description":"Return only cloud (OAuth) providers"},{"name":"ready_only","in":"query","required":false,"schema":{"type":"boolean","description":"Return only providers that are end-to-end ready for the OAuth redirect flow (is_enabled && is_configured && is_oauth_flow). Use this when rendering a 'Connect' button list — it filters out 'coming soon' providers and on-device-only ones (Apple Health, Samsung Health, Google Health Connect) in one go.","default":false,"title":"Ready Only"},"description":"Return only providers that are end-to-end ready for the OAuth redirect flow (is_enabled && is_configured && is_oauth_flow). Use this when rendering a 'Connect' button list — it filters out 'coming soon' providers and on-device-only ones (Apple Health, Samsung Health, Google Health Connect) in one go."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ProviderSettingRead"},"title":"Response Get Providers Api V1 Oauth Providers Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Internal: Providers"],"summary":"Bulk Update Providers","description":"Bulk update provider settings.\n\nAccepts a map of provider_id -> is_enabled and updates all providers at once.\nThis is the primary endpoint for the admin UI to save checkbox states.","operationId":"bulk_update_providers_api_v1_oauth_providers_put","security":[{"OAuth2PasswordBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkProviderSettingsUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ProviderSettingRead"},"title":"Response Bulk Update Providers Api V1 Oauth Providers Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/oauth/providers/{provider}":{"put":{"tags":["Internal: Providers"],"summary":"Update Provider Status","description":"Update single provider enabled status.","operationId":"update_provider_status_api_v1_oauth_providers__provider__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderSettingUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderSettingRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/providers/{provider}/users/{user_id}/sync":{"post":{"tags":["External: Data Sync"],"summary":"Sync User Data","description":"Synchronize data from fitness provider API for a specific user.\n\n**Data Types:**\n- `workouts`: Workouts/exercises/activities\n- `247`: 24/7 data including sleep, recovery, and activity samples\n- `all`: All available data types\n\n**Provider-specific:**\n- **Suunto**: Supports workouts and 247 data with pagination\n- **Polar**: Supports workouts (exercises) only\n- **Garmin**: Data arrives via webhooks (backfill for 30-day history)\n- **Whoop**: Supports workouts and 247 data (sleep/recovery)\n\n**Execution Mode:**\n- `async=true` (default): Dispatches sync to background Celery worker. Returns immediately with task ID.\n- `async=false`: Executes synchronously (may timeout for large data sets).\n\nRequires valid API key and active connection for the user.","operationId":"sync_user_data_api_v1_providers__provider__users__user_id__sync_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"provider","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ProviderName","description":"Data provider"},"description":"Data provider"},{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}},{"name":"data_type","in":"query","required":false,"schema":{"$ref":"#/components/schemas/SyncDataType","description":"Type of data to sync: workouts, 247 (sleep/recovery/activity), or all","default":"all"},"description":"Type of data to sync: workouts, 247 (sleep/recovery/activity), or all"},{"name":"since","in":"query","required":false,"schema":{"type":"integer","description":"Unix timestamp to synchronize data since (0 = all, Suunto only)","default":0,"title":"Since"},"description":"Unix timestamp to synchronize data since (0 = all, Suunto only)"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"description":"Maximum number of items (Suunto: max 100)","default":50,"title":"Limit"},"description":"Maximum number of items (Suunto: max 100)"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","description":"Offset for pagination (Suunto only)","default":0,"title":"Offset"},"description":"Offset for pagination (Suunto only)"},{"name":"filter_by_modification_time","in":"query","required":false,"schema":{"type":"boolean","description":"Filter by modification time instead of creation time (Suunto only)","default":true,"title":"Filter By Modification Time"},"description":"Filter by modification time instead of creation time (Suunto only)"},{"name":"samples","in":"query","required":false,"schema":{"type":"boolean","description":"Synchronize sample data (Polar only)","default":false,"title":"Samples"},"description":"Synchronize sample data (Polar only)"},{"name":"zones","in":"query","required":false,"schema":{"type":"boolean","description":"Synchronize zones data (Polar only)","default":false,"title":"Zones"},"description":"Synchronize zones data (Polar only)"},{"name":"route","in":"query","required":false,"schema":{"type":"boolean","description":"Synchronize route data (Polar only)","default":false,"title":"Route"},"description":"Synchronize route data (Polar only)"},{"name":"summary_start_time","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Activity start time as Unix timestamp or ISO 8601 date (Garmin only)","title":"Summary Start Time"},"description":"Activity start time as Unix timestamp or ISO 8601 date (Garmin only)"},{"name":"summary_end_time","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Activity end time as Unix timestamp or ISO 8601 date (Garmin only)","title":"Summary End Time"},"description":"Activity end time as Unix timestamp or ISO 8601 date (Garmin only)"},{"name":"async","in":"query","required":false,"schema":{"type":"boolean","description":"Run sync asynchronously via Celery (default: true). Set false for sync.","default":true,"title":"Async"},"description":"Run sync asynchronously via Celery (default: true). Set false for sync."},{"name":"X-WearLink-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Wearlink-Api-Key"}},{"name":"X-HealthChain-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Healthchain-Api-Key"}},{"name":"X-Open-Wearables-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Open-Wearables-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"anyOf":[{"type":"boolean"},{"type":"object","additionalProperties":true},{"type":"string"}]},"title":"Response Sync User Data Api V1 Providers  Provider  Users  User Id  Sync Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/providers/garmin/users/{user_id}/backfill/status":{"get":{"tags":["External: Data Sync"],"summary":"Get Garmin Backfill Status Endpoint","description":"Get Garmin backfill status for backfill data types.\n\nThe backfill is webhook-based and auto-triggered after OAuth connection.\nReturns status for each data type independently. Max 30 days of history.\n\n**Response Fields:**\n- `overall_status`: pending | in_progress | complete | cancelled | retry_in_progress | permanently_failed\n- `current_window`: Current window index (0-based)\n- `total_windows`: Total number of 30-day windows (12)\n- `windows`: Per-window-per-type matrix with done/pending/timed_out/failed states\n- `summary`: Per-type aggregated counts (done, timed_out, failed)\n- `in_progress`: Whether backfill is currently running (true for in_progress or retry_in_progress)\n- `retry_phase`: Whether the retry phase is currently active\n- `retry_type`: Data type currently being retried (null if not retrying)\n- `retry_window`: Window index being retried (null if not retrying)\n- `attempt_count`: Number of GC-and-retry cycles completed\n- `max_attempts`: Maximum GC-and-retry cycles before permanently failed (3)\n- `permanently_failed`: Whether backfill has exhausted all retry attempts\n\n**Window Cell States:**\n- `done`: Data received via webhook or Garmin API error (treated as done)\n- `pending`: Not yet processed\n- `timed_out`: No webhook received within timeout (warning)\n- `failed`: Permanently failed after retry attempt (error)","operationId":"get_garmin_backfill_status_endpoint_api_v1_providers_garmin_users__user_id__backfill_status_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}},{"name":"X-WearLink-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Wearlink-Api-Key"}},{"name":"X-HealthChain-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Healthchain-Api-Key"}},{"name":"X-Open-Wearables-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Open-Wearables-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Garmin Backfill Status Endpoint Api V1 Providers Garmin Users  User Id  Backfill Status Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/providers/garmin/users/{user_id}/backfill/cancel":{"post":{"tags":["External: Data Sync"],"summary":"Cancel Garmin Backfill","description":"Cancel an in-progress Garmin backfill for a user.\n\nSets a cancellation flag in Redis. The backfill will stop after the\ncurrent data type completes processing.\n\nReturns 409 if no backfill is currently in progress.","operationId":"cancel_garmin_backfill_api_v1_providers_garmin_users__user_id__backfill_cancel_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}},{"name":"X-WearLink-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Wearlink-Api-Key"}},{"name":"X-HealthChain-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Healthchain-Api-Key"}},{"name":"X-Open-Wearables-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Open-Wearables-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Cancel Garmin Backfill Api V1 Providers Garmin Users  User Id  Backfill Cancel Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/providers/garmin/users/{user_id}/backfill/{type_name}/retry":{"post":{"tags":["External: Data Sync"],"summary":"Retry Garmin Backfill Type","description":"Retry backfill for a specific data type in the current window.\n\nResets the type status to pending and triggers a new backfill attempt\nfor the current window context. Use when a type has timed out or\nneeds re-processing.\n\n**Valid Type Names:**\nsleeps, dailies, activities, activityDetails, hrv\n\nReturns:\n    Dict with retry status","operationId":"retry_garmin_backfill_type_api_v1_providers_garmin_users__user_id__backfill__type_name__retry_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"type_name","in":"path","required":true,"schema":{"type":"string","title":"Type Name"}},{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}},{"name":"X-WearLink-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Wearlink-Api-Key"}},{"name":"X-HealthChain-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Healthchain-Api-Key"}},{"name":"X-Open-Wearables-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Open-Wearables-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Retry Garmin Backfill Type Api V1 Providers Garmin Users  User Id  Backfill  Type Name  Retry Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/providers/{provider}/users/{user_id}/sync/historical":{"post":{"tags":["External: Data Sync"],"summary":"Sync Historical Data","description":"Trigger a historical sync of the user's data from a connected provider.\n\nEach provider strategy decides how to dispatch the sync (REST polling,\nwebhook backfill, etc.). The ``days`` parameter may be ignored by\nproviders that enforce their own limits.\n\n**Automatic historical sync on connect (grace period)**\n\nv0.4.2 introduced this endpoint as the canonical, opt-in way to\nbackfill historical data - the long-term goal is that connecting a\nprovider only sets up live sync, and history is pulled on demand.\n\nTo make migration painless, the pre-0.4.2 behaviour is kept for now\nbehind a grace-period flag (``HISTORICAL_SYNC_ON_CONNECT``, default:\n``true``): a historical sync is auto-dispatched after a successful\nOAuth callback (up to 90 days for pull-based providers; up to 30\ndays for Garmin, whose webhook-based backfill is capped at 30 days\nfrom the user's consent date).\n\nOnce your integration calls this endpoint explicitly, set\n``HISTORICAL_SYNC_ON_CONNECT=false``. The flag will default to\n``false`` in a future release and is planned for removal afterwards.","operationId":"sync_historical_data_api_v1_providers__provider__users__user_id__sync_historical_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"provider","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ProviderName","description":"Data provider"},"description":"Data provider"},{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":365,"minimum":1,"description":"Days of historical data to fetch (default: 90, max: 365). Ignored for providers with their own limits (e.g. Garmin: 30 days).","default":90,"title":"Days"},"description":"Days of historical data to fetch (default: 90, max: 365). Ignored for providers with their own limits (e.g. Garmin: 30 days)."},{"name":"X-WearLink-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Wearlink-Api-Key"}},{"name":"X-HealthChain-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Healthchain-Api-Key"}},{"name":"X-Open-Wearables-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Open-Wearables-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Sync Historical Data Api V1 Providers  Provider  Users  User Id  Sync Historical Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/providers/{provider}/users/{user_id}/workouts":{"get":{"tags":["System: Vendor Workouts"],"summary":"Get User Workouts","description":"Get workouts/exercises/activities from fitness provider API for a specific user.\n\n- **Suunto**: Returns workouts with pagination support\n- **Polar**: Returns exercises (Polar's term for workouts)\n- **Garmin**: Returns activities from Health API\n\nRequires valid auth and that the user belongs to the caller.","operationId":"get_user_workouts_api_v1_providers__provider__users__user_id__workouts_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"provider","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ProviderName","description":"Workout data provider"},"description":"Workout data provider"},{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}},{"name":"since","in":"query","required":false,"schema":{"type":"integer","description":"Unix timestamp to get workouts since (0 = all, Suunto only)","default":0,"title":"Since"},"description":"Unix timestamp to get workouts since (0 = all, Suunto only)"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"description":"Maximum number of workouts (Suunto: max 100)","default":50,"title":"Limit"},"description":"Maximum number of workouts (Suunto: max 100)"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","description":"Offset for pagination (Suunto only)","default":0,"title":"Offset"},"description":"Offset for pagination (Suunto only)"},{"name":"filter_by_modification_time","in":"query","required":false,"schema":{"type":"boolean","description":"Filter by modification time instead of creation time (Suunto only)","default":true,"title":"Filter By Modification Time"},"description":"Filter by modification time instead of creation time (Suunto only)"},{"name":"samples","in":"query","required":false,"schema":{"type":"boolean","description":"Return sample data (Polar only)","default":false,"title":"Samples"},"description":"Return sample data (Polar only)"},{"name":"zones","in":"query","required":false,"schema":{"type":"boolean","description":"Return zones data (Polar only)","default":false,"title":"Zones"},"description":"Return zones data (Polar only)"},{"name":"route","in":"query","required":false,"schema":{"type":"boolean","description":"Return route data (Polar only)","default":false,"title":"Route"},"description":"Return route data (Polar only)"},{"name":"summary_start_time","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Activity start time as Unix timestamp or ISO 8601 date (Garmin only)","title":"Summary Start Time"},"description":"Activity start time as Unix timestamp or ISO 8601 date (Garmin only)"},{"name":"summary_end_time","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Activity end time as Unix timestamp or ISO 8601 date (Garmin only)","title":"Summary End Time"},"description":"Activity end time as Unix timestamp or ISO 8601 date (Garmin only)"},{"name":"X-WearLink-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Wearlink-Api-Key"}},{"name":"X-HealthChain-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Healthchain-Api-Key"}},{"name":"X-Open-Wearables-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Open-Wearables-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"type":"object","additionalProperties":true},{"type":"array","items":{"type":"object","additionalProperties":true}}],"title":"Response Get User Workouts Api V1 Providers  Provider  Users  User Id  Workouts Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/providers/{provider}/users/{user_id}/workouts/{workout_id}":{"get":{"tags":["System: Vendor Workouts"],"summary":"Get User Workout Detail","description":"Get detailed workout/exercise/activity data from fitness provider API.\n\n- **Suunto**: Returns detailed workout data\n- **Polar**: Returns detailed exercise data\n- **Garmin**: Returns detailed activity data\n\nRequires valid auth and that the user belongs to the caller.","operationId":"get_user_workout_detail_api_v1_providers__provider__users__user_id__workouts__workout_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"provider","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ProviderName","description":"Workout data provider"},"description":"Workout data provider"},{"name":"workout_id","in":"path","required":true,"schema":{"type":"string","title":"Workout Id"}},{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}},{"name":"samples","in":"query","required":false,"schema":{"type":"boolean","description":"Return sample data (Polar only)","default":false,"title":"Samples"},"description":"Return sample data (Polar only)"},{"name":"zones","in":"query","required":false,"schema":{"type":"boolean","description":"Return zones data (Polar only)","default":false,"title":"Zones"},"description":"Return zones data (Polar only)"},{"name":"route","in":"query","required":false,"schema":{"type":"boolean","description":"Return route data (Polar only)","default":false,"title":"Route"},"description":"Return route data (Polar only)"},{"name":"X-WearLink-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Wearlink-Api-Key"}},{"name":"X-HealthChain-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Healthchain-Api-Key"}},{"name":"X-Open-Wearables-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Open-Wearables-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get User Workout Detail Api V1 Providers  Provider  Users  User Id  Workouts  Workout Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/users/{user_id}/import/apple/xml/s3":{"post":{"tags":["External: Apple Health Import"],"summary":"Import Xml Presigned Url","description":"Generate presigned URL for XML file upload and trigger processing task.","operationId":"import_xml_presigned_url_api_v1_users__user_id__import_apple_xml_s3_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}},{"name":"X-WearLink-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Wearlink-Api-Key"}},{"name":"X-HealthChain-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Healthchain-Api-Key"}},{"name":"X-Open-Wearables-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Open-Wearables-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PresignedURLRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PresignedURLResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/users/{user_id}/import/apple/xml/direct":{"post":{"tags":["External: Apple Health Import"],"summary":"Import Xml File","description":"Import XML file into the database, with size + XXE guards.","operationId":"import_xml_file_api_v1_users__user_id__import_apple_xml_direct_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}},{"name":"X-WearLink-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Wearlink-Api-Key"}},{"name":"X-HealthChain-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Healthchain-Api-Key"}},{"name":"X-Open-Wearables-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Open-Wearables-Api-Key"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_import_xml_file_api_v1_users__user_id__import_apple_xml_direct_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Import Xml File Api V1 Users  User Id  Import Apple Xml Direct Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/sns/notification":{"post":{"tags":["External: Apple Health Import"],"summary":"Receive Sns Notification","description":"Handle all SNS messages (subscription confirmation + S3 upload notifications).","operationId":"receive_sns_notification_api_v1_sns_notification_post","responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadDataResponse"}}}}}}},"/api/v1/users/{user_id}/export":{"post":{"tags":["External: Data Export"],"summary":"Export User Data","description":"Return a complete JSON snapshot of the user's data footprint.\n\nOnly available to the developer who owns the user (TenantUserDep).","operationId":"export_user_data_api_v1_users__user_id__export_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}},{"name":"X-WearLink-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Wearlink-Api-Key"}},{"name":"X-HealthChain-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Healthchain-Api-Key"}},{"name":"X-Open-Wearables-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Open-Wearables-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Export User Data Api V1 Users  User Id  Export Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/users/{user_id}/export/async":{"post":{"tags":["External: Data Export"],"summary":"Export User Data Async","description":"Queue a background export that writes to S3 and emails a signed URL.\n\nUse this for accounts with large footprints where the sync endpoint would\ntime out. Returns 202 Accepted with the Celery task id; the recipient\ndeveloper gets an email with the signed download URL when done.","operationId":"export_user_data_async_api_v1_users__user_id__export_async_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}},{"name":"X-WearLink-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Wearlink-Api-Key"}},{"name":"X-HealthChain-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Healthchain-Api-Key"}},{"name":"X-Open-Wearables-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Open-Wearables-Api-Key"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Export User Data Async Api V1 Users  User Id  Export Async Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/data-exports/{token}/download":{"get":{"tags":["External: Data Export"],"summary":"Download Data Export","description":"Stream an async-export JSON bundle to the authorized requester.\n\nAuthorization is carried entirely in the signed token — no JWT in the\nAuthorization header, no cookie. That way the plain URL in the email just\nworks when clicked in any browser.","operationId":"download_data_export_api_v1_data_exports__token__download_get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","description":"Signed export token from the delivery email","title":"Token"},"description":"Signed export token from the delivery email"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/sdk/users/{user_id}/logs":{"post":{"tags":["External: Mobile SDK"],"summary":"Submit Sdk Logs","description":"Accept SDK diagnostic log events and store to raw S3 storage.\n\nUsed for observability into mobile SDK sync behavior (background task\nlifecycle, device state, sync success/failure).","operationId":"submit_sdk_logs_api_v1_sdk_users__user_id__logs_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"X-WearLink-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Wearlink-Api-Key"}},{"name":"X-HealthChain-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Healthchain-Api-Key"}},{"name":"X-Open-Wearables-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Open-Wearables-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SDKLogRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadDataResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/sdk/users/{user_id}/sync":{"post":{"tags":["External: Mobile SDK"],"summary":"Sync Sdk Data","description":"Import health data from SDK provider asynchronously via Celery.\n\nSupports Apple HealthKit and Samsung Health SDK formats (identical payloads):\n```json\n{\n    \"provider\": \"apple\",\n    \"sdkVersion\": \"1.0.0\",\n    \"syncTimestamp\": \"2021-01-01T00:00:00Z\",\n    \"data\": {\n        \"records\": [...],\n        \"sleep\": [...],\n        \"workouts\": [...]\n    }\n}\n```\n\nArgs:\n    user_id: SDK user identifier\n    body: Health data payload\n    auth: SDK authentication (Bearer token or API key)\n\nReturns:\n    UploadDataResponse with 202 status and task queued message\n\nRaises:\n    HTTPException: 403 if token doesn't match user_id, 400 if provider unsupported","operationId":"sync_sdk_data_api_v1_sdk_users__user_id__sync_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}},{"name":"X-WearLink-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Wearlink-Api-Key"}},{"name":"X-HealthChain-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Healthchain-Api-Key"}},{"name":"X-Open-Wearables-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Open-Wearables-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyncRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadDataResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/users/{user_id}/token":{"post":{"tags":["External: Mobile SDK"],"summary":"Create User Token","description":"Exchange app credentials or admin auth for user-scoped access token.\n\nSupports two authentication methods:\n1. App credentials: Provide app_id and app_secret in the request body —\n   the token's user must belong to that application's developer.\n2. Admin authentication: developer JWT — the token's user must belong\n   to that developer.\n\nBoth paths enforce that the caller can only mint tokens for users they\nown. Returns 404 (not 403) on mismatch to prevent user-id enumeration.\n\nArgs:\n    user_id: OpenWearables User ID (UUID)\n    payload: Optional application credentials (app_id, app_secret)\n    db: Database session\n    developer: Optional authenticated developer (from Bearer token)\n\nReturns:\n    TokenResponse containing access_token, token_type, and refresh_token\n\nRaises:\n    400: If neither app credentials nor admin auth is provided\n    401: If app credentials are invalid\n    404: If the user doesn't exist OR isn't owned by the caller","operationId":"create_user_token_api_v1_users__user_id__token_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/SDKTokenRequest"},{"type":"null"}],"title":"Payload"}}}},"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/v1/users/{user_id}/invitation-code":{"post":{"tags":["External: Mobile SDK"],"summary":"Generate Invitation Code","description":"Generate a single-use invitation code for SDK user onboarding.\n\nThe code can be shared with a mobile app user who enters it to receive\nSDK access and refresh tokens without manually entering user_id and tokens.\n\nPreviously generated codes for this user are marked as expired.\n\nRequires developer authentication AND that the user belongs to the caller.","operationId":"generate_invitation_code_api_v1_users__user_id__invitation_code_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}},{"name":"X-WearLink-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Wearlink-Api-Key"}},{"name":"X-HealthChain-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Healthchain-Api-Key"}},{"name":"X-Open-Wearables-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Open-Wearables-Api-Key"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserInvitationCodeRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/invitation-code/redeem":{"post":{"tags":["External: Mobile SDK"],"summary":"Redeem Invitation Code","description":"Redeem an invitation code for SDK tokens.\n\nPublic endpoint (no authentication required). Exchanges a valid,\nnon-expired, single-use invitation code for access_token, refresh_token,\nand user_id.","operationId":"redeem_invitation_code_api_v1_invitation_code_redeem_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserInvitationCodeRedeem"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationCodeRedeemResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/token/refresh":{"post":{"tags":["External: Token"],"summary":"Refresh Token","description":"Exchange refresh token for new access token.\n\nThis endpoint accepts both SDK and Developer refresh tokens and returns\na new access token of the same type. Implements refresh token rotation:\nthe old refresh token is revoked and a new one is issued.\n\nArgs:\n    payload: Request containing the refresh token\n    db: Database session\n\nReturns:\n    TokenResponse with new access token and new refresh token\n\nRaises:\n    401: If the refresh token is invalid or revoked","operationId":"refresh_token_api_v1_token_refresh_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__schemas__auth__token__RefreshTokenRequest"}}},"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/v1/token/revoke":{"post":{"tags":["External: Token"],"summary":"Revoke Refresh Token","description":"Revoke a refresh token.\n\nUse this endpoint to invalidate a refresh token, for example when\nlogging out or when a token is compromised. This follows the OAuth 2.0\nToken Revocation specification (RFC 7009) which uses POST.\n\nArgs:\n    payload: Request containing the refresh token to revoke\n    db: Database session\n\nRaises:\n    404: If the refresh token is not found","operationId":"revoke_refresh_token_api_v1_token_revoke_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__schemas__auth__token__RefreshTokenRequest"}}},"required":true},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/users/{user_id}/data-sources":{"get":{"tags":["External: Data Sources"],"summary":"Get user data sources","operationId":"get_user_data_sources_api_v1_users__user_id__data_sources_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}},{"name":"X-WearLink-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Wearlink-Api-Key"}},{"name":"X-HealthChain-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Healthchain-Api-Key"}},{"name":"X-Open-Wearables-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Open-Wearables-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataSourceListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/contact":{"post":{"tags":["External: Contact"],"summary":"Submit Contact","description":"Relay a contact form submission to the team inbox.\n\nReturns 202 on accept — we don't block the client on SMTP. A failed send\nis logged and surfaced via telemetry, not the response.","operationId":"submit_contact_api_v1_contact_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactRequest"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Submit Contact Api V1 Contact Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/setup-status":{"get":{"tags":["External: Setup","External: Setup"],"summary":"One-shot self-service onboarding gauge for partners.","description":"Return everything a partner needs to know to finish wiring up WearLink.\n\nPolls cheaply (one count query + the in-memory provider table + a Svix\nlist call). Safe for the dashboard to call on every page load.","operationId":"get_setup_status_api_v1_setup_status_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"X-WearLink-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Wearlink-Api-Key"}},{"name":"X-HealthChain-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Healthchain-Api-Key"}},{"name":"X-Open-Wearables-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Open-Wearables-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/webhooks/endpoints":{"get":{"tags":["External: Webhooks"],"summary":"List Endpoints","operationId":"list_endpoints_api_v1_webhooks_endpoints_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/EndpointResponse"},"type":"array","title":"Response List Endpoints Api V1 Webhooks Endpoints Get"}}}}},"security":[{"OAuth2PasswordBearer":[]}]},"post":{"tags":["External: Webhooks"],"summary":"Create Endpoint","operationId":"create_endpoint_api_v1_webhooks_endpoints_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EndpointCreateRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EndpointResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/webhooks/endpoints/{endpoint_id}":{"get":{"tags":["External: Webhooks"],"summary":"Get Endpoint","operationId":"get_endpoint_api_v1_webhooks_endpoints__endpoint_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","title":"Endpoint Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EndpointResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["External: Webhooks"],"summary":"Update Endpoint","operationId":"update_endpoint_api_v1_webhooks_endpoints__endpoint_id__patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","title":"Endpoint Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EndpointUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EndpointResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["External: Webhooks"],"summary":"Delete Endpoint","operationId":"delete_endpoint_api_v1_webhooks_endpoints__endpoint_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","title":"Endpoint Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/webhooks/endpoints/{endpoint_id}/secret":{"get":{"tags":["External: Webhooks"],"summary":"Get Endpoint Secret","operationId":"get_endpoint_secret_api_v1_webhooks_endpoints__endpoint_id__secret_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","title":"Endpoint Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EndpointSecretResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/webhooks/event-types":{"get":{"tags":["External: Webhooks"],"summary":"List Event Types","operationId":"list_event_types_api_v1_webhooks_event_types_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/EventTypeResponse"},"type":"array","title":"Response List Event Types Api V1 Webhooks Event Types Get"}}}}}}},"/api/v1/webhooks/messages":{"get":{"tags":["External: Webhooks"],"summary":"List Messages","operationId":"list_messages_api_v1_webhooks_messages_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":250,"minimum":1,"description":"Items per page.","default":50,"title":"Limit"},"description":"Items per page."},{"name":"iterator","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor from the previous page's `iterator` field.","title":"Iterator"},"description":"Cursor from the previous page's `iterator` field."},{"name":"before","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Only messages created before this timestamp.","title":"Before"},"description":"Only messages created before this timestamp."},{"name":"after","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Only messages created after this timestamp.","title":"After"},"description":"Only messages created after this timestamp."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResponse_WebhookMessageResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/webhooks/endpoints/{endpoint_id}/attempts":{"get":{"tags":["External: Webhooks"],"summary":"List Endpoint Attempts","operationId":"list_endpoint_attempts_api_v1_webhooks_endpoints__endpoint_id__attempts_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","title":"Endpoint Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":250,"minimum":1,"description":"Items per page.","default":50,"title":"Limit"},"description":"Items per page."},{"name":"iterator","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor from the previous page's `iterator` field.","title":"Iterator"},"description":"Cursor from the previous page's `iterator` field."},{"name":"before","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Only attempts created before this timestamp.","title":"Before"},"description":"Only attempts created before this timestamp."},{"name":"after","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Only attempts created after this timestamp.","title":"After"},"description":"Only attempts created after this timestamp."},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Filter by status: 0=success, 1=pending, 2=failed, 3=sending.","title":"Status"},"description":"Filter by status: 0=success, 1=pending, 2=failed, 3=sending."},{"name":"event_types","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Filter by event type(s).","title":"Event Types"},"description":"Filter by event type(s)."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResponse_WebhookMessageAttemptResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/webhooks/endpoints/{endpoint_id}/test":{"post":{"tags":["External: Webhooks"],"summary":"Send Test Event","operationId":"send_test_event_api_v1_webhooks_endpoints__endpoint_id__test_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","title":"Endpoint Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/TestEventRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Send Test Event Api V1 Webhooks Endpoints  Endpoint Id  Test Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/webhooks/endpoints/{endpoint_id}/stats":{"get":{"tags":["External: Webhooks"],"summary":"Endpoint Stats","description":"Aggregated delivery stats for a single endpoint.\n\nRolls up the last `hours` of attempts into:\n- overall success / failure / pending counts\n- success rate\n- per-hour bucketed counts for a sparkline\n- failure count per event_type (top N)","operationId":"endpoint_stats_api_v1_webhooks_endpoints__endpoint_id__stats_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","title":"Endpoint Id"}},{"name":"hours","in":"query","required":false,"schema":{"type":"integer","maximum":168,"minimum":1,"description":"Look-back window in hours (max 168 = 7 days).","default":24,"title":"Hours"},"description":"Look-back window in hours (max 168 = 7 days)."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Endpoint Stats Api V1 Webhooks Endpoints  Endpoint Id  Stats Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/register":{"post":{"tags":["Internal: Auth"],"summary":"Register","description":"Register a new developer account.","operationId":"register_api_v1_auth_register_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeveloperCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeveloperRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/login":{"post":{"tags":["Internal: Auth"],"summary":"Login","description":"Authenticate developer and return access token with refresh token.\n\nAccounts with MFA enabled must include ``otp_code`` in the form body.\nA 401 with ``detail=\"MFA required\"`` signals the client to prompt for the\ncode and retry the same call with ``otp_code`` populated.","operationId":"login_api_v1_auth_login_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_login_api_v1_auth_login_post"}}},"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/v1/auth/refresh":{"post":{"tags":["Internal: Auth"],"summary":"Refresh","description":"Exchange a valid refresh token for a new access + refresh token pair.\n\nImplements token rotation — the submitted refresh token is revoked and a\nnew one is issued with the response. Frontend should replace its stored\nrefresh token with the new value on every successful call.","operationId":"refresh_api_v1_auth_refresh_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api__routes__v1__auth__RefreshTokenRequest"}}},"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/v1/auth/verify-email":{"get":{"tags":["Internal: Auth"],"summary":"Verify Email","description":"Mark the developer's email as verified.\n\nCalled by the link in the verification email. Idempotent — clicking twice\ndoesn't error, and an expired token produces a helpful 400 with a hint to\nrequest a new one.","operationId":"verify_email_api_v1_auth_verify_email_get","parameters":[{"name":"token","in":"query","required":true,"schema":{"type":"string","description":"Verification token from the email link","title":"Token"},"description":"Verification token from the email link"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/resend-verification":{"post":{"tags":["Internal: Auth"],"summary":"Resend Verification","description":"Re-send the verification email to the currently signed-in developer.\n\nRate-limited to a handful per 10-minute window per IP to prevent spam.","operationId":"resend_verification_api_v1_auth_resend_verification_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/auth/resend-verification-public":{"post":{"tags":["Internal: Auth"],"summary":"Resend Verification Public","description":"Re-send the verification email to an unauthenticated caller by email.\n\nNeeded because the email-verification gate on /login means a user with\nan unverified account can't reach the authenticated /resend-verification\nendpoint. Returns the same response shape regardless of whether the email\nexists, so attackers can't enumerate accounts via this endpoint. Rate\nlimited per IP to 3/10min — well below what a legitimate user would need.","operationId":"resend_verification_public_api_v1_auth_resend_verification_public_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicResendRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/logout":{"post":{"tags":["Internal: Auth"],"summary":"Logout","description":"Logout: blacklist the current access-token JTI and revoke refresh tokens.","operationId":"logout_api_v1_auth_logout_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/auth/change-password":{"post":{"tags":["Internal: Auth"],"summary":"Change Password","description":"Change password for the current authenticated developer.\n\nSuccessful change:\n* bumps password_version, which invalidates every outstanding access token\n  (auth dependency compares pwv claim to current).\n* revokes every refresh token for this developer (full sign-out everywhere,\n  including other browsers / devices).\n\nClient should immediately call /auth/login again with the new password.","operationId":"change_password_api_v1_auth_change_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasswordChange"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/auth/me":{"get":{"tags":["Internal: Auth"],"summary":"Get Current Developer Info","description":"Get current authenticated developer.","operationId":"get_current_developer_info_api_v1_auth_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeveloperRead"}}}}},"security":[{"OAuth2PasswordBearer":[]}]},"patch":{"tags":["Internal: Auth"],"summary":"Update Current Developer","description":"Update current authenticated developer.","operationId":"update_current_developer_api_v1_auth_me_patch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeveloperUpdate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeveloperRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/auth/forgot-password":{"post":{"tags":["Internal: Auth"],"summary":"Forgot Password","description":"Request a password reset email.\n\nAlways returns 200 regardless of whether the email exists (prevents enumeration).\nThe reset link is valid for 1 hour and can only be used once.","operationId":"forgot_password_api_v1_auth_forgot_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForgotPasswordRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/reset-password":{"post":{"tags":["Internal: Auth"],"summary":"Reset Password","description":"Reset password using a token from the forgot-password email.","operationId":"reset_password_api_v1_auth_reset_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetPasswordRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/mfa/status":{"get":{"tags":["Internal: Auth"],"summary":"Get Status","operationId":"get_status_api_v1_auth_mfa_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MfaStatus"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/auth/mfa/enroll":{"post":{"tags":["Internal: Auth"],"summary":"Enroll","description":"Start MFA enrollment — returns a fresh secret + otpauth:// URI.","operationId":"enroll_api_v1_auth_mfa_enroll_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartEnrollmentResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/auth/mfa/verify":{"post":{"tags":["Internal: Auth"],"summary":"Verify","description":"Confirm a code and flip the MFA flag to enabled.\n\nMust be called after ``/enroll`` with a fresh code from the authenticator\napp. Without this second step, login is unaffected.","operationId":"verify_api_v1_auth_mfa_verify_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MfaStatus"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/auth/mfa/disable":{"post":{"tags":["Internal: Auth"],"summary":"Disable Mfa","description":"Turn MFA off. Requires both current password and a current OTP.\n\nRequiring both prevents a stolen browser session from disabling MFA and\nprevents a stolen TOTP secret from disabling MFA without the password.","operationId":"disable_mfa_api_v1_auth_mfa_disable_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DisableRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MfaStatus"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/developers":{"get":{"tags":["Internal: Developers"],"summary":"List Developers","description":"Return just the authenticated developer (kept as a list for backward\ncompatibility with the dashboard, which expects an array).\n\nOrganization peers are intentionally not returned here — call\n`GET /api/v1/organizations/members` for that.","operationId":"list_developers_api_v1_developers_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/DeveloperRead"},"type":"array","title":"Response List Developers Api V1 Developers Get"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/developers/{developer_id}":{"get":{"tags":["Internal: Developers"],"summary":"Get Developer","operationId":"get_developer_api_v1_developers__developer_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"developer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Developer Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeveloperRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["Internal: Developers"],"summary":"Update Developer","operationId":"update_developer_api_v1_developers__developer_id__patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"developer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Developer Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeveloperUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeveloperRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Internal: Developers"],"summary":"Delete Developer","description":"Self-delete the authenticated developer account. 404 on any other id.","operationId":"delete_developer_api_v1_developers__developer_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"developer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Developer Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeveloperRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/invitations":{"get":{"tags":["Internal: Invitations"],"summary":"List Invitations","description":"List the pending invitations created by the authenticated developer.","operationId":"list_invitations_api_v1_invitations_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/InvitationRead"},"type":"array","title":"Response List Invitations Api V1 Invitations Get"}}}}},"security":[{"OAuth2PasswordBearer":[]}]},"post":{"tags":["Internal: Invitations"],"summary":"Create Invitation","description":"Create and send a new invitation.","operationId":"create_invitation_api_v1_invitations_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/invitations/{invitation_id}":{"delete":{"tags":["Internal: Invitations"],"summary":"Revoke Invitation","description":"Revoke a pending invitation the caller created.","operationId":"revoke_invitation_api_v1_invitations__invitation_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"invitation_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Invitation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/invitations/{invitation_id}/resend":{"post":{"tags":["Internal: Invitations"],"summary":"Resend Invitation","description":"Resend an invitation email (caller must have created the invitation).","operationId":"resend_invitation_api_v1_invitations__invitation_id__resend_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"invitation_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Invitation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/invitations/accept":{"post":{"tags":["Internal: Invitations"],"summary":"Accept Invitation","description":"Accept an invitation and create a developer account (public endpoint).","operationId":"accept_invitation_api_v1_invitations_accept_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationAccept"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeveloperRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/developer/api-keys":{"get":{"tags":["Internal: API Keys"],"summary":"List Api Keys","description":"List the API keys owned by the authenticated developer.","operationId":"list_api_keys_api_v1_developer_api_keys_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ApiKeyRead"},"type":"array","title":"Response List Api Keys Api V1 Developer Api Keys Get"}}}}},"security":[{"OAuth2PasswordBearer":[]}]},"post":{"tags":["Internal: API Keys"],"summary":"Create Api Key","description":"Generate new API key with optional scope restrictions.\n\nReturns the raw `value` exactly once — it cannot be retrieved later\nbecause the backend now stores only sha256(value). The UI MUST show this\nvalue to the user immediately and tell them it will not be shown again.","operationId":"create_api_key_api_v1_developer_api_keys_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyCreatePayload","default":{"name":"Default"}}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyReadWithSecret"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/developer/api-keys/{key_id}":{"delete":{"tags":["Internal: API Keys"],"summary":"Delete Api Key","description":"Delete an API key the caller owns. 404 otherwise.","operationId":"delete_api_key_api_v1_developer_api_keys__key_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["Internal: API Keys"],"summary":"Update Api Key","description":"Update an API key the caller owns (name, scopes, etc.).","operationId":"update_api_key_api_v1_developer_api_keys__key_id__patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/developer/api-keys/{key_id}/rotate":{"post":{"tags":["Internal: API Keys"],"summary":"Rotate Api Key","description":"Rotate API key (caller must own the old key).","operationId":"rotate_api_key_api_v1_developer_api_keys__key_id__rotate_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/applications":{"get":{"tags":["Internal: Applications"],"summary":"List Applications","description":"List all applications for current developer.","operationId":"list_applications_api_v1_applications_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ApplicationRead"},"type":"array","title":"Response List Applications Api V1 Applications Get"}}}}},"security":[{"OAuth2PasswordBearer":[]}]},"post":{"tags":["Internal: Applications"],"summary":"Create Application","description":"Create new application.\n\nReturns app_secret only once - store it securely as it cannot be retrieved again.","operationId":"create_application_api_v1_applications_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApplicationCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApplicationReadWithSecret"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/applications/{app_id}":{"delete":{"tags":["Internal: Applications"],"summary":"Delete Application","description":"Delete application.","operationId":"delete_application_api_v1_applications__app_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"app_id","in":"path","required":true,"schema":{"type":"string","title":"App Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/applications/{app_id}/rotate-secret":{"post":{"tags":["Internal: Applications"],"summary":"Rotate Application Secret","description":"Rotate application secret.\n\nReturns new secret only once - store it securely as it cannot be retrieved again.\nThe old secret will no longer work after rotation.","operationId":"rotate_application_secret_api_v1_applications__app_id__rotate_secret_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"app_id","in":"path","required":true,"schema":{"type":"string","title":"App Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApplicationReadWithSecret"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/dashboard/stats":{"get":{"tags":["Internal: Dashboard","dashboard"],"summary":"Get Stats","description":"Tenant-scoped dashboard statistics.\n\nBefore this was scoped, every developer saw global counts — which leaked\nplatform scale + other tenants' activity patterns.","operationId":"get_stats_api_v1_dashboard_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SystemInfoResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/dashboard/overview":{"get":{"tags":["Internal: Dashboard"],"summary":"Overview","operationId":"overview_api_v1_dashboard_overview_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardOverview"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/settings/archival":{"get":{"tags":["Internal: Data Lifecycle"],"summary":"Get data lifecycle settings","description":"Returns current archival/retention configuration and storage size estimates.","operationId":"get_archival_settings_api_v1_settings_archival_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArchivalSettingWithEstimate"}}}}},"security":[{"OAuth2PasswordBearer":[]}]},"put":{"tags":["Internal: Data Lifecycle"],"summary":"Update data lifecycle settings (admin only)","description":"Configure archive_after_days and delete_after_days globally. Admin-only because these values affect every tenant — a non-admin setting delete_after_days=1 would wipe the whole deployment on the next archival run.","operationId":"update_archival_settings_api_v1_settings_archival_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArchivalSettingUpdate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArchivalSettingWithEstimate"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/settings/archival/run":{"post":{"tags":["Internal: Data Lifecycle"],"summary":"Trigger the archival job manually (admin only)","operationId":"trigger_archival_api_v1_settings_archival_run_post","responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Trigger Archival Api V1 Settings Archival Run Post"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/settings/seed":{"post":{"tags":["Internal: Seed Data"],"summary":"Generate synthetic seed data","description":"Dispatches a Celery task to generate synthetic users with configurable health data profiles.","operationId":"dispatch_seed_generation_api_v1_settings_seed_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeedDataRequest"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeedDataResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/settings/seed/presets":{"get":{"tags":["Internal: Seed Data"],"summary":"List available seed data presets","description":"Returns the list of pre-configured profiles for seed data generation.","operationId":"list_presets_api_v1_settings_seed_presets_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/SeedPresetInfo"},"type":"array","title":"Response List Presets Api V1 Settings Seed Presets Get"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/settings/seed/sleep-profiles":{"get":{"tags":["Internal: Seed Data"],"summary":"List available sleep stage profiles","operationId":"list_sleep_stage_profiles_api_v1_settings_seed_sleep_profiles_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Response List Sleep Stage Profiles Api V1 Settings Seed Sleep Profiles Get"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/priorities/providers":{"get":{"tags":["Internal: Priorities"],"summary":"Get global provider priorities","operationId":"get_provider_priorities_api_v1_priorities_providers_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderPriorityListResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]},"put":{"tags":["Internal: Priorities"],"summary":"Bulk update provider priorities (admin only)","operationId":"bulk_update_provider_priorities_api_v1_priorities_providers_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderPriorityBulkUpdate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderPriorityListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/priorities/providers/{provider}":{"put":{"tags":["Internal: Priorities"],"summary":"Update provider priority (admin only)","operationId":"update_provider_priority_api_v1_priorities_providers__provider__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"provider","in":"path","required":true,"schema":{"$ref":"#/components/schemas/ProviderName","description":"Provider name enum"},"description":"Provider name enum"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderPriorityUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderPriorityResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/priorities/device-types":{"get":{"tags":["Internal: Priorities"],"summary":"Get device type priorities","operationId":"get_device_type_priorities_api_v1_priorities_device_types_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceTypePriorityListResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]},"put":{"tags":["Internal: Priorities"],"summary":"Bulk update device type priorities (admin only)","operationId":"bulk_update_device_type_priorities_api_v1_priorities_device_types_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceTypePriorityBulkUpdate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceTypePriorityListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/priorities/device-types/{device_type}":{"put":{"tags":["Internal: Priorities"],"summary":"Update device type priority (admin only)","operationId":"update_device_type_priority_api_v1_priorities_device_types__device_type__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"device_type","in":"path","required":true,"schema":{"$ref":"#/components/schemas/app__schemas__enums__device_type__DeviceType","description":"Device type enum"},"description":"Device type enum"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceTypePriorityUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceTypePriorityResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/onboarding/progress":{"get":{"tags":["Internal: Onboarding"],"summary":"Get Onboarding Progress","description":"Report which of the 4 onboarding steps the developer has completed.","operationId":"get_onboarding_progress_api_v1_onboarding_progress_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingProgress"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/billing/plans":{"get":{"tags":["Internal: Billing"],"summary":"List Plans","description":"Public plan catalog.","operationId":"list_plans_api_v1_billing_plans_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/PlanRead"},"type":"array","title":"Response List Plans Api V1 Billing Plans Get"}}}}}}},"/api/v1/billing/subscription":{"get":{"tags":["Internal: Billing"],"summary":"Get My Subscription","operationId":"get_my_subscription_api_v1_billing_subscription_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionRead"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/billing/checkout/order":{"post":{"tags":["Internal: Billing"],"summary":"Create Order","operationId":"create_order_api_v1_billing_checkout_order_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrderRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrderResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/billing/checkout/verify":{"post":{"tags":["Internal: Billing"],"summary":"Verify Payment","operationId":"verify_payment_api_v1_billing_checkout_verify_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyPaymentRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyPaymentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/billing/subscription/cancel":{"post":{"tags":["Internal: Billing"],"summary":"Cancel Subscription","operationId":"cancel_subscription_api_v1_billing_subscription_cancel_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/billing/webhook":{"post":{"tags":["Internal: Billing"],"summary":"Razorpay Webhook","operationId":"razorpay_webhook_api_v1_billing_webhook_post","parameters":[{"name":"X-Razorpay-Signature","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Razorpay-Signature"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Razorpay Webhook Api V1 Billing Webhook Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/billing/invoices":{"get":{"tags":["Internal: Billing"],"summary":"List Invoices","operationId":"list_invoices_api_v1_billing_invoices_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/InvoiceRead"},"type":"array","title":"Response List Invoices Api V1 Billing Invoices Get"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/billing/invoices/{invoice_id}":{"get":{"tags":["Internal: Billing"],"summary":"Get Invoice","operationId":"get_invoice_api_v1_billing_invoices__invoice_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","title":"Invoice Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/billing/invoices/{invoice_id}/html":{"get":{"tags":["Internal: Billing"],"summary":"Get Invoice Html","operationId":"get_invoice_html_api_v1_billing_invoices__invoice_id__html_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","title":"Invoice Id"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/billing/invoices/{invoice_id}/resend-email":{"post":{"tags":["Internal: Billing"],"summary":"Resend Invoice Email","operationId":"resend_invoice_email_api_v1_billing_invoices__invoice_id__resend_email_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","title":"Invoice Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Resend Invoice Email Api V1 Billing Invoices  Invoice Id  Resend Email Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/audit-logs":{"get":{"tags":["Internal: Audit"],"summary":"List Audit Logs","operationId":"list_audit_logs_api_v1_audit_logs_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}},{"name":"action","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Exact action filter, e.g. auth.login","title":"Action"},"description":"Exact action filter, e.g. auth.login"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AuditLogRead"},"title":"Response List Audit Logs Api V1 Audit Logs Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/audit-logs/export":{"get":{"tags":["Internal: Audit"],"summary":"Export Audit Logs","description":"Stream the developer's audit log entries as newline-delimited JSON.\n\nUseful for SOC 2 / customer security questionnaires. Returns NDJSON\n(`application/x-ndjson`) so consumers can parse line-by-line without\nloading the full result into memory.","operationId":"export_audit_logs_api_v1_audit_logs_export_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"since","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Inclusive lower bound on created_at","title":"Since"},"description":"Inclusive lower bound on created_at"},{"name":"until","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Exclusive upper bound on created_at","title":"Until"},"description":"Exclusive upper bound on created_at"},{"name":"action","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Exact action filter","title":"Action"},"description":"Exact action filter"}],"responses":{"200":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/nutrition/review/queue":{"get":{"tags":["Internal: Nutrition Review"],"summary":"List Queue","operationId":"list_queue_api_v1_admin_nutrition_review_queue_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"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":"array","items":{"$ref":"#/components/schemas/ReviewQueueRow"},"title":"Response List Queue Api V1 Admin Nutrition Review Queue Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/nutrition/review/{log_id}":{"get":{"tags":["Internal: Nutrition Review"],"summary":"Get Log For Review","operationId":"get_log_for_review_api_v1_admin_nutrition_review__log_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"log_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Log Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewedLog"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/nutrition/review/{log_id}/approve":{"post":{"tags":["Internal: Nutrition Review"],"summary":"Approve","operationId":"approve_api_v1_admin_nutrition_review__log_id__approve_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"log_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Log Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/nutrition/review/{log_id}/reject":{"post":{"tags":["Internal: Nutrition Review"],"summary":"Reject","operationId":"reject_api_v1_admin_nutrition_review__log_id__reject_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"log_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Log Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/nutrition/review/{log_id}/items/{item_id}":{"patch":{"tags":["Internal: Nutrition Review"],"summary":"Admin Patch Item","operationId":"admin_patch_item_api_v1_admin_nutrition_review__log_id__items__item_id__patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"log_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Log Id"}},{"name":"item_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Item Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ItemPatch"}}}},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/nutrition/review/bulk":{"post":{"tags":["Internal: Nutrition Review"],"summary":"Bulk Action","description":"Approve or reject many logs in one round-trip.\n\nUses one DB transaction for the whole batch (cheaper than N round-trips\nfrom the dashboard) but still emits individual audit-log rows + webhooks\nso the per-row trail matches what single-action endpoints produce.\n\nSkipped reasons (returned in `skipped[]`) — caller can surface these in\na toast: ``not_found`` (deleted between list + bulk action),\n``already_reviewed`` (someone else flipped it).","operationId":"bulk_action_api_v1_admin_nutrition_review_bulk_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkActionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkActionResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/admin/overview":{"get":{"tags":["Internal: Admin"],"summary":"Admin Overview","operationId":"admin_overview_api_v1_admin_overview_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminOverviewResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/admin/developers":{"get":{"tags":["Internal: Admin"],"summary":"List Developers","operationId":"list_developers_api_v1_admin_developers_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search by email, first/last name (ILIKE)","title":"Q"},"description":"Search by email, first/last name (ILIKE)"},{"name":"plan","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by plan slug","title":"Plan"},"description":"Filter by plan slug"},{"name":"is_superuser","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Superuser"}},{"name":"locked","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"True = currently locked, False = not locked","title":"Locked"},"description":"True = currently locked, False = not locked"},{"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/AdminDeveloperListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/developers/{developer_id}":{"get":{"tags":["Internal: Admin"],"summary":"Get Developer","operationId":"get_developer_api_v1_admin_developers__developer_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"developer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Developer Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminDeveloperDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/developers/{developer_id}/superuser":{"post":{"tags":["Internal: Admin"],"summary":"Set Superuser","operationId":"set_superuser_api_v1_admin_developers__developer_id__superuser_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"developer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Developer Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToggleSuperuserPayload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminDeveloperDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/developers/{developer_id}/lock":{"post":{"tags":["Internal: Admin"],"summary":"Lock Developer","description":"Force-lock a developer for 7 days (security action).","operationId":"lock_developer_api_v1_admin_developers__developer_id__lock_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"developer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Developer Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminDeveloperDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/developers/{developer_id}/unlock":{"post":{"tags":["Internal: Admin"],"summary":"Unlock Developer","operationId":"unlock_developer_api_v1_admin_developers__developer_id__unlock_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"developer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Developer Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminDeveloperDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/end-users":{"get":{"tags":["Internal: Admin"],"summary":"List End Users","operationId":"list_end_users_api_v1_admin_end_users_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search email, name, external_user_id","title":"Q"},"description":"Search email, name, external_user_id"},{"name":"developer_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Developer Id"}},{"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/AdminEndUserListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/end-users/{user_id}":{"get":{"tags":["Internal: Admin"],"summary":"Get End User","operationId":"get_end_user_api_v1_admin_end_users__user_id__get","security":[{"OAuth2PasswordBearer":[]}],"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":{"$ref":"#/components/schemas/AdminEndUserRow"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/audit":{"get":{"tags":["Internal: Admin"],"summary":"List Audit","operationId":"list_audit_api_v1_admin_audit_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"actor_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Actor Id"}},{"name":"action","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Exact match on action, e.g. auth.login","title":"Action"},"description":"Exact match on action, e.g. auth.login"},{"name":"action_prefix","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Prefix match, e.g. admin.","title":"Action Prefix"},"description":"Prefix match, e.g. admin."},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ILIKE on action / resource_type / resource_id / actor email","title":"Q"},"description":"ILIKE on action / resource_type / resource_id / actor email"},{"name":"since","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Since"}},{"name":"until","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Until"}},{"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":{"$ref":"#/components/schemas/AdminAuditListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/system/health":{"get":{"tags":["Internal: Admin"],"summary":"System Health","operationId":"system_health_api_v1_admin_system_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminSystemHealthResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/admin/jobs":{"get":{"tags":["Internal: Admin"],"summary":"List Jobs","operationId":"list_jobs_api_v1_admin_jobs_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminJobsResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/admin/jobs/{name}/run":{"post":{"tags":["Internal: Admin"],"summary":"Run Job","operationId":"run_job_api_v1_admin_jobs__name__run_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunNowResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/finance/summary":{"get":{"tags":["Internal: Admin"],"summary":"Revenue Summary","operationId":"revenue_summary_api_v1_admin_finance_summary_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevenueSummary"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/admin/finance/subscriptions":{"get":{"tags":["Internal: Admin"],"summary":"List Subscriptions","operationId":"list_subscriptions_api_v1_admin_finance_subscriptions_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ILIKE on developer email","title":"Q"},"description":"ILIKE on developer email"},{"name":"plan","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan"}},{"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/AdminSubscriptionListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/finance/invoices":{"get":{"tags":["Internal: Admin"],"summary":"List Invoices","operationId":"list_invoices_api_v1_admin_finance_invoices_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ILIKE on developer email or invoice number","title":"Q"},"description":"ILIKE on developer email or invoice number"},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"paid | refunded | void","title":"Status"},"description":"paid | refunded | void"},{"name":"plan","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan"}},{"name":"since","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Since"}},{"name":"until","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Until"}},{"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/AdminInvoiceListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/finance/invoices/{invoice_id}/mark-refunded":{"post":{"tags":["Internal: Admin"],"summary":"Mark Refunded","description":"Mark an invoice refunded. Does NOT call Razorpay — issue the refund there\nfirst, then mark the invoice here so reports stay consistent.","operationId":"mark_refunded_api_v1_admin_finance_invoices__invoice_id__mark_refunded_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Invoice Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefundPayload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminInvoiceRow"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/support":{"get":{"tags":["Internal: Admin"],"summary":"List Support","operationId":"list_support_api_v1_admin_support_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ILIKE on email/name/topic/message","title":"Q"},"description":"ILIKE on email/name/topic/message"},{"name":"topic","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Topic"}},{"name":"resolved","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Resolved"}},{"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/SupportListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/support/{ticket_id}/resolve":{"post":{"tags":["Internal: Admin"],"summary":"Resolve Ticket","operationId":"resolve_ticket_api_v1_admin_support__ticket_id__resolve_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"ticket_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Ticket Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolvePayload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupportTicket"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/cogs/summary":{"get":{"tags":["Internal: Admin"],"summary":"Cogs Summary","operationId":"cogs_summary_api_v1_admin_cogs_summary_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CogsResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/admin/insights":{"get":{"tags":["Internal: Admin"],"summary":"Insights","operationId":"insights_api_v1_admin_insights_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminInsightsResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/admin/announcements/active":{"get":{"tags":["Internal: Admin"],"summary":"Get Active","description":"Public read: the current active banner (or null). No auth required.","operationId":"get_active_api_v1_admin_announcements_active_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/Announcement"},{"type":"null"}],"title":"Response Get Active Api V1 Admin Announcements Active Get"}}}}}}},"/api/v1/admin/announcements/history":{"get":{"tags":["Internal: Admin"],"summary":"List History","operationId":"list_history_api_v1_admin_announcements_history_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":30,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnnouncementListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/announcements/publish":{"post":{"tags":["Internal: Admin"],"summary":"Publish","description":"Publish a new banner. Deactivates any previously-active banner first.","operationId":"publish_api_v1_admin_announcements_publish_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishPayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Announcement"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/admin/announcements/{ann_id}/dismiss":{"post":{"tags":["Internal: Admin"],"summary":"Dismiss","description":"Mark a specific announcement inactive (without publishing a new one).","operationId":"dismiss_api_v1_admin_announcements__ann_id__dismiss_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"ann_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Ann Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Announcement"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/organizations/me":{"get":{"tags":["Internal: Organizations"],"summary":"Get My Org","operationId":"get_my_org_api_v1_organizations_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgRead"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/organizations/retention":{"patch":{"tags":["Internal: Organizations"],"summary":"Update Retention","description":"Set the organization's data retention window (null = infinite).\n\nOnly owners and admins may change this. A nightly Celery task prunes events\n+ health scores older than the configured window.","operationId":"update_retention_api_v1_organizations_retention_patch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetentionUpdateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/organizations/members":{"get":{"tags":["Internal: Organizations"],"summary":"List Members","operationId":"list_members_api_v1_organizations_members_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/MemberRead"},"type":"array","title":"Response List Members Api V1 Organizations Members Get"}}}}},"security":[{"OAuth2PasswordBearer":[]}]},"post":{"tags":["Internal: Organizations"],"summary":"Add Member","operationId":"add_member_api_v1_organizations_members_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddMemberRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemberRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/organizations/members/{member_id}":{"patch":{"tags":["Internal: Organizations"],"summary":"Update Member Role","operationId":"update_member_role_api_v1_organizations_members__member_id__patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"member_id","in":"path","required":true,"schema":{"type":"string","title":"Member Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoleUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemberRead"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Internal: Organizations"],"summary":"Remove Member","operationId":"remove_member_api_v1_organizations_members__member_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"member_id","in":"path","required":true,"schema":{"type":"string","title":"Member Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/health/public":{"get":{"tags":["Public: Health"],"summary":"Public Health","operationId":"public_health_api_v1_health_public_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicHealthResponse"}}}}}}},"/api/v1/usage/summary":{"get":{"tags":["Internal: Usage"],"summary":"Get Usage Summary","operationId":"get_usage_summary_api_v1_usage_summary_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageSummary"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/usage/summary/breakdown":{"get":{"tags":["Internal: Usage"],"summary":"Get Usage Breakdown","operationId":"get_usage_breakdown_api_v1_usage_summary_breakdown_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageBreakdown"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/oura/webhooks":{"post":{"tags":["System: Provider Webhooks (Deprecated)"],"summary":"Oura Webhook Notification","description":"Receive Oura webhook notifications.\n\nOura sends lightweight notifications when data is available.\nThe notification contains: event_type, data_type, user_id (Oura user ID).\nActual data must be fetched via REST API.","operationId":"oura_webhook_notification_api_v1_oura_webhooks_post","deprecated":true,"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Oura Webhook Notification Api V1 Oura Webhooks Post"}}}}}},"get":{"tags":["System: Provider Webhooks (Deprecated)"],"summary":"Oura Webhook Verification","description":"Handle Oura webhook verification challenge.\n\nWhen creating a subscription Oura sends a GET with verification_token and\nchallenge query params.  We must verify the token matches our configured\ntoken and echo the challenge back.","operationId":"oura_webhook_verification_api_v1_oura_webhooks_get","deprecated":true,"parameters":[{"name":"verification_token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Verification Token"}},{"name":"challenge","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Challenge"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Oura Webhook Verification Api V1 Oura Webhooks Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/oura/webhooks/health":{"get":{"tags":["System: Provider Webhooks (Deprecated)"],"summary":"Oura Webhook Health","description":"Health check endpoint for Oura webhook configuration.","operationId":"oura_webhook_health_api_v1_oura_webhooks_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Oura Webhook Health Api V1 Oura Webhooks Health Get"}}}}},"deprecated":true}},"/api/v1/oura/webhooks/subscriptions":{"post":{"tags":["System: Provider Webhooks (Deprecated)"],"summary":"Create Webhook Subscriptions","description":"Create Oura webhook subscriptions for all data types.\n\nRequires Oura client_id and client_secret to be configured.\nSubscriptions are app-level (cover all authorized users).","operationId":"create_webhook_subscriptions_api_v1_oura_webhooks_subscriptions_post","deprecated":true,"security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"callback_url","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Callback Url"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Create Webhook Subscriptions Api V1 Oura Webhooks Subscriptions Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["System: Provider Webhooks (Deprecated)"],"summary":"List Webhook Subscriptions","description":"List active Oura webhook subscriptions.","operationId":"list_webhook_subscriptions_api_v1_oura_webhooks_subscriptions_get","deprecated":true,"security":[{"OAuth2PasswordBearer":[]}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Webhook Subscriptions Api V1 Oura Webhooks Subscriptions Get"}}}}}}},"/api/v1/oura/webhooks/subscriptions/renew":{"post":{"tags":["System: Provider Webhooks (Deprecated)"],"summary":"Renew Webhook Subscriptions","description":"Renew all active Oura webhook subscriptions.","operationId":"renew_webhook_subscriptions_api_v1_oura_webhooks_subscriptions_renew_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Renew Webhook Subscriptions Api V1 Oura Webhooks Subscriptions Renew Post"}}}}},"deprecated":true,"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/strava/webhooks":{"get":{"tags":["System: Strava Webhooks"],"summary":"Strava Webhook Verification","description":"Strava webhook subscription verification (GET).\n\nWhen creating a webhook subscription, Strava sends a GET request\nwith hub.mode, hub.challenge, and hub.verify_token parameters.\nWe must echo back hub.challenge if the verify_token matches.","operationId":"strava_webhook_verification_api_v1_strava_webhooks_get","parameters":[{"name":"hub.mode","in":"query","required":false,"schema":{"type":"string","default":"","title":"Hub.Mode"}},{"name":"hub.challenge","in":"query","required":false,"schema":{"type":"string","default":"","title":"Hub.Challenge"}},{"name":"hub.verify_token","in":"query","required":false,"schema":{"type":"string","default":"","title":"Hub.Verify Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Strava Webhook Verification Api V1 Strava Webhooks Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["System: Strava Webhooks"],"summary":"Strava Webhook Event","description":"Strava webhook event handler (POST).\n\nReceives events when activities are created, updated, or deleted.\n\nExpected payload:\n{\n    \"object_type\": \"activity\",\n    \"object_id\": 12345678,\n    \"aspect_type\": \"create\",\n    \"owner_id\": 87654321,\n    \"subscription_id\": 999,\n    \"event_time\": 1234567890\n}\n\nMust always return 200 to prevent Strava from retrying.","operationId":"strava_webhook_event_api_v1_strava_webhooks_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Strava Webhook Event Api V1 Strava Webhooks Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/strava/webhooks/health":{"get":{"tags":["System: Strava Webhooks"],"summary":"Strava Webhook Health","description":"Health check endpoint for Strava webhook configuration.","operationId":"strava_webhook_health_api_v1_strava_webhooks_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Strava Webhook Health Api V1 Strava Webhooks Health Get"}}}}}}},"/api/v1/providers/{provider}/webhooks":{"post":{"tags":["System: Provider Webhooks"],"summary":"Handle Provider Webhook","description":"Receive an incoming webhook event from a provider.\n\nBody bytes are pre-read by the async ``_read_body`` dependency so that\nsignature verification has access to the exact bytes signed by the provider.\nThe route itself is a plain ``def`` so FastAPI runs it in a threadpool,\nkeeping synchronous DB work off the event loop.\n\nReturns whatever dict the provider's ``dispatch()`` method returns.","operationId":"handle_provider_webhook_api_v1_providers__provider__webhooks_post","parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Handle Provider Webhook Api V1 Providers  Provider  Webhooks Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["System: Provider Webhooks"],"summary":"Verify Provider Webhook","description":"Handle GET-based subscription verification challenges.\n\nSome providers (Strava ``hub.challenge``, Oura ``verification_token``)\nverify webhook subscriptions by sending a GET request that must be\nechoed back.  This endpoint delegates to the provider's\n``handle_challenge()`` method.\n\nProviders that do not support GET challenges will receive a ``501``\nresponse from the default ``BaseWebhookHandler.handle_challenge()``\nimplementation.","operationId":"verify_provider_webhook_api_v1_providers__provider__webhooks_get","parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Verify Provider Webhook Api V1 Providers  Provider  Webhooks Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/garmin/webhooks/ping":{"post":{"tags":["System: Provider Webhooks (Deprecated)"],"summary":"Garmin Webhook Ping Compat","description":"Deprecated: POST /api/v1/garmin/webhooks/ping.\n\nUse POST /api/v1/providers/garmin/webhooks instead.","operationId":"garmin_webhook_ping_compat_api_v1_garmin_webhooks_ping_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Garmin Webhook Ping Compat Api V1 Garmin Webhooks Ping Post"}}}}},"deprecated":true}},"/api/v1/garmin/webhooks/push":{"post":{"tags":["System: Provider Webhooks (Deprecated)"],"summary":"Garmin Webhook Push Compat","description":"Deprecated: POST /api/v1/garmin/webhooks/push.\n\nUse POST /api/v1/providers/garmin/webhooks instead.","operationId":"garmin_webhook_push_compat_api_v1_garmin_webhooks_push_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Garmin Webhook Push Compat Api V1 Garmin Webhooks Push Post"}}}}},"deprecated":true}},"/api/v1/strava/webhook":{"get":{"tags":["System: Provider Webhooks (Deprecated)"],"summary":"Strava Webhook Verification","description":"Strava webhook subscription verification (GET).\n\nWhen creating a webhook subscription, Strava sends a GET request\nwith hub.mode, hub.challenge, and hub.verify_token parameters.\nWe must echo back hub.challenge if the verify_token matches.","operationId":"strava_webhook_verification_api_v1_strava_webhook_get","deprecated":true,"parameters":[{"name":"hub.mode","in":"query","required":false,"schema":{"type":"string","default":"","title":"Hub.Mode"}},{"name":"hub.challenge","in":"query","required":false,"schema":{"type":"string","default":"","title":"Hub.Challenge"}},{"name":"hub.verify_token","in":"query","required":false,"schema":{"type":"string","default":"","title":"Hub.Verify Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Strava Webhook Verification Api V1 Strava Webhook Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["System: Provider Webhooks (Deprecated)"],"summary":"Strava Webhook Event","description":"Strava webhook event handler (POST).\n\nReceives events when activities are created, updated, or deleted.\n\nExpected payload:\n{\n    \"object_type\": \"activity\",\n    \"object_id\": 12345678,\n    \"aspect_type\": \"create\",\n    \"owner_id\": 87654321,\n    \"subscription_id\": 999,\n    \"event_time\": 1234567890\n}\n\nMust always return 200 to prevent Strava from retrying.","operationId":"strava_webhook_event_api_v1_strava_webhook_post","deprecated":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Strava Webhook Event Api V1 Strava Webhook Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/strava/webhook/health":{"get":{"tags":["System: Provider Webhooks (Deprecated)"],"summary":"Strava Webhook Health","description":"Health check endpoint for Strava webhook configuration.","operationId":"strava_webhook_health_api_v1_strava_webhook_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Strava Webhook Health Api V1 Strava Webhook Health Get"}}}}},"deprecated":true}},"/.well-known/security.txt":{"get":{"tags":["Public: Well-Known"],"summary":"Security Txt","operationId":"security_txt__well_known_security_txt_get","responses":{"200":{"description":"Successful Response","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/humans.txt":{"get":{"tags":["Public: Well-Known"],"summary":"Humans Txt","operationId":"humans_txt_humans_txt_get","responses":{"200":{"description":"Successful Response","content":{"text/plain":{"schema":{"type":"string"}}}}}}}},"components":{"schemas":{"ActivitySummary":{"properties":{"date":{"type":"string","format":"date","title":"Date"},"source":{"$ref":"#/components/schemas/SourceMetadata"},"steps":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Steps","description":"Total step count","example":8432},"distance_meters":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Distance Meters","example":6240.5},"floors_climbed":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Floors Climbed","description":"Calculated from elevation (1 floor ≈ 3m)","example":12},"elevation_meters":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Elevation Meters","description":"Raw total elevation gain","example":36.0},"active_calories_kcal":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Active Calories Kcal","description":"Active energy burned","example":342.5},"total_calories_kcal":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Total Calories Kcal","description":"Active + basal energy","example":2150.0},"active_minutes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Active Minutes","description":"Minutes with activity above threshold","example":60},"sedentary_minutes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Sedentary Minutes","description":"Minutes with minimal activity","example":480},"intensity_minutes":{"anyOf":[{"$ref":"#/components/schemas/IntensityMinutes"},{"type":"null"}]},"heart_rate":{"anyOf":[{"$ref":"#/components/schemas/HeartRateStats"},{"type":"null"}]}},"type":"object","required":["date","source"],"title":"ActivitySummary"},"AddMemberRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"role":{"type":"string","title":"Role"}},"type":"object","required":["email","role"],"title":"AddMemberRequest"},"AdminActivityCounts":{"properties":{"event_records_total":{"type":"integer","title":"Event Records Total"},"event_records_last_7d":{"type":"integer","title":"Event Records Last 7D"},"nutrition_logs_total":{"type":"integer","title":"Nutrition Logs Total"},"nutrition_logs_last_7d":{"type":"integer","title":"Nutrition Logs Last 7D"}},"type":"object","required":["event_records_total","event_records_last_7d","nutrition_logs_total","nutrition_logs_last_7d"],"title":"AdminActivityCounts"},"AdminAuditListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AdminAuditRow"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"},"distinct_actions":{"items":{"type":"string"},"type":"array","title":"Distinct Actions"}},"type":"object","required":["items","total","limit","offset","distinct_actions"],"title":"AdminAuditListResponse"},"AdminAuditRow":{"properties":{"id":{"type":"string","title":"Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"actor_developer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Actor Developer Id"},"actor_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Actor Email"},"action":{"type":"string","title":"Action"},"resource_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resource Type"},"resource_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resource Id"},"ip":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ip"},"user_agent":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Agent"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"}},"type":"object","required":["id","created_at","actor_developer_id","actor_email","action","resource_type","resource_id","ip","user_agent","metadata"],"title":"AdminAuditRow"},"AdminDeveloperDetail":{"properties":{"id":{"type":"string","title":"Id"},"email":{"type":"string","title":"Email"},"first_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Name"},"last_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Name"},"is_superuser":{"type":"boolean","title":"Is Superuser"},"email_verified_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Email Verified At"},"locked_until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Locked Until"},"failed_login_count":{"type":"integer","title":"Failed Login Count"},"password_version":{"type":"integer","title":"Password Version"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"organization":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Organization"},"subscription":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Subscription"},"api_key_count":{"type":"integer","title":"Api Key Count"},"end_user_count":{"type":"integer","title":"End User Count"},"recent_audit":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Recent Audit"}},"type":"object","required":["id","email","first_name","last_name","is_superuser","email_verified_at","locked_until","failed_login_count","password_version","created_at","updated_at","organization","subscription","api_key_count","end_user_count","recent_audit"],"title":"AdminDeveloperDetail"},"AdminDeveloperListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AdminDeveloperRow"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["items","total","limit","offset"],"title":"AdminDeveloperListResponse"},"AdminDeveloperRow":{"properties":{"id":{"type":"string","title":"Id"},"email":{"type":"string","title":"Email"},"first_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Name"},"last_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Name"},"is_superuser":{"type":"boolean","title":"Is Superuser"},"email_verified":{"type":"boolean","title":"Email Verified"},"locked_until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Locked Until"},"failed_login_count":{"type":"integer","title":"Failed Login Count"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"plan":{"type":"string","title":"Plan"},"subscription_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subscription Status"},"organization_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Organization Id"},"organization_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Organization Name"},"api_key_count":{"type":"integer","title":"Api Key Count"},"end_user_count":{"type":"integer","title":"End User Count"}},"type":"object","required":["id","email","first_name","last_name","is_superuser","email_verified","locked_until","failed_login_count","created_at","plan","subscription_status","organization_id","organization_name","api_key_count","end_user_count"],"title":"AdminDeveloperRow"},"AdminEndUserListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AdminEndUserRow"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["items","total","limit","offset"],"title":"AdminEndUserListResponse"},"AdminEndUserRow":{"properties":{"id":{"type":"string","title":"Id"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"first_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Name"},"last_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Name"},"external_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External User Id"},"developer_id":{"type":"string","title":"Developer Id"},"developer_email":{"type":"string","title":"Developer Email"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","email","first_name","last_name","external_user_id","developer_id","developer_email","created_at"],"title":"AdminEndUserRow"},"AdminGrowthDay":{"properties":{"date":{"type":"string","title":"Date"},"new_developers":{"type":"integer","title":"New Developers"},"new_end_users":{"type":"integer","title":"New End Users"}},"type":"object","required":["date","new_developers","new_end_users"],"title":"AdminGrowthDay"},"AdminInsightsResponse":{"properties":{"generated_at":{"type":"string","format":"date-time","title":"Generated At"},"funnel":{"items":{"$ref":"#/components/schemas/FunnelStep"},"type":"array","title":"Funnel"},"top_developers":{"items":{"$ref":"#/components/schemas/TopDeveloperRow"},"type":"array","title":"Top Developers"},"providers":{"items":{"$ref":"#/components/schemas/ProviderUsageRow"},"type":"array","title":"Providers"},"dau":{"items":{"$ref":"#/components/schemas/DauPoint"},"type":"array","title":"Dau"},"weekly_cohorts":{"items":{"$ref":"#/components/schemas/CohortCell"},"type":"array","title":"Weekly Cohorts"},"financials":{"$ref":"#/components/schemas/FinancialMetrics"},"plan_mix":{"items":{"$ref":"#/components/schemas/PlanMixRow"},"type":"array","title":"Plan Mix"},"usd_inr_rate":{"type":"number","title":"Usd Inr Rate"}},"type":"object","required":["generated_at","funnel","top_developers","providers","dau","weekly_cohorts","financials","plan_mix","usd_inr_rate"],"title":"AdminInsightsResponse"},"AdminInvoiceListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AdminInvoiceRow"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"},"summary":{"$ref":"#/components/schemas/RevenueSummary"}},"type":"object","required":["items","total","limit","offset","summary"],"title":"AdminInvoiceListResponse"},"AdminInvoiceRow":{"properties":{"id":{"type":"string","title":"Id"},"invoice_number":{"type":"string","title":"Invoice Number"},"developer_id":{"type":"string","title":"Developer Id"},"developer_email":{"type":"string","title":"Developer Email"},"plan_slug":{"type":"string","title":"Plan Slug"},"plan_name":{"type":"string","title":"Plan Name"},"amount_in_paise":{"type":"integer","title":"Amount In Paise"},"currency":{"type":"string","title":"Currency"},"status":{"type":"string","title":"Status"},"period_start":{"type":"string","format":"date-time","title":"Period Start"},"period_end":{"type":"string","format":"date-time","title":"Period End"},"razorpay_payment_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Razorpay Payment Id"},"razorpay_order_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Razorpay Order Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","invoice_number","developer_id","developer_email","plan_slug","plan_name","amount_in_paise","currency","status","period_start","period_end","razorpay_payment_id","razorpay_order_id","created_at"],"title":"AdminInvoiceRow"},"AdminJobsResponse":{"properties":{"generated_at":{"type":"string","format":"date-time","title":"Generated At"},"tasks":{"items":{"$ref":"#/components/schemas/BeatTaskRow"},"type":"array","title":"Tasks"}},"type":"object","required":["generated_at","tasks"],"title":"AdminJobsResponse"},"AdminOverviewResponse":{"properties":{"tenants":{"$ref":"#/components/schemas/AdminTenantCounts"},"activity":{"$ref":"#/components/schemas/AdminActivityCounts"},"queues":{"$ref":"#/components/schemas/AdminQueueCounters"},"plans":{"items":{"$ref":"#/components/schemas/AdminPlanRow"},"type":"array","title":"Plans"},"revenue":{"$ref":"#/components/schemas/AdminRevenueSummary"},"growth":{"items":{"$ref":"#/components/schemas/AdminGrowthDay"},"type":"array","title":"Growth"},"recent_developers":{"items":{"$ref":"#/components/schemas/AdminRecentDeveloper"},"type":"array","title":"Recent Developers"},"recent_end_users":{"items":{"$ref":"#/components/schemas/AdminRecentUser"},"type":"array","title":"Recent End Users"},"generated_at":{"type":"string","format":"date-time","title":"Generated At"}},"type":"object","required":["tenants","activity","queues","plans","revenue","growth","recent_developers","recent_end_users","generated_at"],"title":"AdminOverviewResponse"},"AdminPlanRow":{"properties":{"plan":{"type":"string","title":"Plan"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["plan","count"],"title":"AdminPlanRow"},"AdminQueueCounters":{"properties":{"nutrition_review_pending":{"type":"integer","title":"Nutrition Review Pending"},"nutrition_review_low_confidence":{"type":"integer","title":"Nutrition Review Low Confidence"},"support_tickets_open":{"type":"integer","title":"Support Tickets Open"},"locked_developers":{"type":"integer","title":"Locked Developers"},"failed_login_last_hour":{"type":"integer","title":"Failed Login Last Hour"},"unverified_developers":{"type":"integer","title":"Unverified Developers"}},"type":"object","required":["nutrition_review_pending","nutrition_review_low_confidence","support_tickets_open","locked_developers","failed_login_last_hour","unverified_developers"],"title":"AdminQueueCounters","description":"Things-to-do counters surfaced on the overview top-of-page strip.\n\nEach is a single COUNT query, deliberately cheap so we can refresh on\nevery overview load without thinking about it."},"AdminRecentDeveloper":{"properties":{"id":{"type":"string","title":"Id"},"email":{"type":"string","title":"Email"},"first_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Name"},"last_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Name"},"is_superuser":{"type":"boolean","title":"Is Superuser"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","email","first_name","last_name","is_superuser","created_at"],"title":"AdminRecentDeveloper"},"AdminRecentUser":{"properties":{"id":{"type":"string","title":"Id"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"first_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Name"},"last_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Name"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","email","first_name","last_name","created_at"],"title":"AdminRecentUser"},"AdminRevenueSummary":{"properties":{"mrr_inr":{"type":"integer","title":"Mrr Inr"},"mrr_paise":{"type":"integer","title":"Mrr Paise"},"mrr_usd":{"type":"number","title":"Mrr Usd"},"active_paying_subscriptions":{"type":"integer","title":"Active Paying Subscriptions"},"active_enterprise_subscriptions":{"type":"integer","title":"Active Enterprise Subscriptions"},"usd_inr_rate":{"type":"number","title":"Usd Inr Rate"}},"type":"object","required":["mrr_inr","mrr_paise","mrr_usd","active_paying_subscriptions","active_enterprise_subscriptions","usd_inr_rate"],"title":"AdminRevenueSummary","description":"Approximate MRR computed from `subscription` rows tagged status='active'.\n\nOnly the platform's own price book is consulted — we do NOT call out to\nRazorpay. Free/cancelled tiers contribute zero. Enterprise rows are\nexcluded from MRR (they are zero-priced in the price book; report the\nheadcount separately so the admin can mentally annotate)."},"AdminSubscriptionListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AdminSubscriptionRow"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["items","total","limit","offset"],"title":"AdminSubscriptionListResponse"},"AdminSubscriptionRow":{"properties":{"id":{"type":"string","title":"Id"},"developer_id":{"type":"string","title":"Developer Id"},"developer_email":{"type":"string","title":"Developer Email"},"plan":{"type":"string","title":"Plan"},"status":{"type":"string","title":"Status"},"current_period_end":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Current Period End"},"razorpay_subscription_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Razorpay Subscription Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","developer_id","developer_email","plan","status","current_period_end","razorpay_subscription_id","created_at","updated_at"],"title":"AdminSubscriptionRow"},"AdminSystemHealthResponse":{"properties":{"generated_at":{"type":"string","format":"date-time","title":"Generated At"},"db":{"$ref":"#/components/schemas/DbStats"},"redis":{"$ref":"#/components/schemas/RedisStats"},"celery":{"$ref":"#/components/schemas/CeleryStats"},"storage":{"$ref":"#/components/schemas/StorageStats"}},"type":"object","required":["generated_at","db","redis","celery","storage"],"title":"AdminSystemHealthResponse"},"AdminTenantCounts":{"properties":{"developers":{"type":"integer","title":"Developers"},"organizations":{"type":"integer","title":"Organizations"},"end_users":{"type":"integer","title":"End Users"},"api_keys":{"type":"integer","title":"Api Keys"}},"type":"object","required":["developers","organizations","end_users","api_keys"],"title":"AdminTenantCounts"},"Announcement":{"properties":{"id":{"type":"string","title":"Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"severity":{"type":"string","title":"Severity"},"title":{"type":"string","title":"Title"},"body":{"type":"string","title":"Body"},"cta_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cta Label"},"cta_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cta Url"},"active":{"type":"boolean","title":"Active"}},"type":"object","required":["id","created_at","severity","title","body","cta_label","cta_url","active"],"title":"Announcement"},"AnnouncementListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/Announcement"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"AnnouncementListResponse"},"ApiKeyCreatePayload":{"properties":{"name":{"type":"string","title":"Name","default":"Default"},"scope_type":{"anyOf":[{"type":"string","enum":["all","read_only","per_user"]},{"type":"null"}],"title":"Scope Type"},"allowed_user_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Allowed User Ids"},"allowed_providers":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Allowed Providers"},"allowed_ip_cidrs":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Allowed Ip Cidrs"}},"type":"object","title":"ApiKeyCreatePayload"},"ApiKeyRead":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"created_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Created By"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"scope_type":{"anyOf":[{"type":"string","enum":["all","read_only","per_user"]},{"type":"null"}],"title":"Scope Type","description":"Raw scope flag — null/'all' = unrestricted data API access; 'read_only' = mutations forbidden; 'per_user' = restricted to the user_ids in `allowed_user_ids`. None of these scopes can mint per-user SDK tokens — use a dashboard JWT or app credentials (app_id + app_secret) for that."},"allowed_user_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Allowed User Ids"},"allowed_providers":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Allowed Providers"},"allowed_ip_cidrs":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Allowed Ip Cidrs"},"prefix":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prefix"},"last4":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last4"},"scope_label":{"type":"string","title":"Scope Label","description":"Dashboard-friendly description of this key's scope.","readOnly":true},"can_mint_user_tokens":{"type":"boolean","title":"Can Mint User Tokens","description":"API keys never mint per-user SDK tokens — call out the limit explicitly.","readOnly":true}},"type":"object","required":["id","name","created_by","created_at","scope_label","can_mint_user_tokens"],"title":"ApiKeyRead"},"ApiKeyReadWithSecret":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"created_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Created By"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"scope_type":{"anyOf":[{"type":"string","enum":["all","read_only","per_user"]},{"type":"null"}],"title":"Scope Type","description":"Raw scope flag — null/'all' = unrestricted data API access; 'read_only' = mutations forbidden; 'per_user' = restricted to the user_ids in `allowed_user_ids`. None of these scopes can mint per-user SDK tokens — use a dashboard JWT or app credentials (app_id + app_secret) for that."},"allowed_user_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Allowed User Ids"},"allowed_providers":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Allowed Providers"},"allowed_ip_cidrs":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Allowed Ip Cidrs"},"prefix":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prefix"},"last4":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last4"},"value":{"type":"string","title":"Value"},"scope_label":{"type":"string","title":"Scope Label","description":"Dashboard-friendly description of this key's scope.","readOnly":true},"can_mint_user_tokens":{"type":"boolean","title":"Can Mint User Tokens","description":"API keys never mint per-user SDK tokens — call out the limit explicitly.","readOnly":true}},"type":"object","required":["id","name","created_by","created_at","value","scope_label","can_mint_user_tokens"],"title":"ApiKeyReadWithSecret","description":"Returned ONLY at creation time. `value` is the raw `sk-...` token the\ncaller must store — we will never be able to return it again because we\nonly persist sha256(value) from this point forward."},"ApiKeyUpdate":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"scope_type":{"anyOf":[{"type":"string","enum":["all","read_only","per_user"]},{"type":"null"}],"title":"Scope Type"},"allowed_user_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Allowed User Ids"},"allowed_providers":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Allowed Providers"},"allowed_ip_cidrs":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Allowed Ip Cidrs"}},"type":"object","title":"ApiKeyUpdate"},"ApplicationCreate":{"properties":{"name":{"type":"string","maxLength":100,"title":"Name"}},"type":"object","required":["name"],"title":"ApplicationCreate","description":"Schema for creating a new Application (external input)."},"ApplicationRead":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"app_id":{"type":"string","title":"App Id"},"name":{"type":"string","title":"Name"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","app_id","name","created_at"],"title":"ApplicationRead","description":"Schema for reading Application (without secret)."},"ApplicationReadWithSecret":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"app_id":{"type":"string","title":"App Id"},"name":{"type":"string","title":"Name"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"app_secret":{"type":"string","title":"App Secret"}},"type":"object","required":["id","app_id","name","created_at","app_secret"],"title":"ApplicationReadWithSecret","description":"Schema returned only on creation - contains plain app_secret."},"ArchivalSettingRead":{"properties":{"archive_after_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Archive After Days","description":"Days before live samples are aggregated into daily archive. NULL = archival disabled."},"delete_after_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Delete After Days","description":"Days before archived data is permanently removed. NULL = kept indefinitely."}},"type":"object","title":"ArchivalSettingRead","description":"Response schema for archival settings."},"ArchivalSettingUpdate":{"properties":{"archive_after_days":{"anyOf":[{"type":"integer","maximum":3650.0,"minimum":1.0},{"type":"null"}],"title":"Archive After Days","description":"Days before live data is archived. NULL to disable archival."},"delete_after_days":{"anyOf":[{"type":"integer","maximum":7300.0,"minimum":1.0},{"type":"null"}],"title":"Delete After Days","description":"Days before data is permanently deleted. NULL to keep indefinitely."}},"type":"object","title":"ArchivalSettingUpdate","description":"Request schema for updating archival settings."},"ArchivalSettingWithEstimate":{"properties":{"settings":{"$ref":"#/components/schemas/ArchivalSettingRead"},"storage":{"$ref":"#/components/schemas/StorageEstimate"}},"type":"object","required":["settings","storage"],"title":"ArchivalSettingWithEstimate","description":"Combined archival settings + storage estimates response."},"AuditLogRead":{"properties":{"id":{"type":"string","title":"Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"actor_developer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Actor Developer Id"},"action":{"type":"string","title":"Action"},"resource_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resource Type"},"resource_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resource Id"},"ip":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ip"},"user_agent":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Agent"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"}},"type":"object","required":["id","created_at","actor_developer_id","action","resource_type","resource_id","ip","user_agent","metadata"],"title":"AuditLogRead"},"AuthorizationURLResponse":{"properties":{"authorization_url":{"type":"string","title":"Authorization Url"},"state":{"type":"string","title":"State"}},"type":"object","required":["authorization_url","state"],"title":"AuthorizationURLResponse","description":"Response containing authorization URL for user redirect."},"BeatTaskRow":{"properties":{"name":{"type":"string","title":"Name"},"task":{"type":"string","title":"Task"},"schedule_repr":{"type":"string","title":"Schedule Repr"}},"type":"object","required":["name","task","schedule_repr"],"title":"BeatTaskRow"},"BloodPressure":{"properties":{"avg_systolic_mmhg":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Avg Systolic Mmhg","description":"Average systolic pressure","example":120},"avg_diastolic_mmhg":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Avg Diastolic Mmhg","description":"Average diastolic pressure","example":80},"max_systolic_mmhg":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Systolic Mmhg","description":"Maximum systolic pressure","example":135},"max_diastolic_mmhg":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Diastolic Mmhg","description":"Maximum diastolic pressure","example":90},"min_systolic_mmhg":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Min Systolic Mmhg","description":"Minimum systolic pressure","example":110},"min_diastolic_mmhg":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Min Diastolic Mmhg","description":"Minimum diastolic pressure","example":72},"reading_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Reading Count","description":"Number of readings in period","example":5}},"type":"object","title":"BloodPressure","description":"Blood pressure statistics aggregated over a period.\n\nValues are aggregated from multiple readings to provide a more representative measure."},"BodyAveraged":{"properties":{"period_days":{"type":"integer","title":"Period Days","description":"Number of days averaged (1 or 7)","example":7},"resting_heart_rate_bpm":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Resting Heart Rate Bpm","description":"Average resting heart rate","example":62},"avg_hrv_sdnn_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Hrv Sdnn Ms","description":"Average HRV (SDNN)","example":45.2},"period_start":{"type":"string","format":"date-time","title":"Period Start","description":"Start of averaging period"},"period_end":{"type":"string","format":"date-time","title":"Period End","description":"End of averaging period"}},"type":"object","required":["period_days","period_start","period_end"],"title":"BodyAveraged","description":"Vitals averaged over a configurable time period.\n\nThese metrics fluctuate daily and are more meaningful as averages.\nPeriod can be 1 day (current state) or 7 days (baseline trend)."},"BodyLatest":{"properties":{"body_temperature_celsius":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Body Temperature Celsius","description":"Body temperature if measured within time window","example":36.6},"body_temperature_measured_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Body Temperature Measured At","description":"When body temperature was measured (null if no recent reading)"},"skin_temperature_celsius":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Skin Temperature Celsius","description":"Skin temperature if measured within time window","example":36.6},"skin_temperature_measured_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Skin Temperature Measured At","description":"When skin temperature was measured (null if no recent reading)"},"blood_pressure":{"anyOf":[{"$ref":"#/components/schemas/BloodPressure"},{"type":"null"}],"description":"Blood pressure if measured within time window"},"blood_pressure_measured_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Blood Pressure Measured At","description":"When blood pressure was measured (null if no recent reading)"}},"type":"object","title":"BodyLatest","description":"Point-in-time metrics that are only relevant when recent.\n\nThese metrics are only returned if measured within a configurable time window.\nStale readings return null to avoid displaying outdated data."},"BodySlowChanging":{"properties":{"weight_kg":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Weight Kg","description":"Most recent weight measurement","example":72.5},"height_cm":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Height Cm","description":"Most recent height measurement","example":175.5},"body_fat_percent":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Body Fat Percent","description":"Most recent body fat percentage","example":18.5},"muscle_mass_kg":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Muscle Mass Kg","description":"Most recent muscle/lean body mass","example":58.2},"bmi":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Bmi","description":"Calculated from latest weight and height","example":23.5},"age":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Age","description":"Age in years calculated from birth date","example":32}},"type":"object","title":"BodySlowChanging","description":"Slow-changing body composition metrics.\n\nThese are metrics that change infrequently (days/weeks between measurements).\nReturns the most recent recorded value for each field."},"BodySummary":{"properties":{"source":{"$ref":"#/components/schemas/SourceMetadata"},"slow_changing":{"$ref":"#/components/schemas/BodySlowChanging"},"averaged":{"$ref":"#/components/schemas/BodyAveraged"},"latest":{"$ref":"#/components/schemas/BodyLatest"}},"type":"object","required":["source","slow_changing","averaged","latest"],"title":"BodySummary","description":"Comprehensive body metrics with semantic grouping.\n\nMetrics are grouped by their temporal characteristics:\n- slow_changing: Slow-changing values (latest measurement)\n- averaged: Vitals averaged over a period (1 or 7 days)\n- latest: Point-in-time readings (only if recent)"},"Body_import_xml_file_api_v1_users__user_id__import_apple_xml_direct_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_import_xml_file_api_v1_users__user_id__import_apple_xml_direct_post"},"Body_login_api_v1_auth_login_post":{"properties":{"otp_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Otp Code","description":"TOTP code if account has MFA enabled"},"grant_type":{"anyOf":[{"type":"string","pattern":"^password$"},{"type":"null"}],"title":"Grant Type"},"username":{"type":"string","title":"Username"},"password":{"type":"string","format":"password","title":"Password"},"scope":{"type":"string","title":"Scope","default":""},"client_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Id"},"client_secret":{"anyOf":[{"type":"string"},{"type":"null"}],"format":"password","title":"Client Secret"}},"type":"object","required":["username","password"],"title":"Body_login_api_v1_auth_login_post"},"Body_upload_meal_image_api_v1_nutrition_log_image_post":{"properties":{"file":{"anyOf":[{"type":"string","contentMediaType":"application/octet-stream"},{"type":"null"}],"title":"File","description":"Meal image (alias of 'image')."},"image":{"anyOf":[{"type":"string","contentMediaType":"application/octet-stream"},{"type":"null"}],"title":"Image","description":"Meal image (alias of 'file')."},"meal_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Meal Type"}},"type":"object","title":"Body_upload_meal_image_api_v1_nutrition_log_image_post"},"BulkActionRequest":{"properties":{"log_ids":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Log Ids"},"action":{"type":"string","title":"Action"}},"type":"object","required":["log_ids","action"],"title":"BulkActionRequest"},"BulkActionResult":{"properties":{"requested":{"type":"integer","title":"Requested"},"succeeded":{"type":"integer","title":"Succeeded"},"skipped":{"items":{"additionalProperties":{"type":"string"},"type":"object"},"type":"array","title":"Skipped"}},"type":"object","required":["requested","succeeded","skipped"],"title":"BulkActionResult"},"BulkProviderSettingsUpdate":{"properties":{"providers":{"additionalProperties":{"type":"boolean"},"type":"object","title":"Providers","description":"Map of provider_id -> is_enabled","examples":[{"apple":true,"garmin":true,"polar":false,"suunto":true}]}},"type":"object","required":["providers"],"title":"BulkProviderSettingsUpdate","description":"Schema for bulk updating provider settings."},"CancelResponse":{"properties":{"status":{"type":"string","title":"Status"},"plan":{"type":"string","title":"Plan"}},"type":"object","required":["status","plan"],"title":"CancelResponse"},"CeleryStats":{"properties":{"broker_reachable":{"type":"boolean","title":"Broker Reachable"},"queue_lengths":{"additionalProperties":{"type":"integer"},"type":"object","title":"Queue Lengths"},"registered_beat_tasks":{"type":"integer","title":"Registered Beat Tasks"},"active_workers":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Active Workers"}},"type":"object","required":["broker_reachable","queue_lengths","registered_beat_tasks","active_workers"],"title":"CeleryStats"},"CogsLine":{"properties":{"label":{"type":"string","title":"Label"},"units_label":{"type":"string","title":"Units Label"},"units_this_month":{"type":"number","title":"Units This Month"},"units_last_month":{"type":"number","title":"Units Last Month"},"rate_inr":{"type":"number","title":"Rate Inr"},"rate_usd":{"type":"number","title":"Rate Usd"},"cost_this_month_inr":{"type":"integer","title":"Cost This Month Inr"},"cost_this_month_usd":{"type":"number","title":"Cost This Month Usd"},"cost_last_month_inr":{"type":"integer","title":"Cost Last Month Inr"},"cost_last_month_usd":{"type":"number","title":"Cost Last Month Usd"}},"type":"object","required":["label","units_label","units_this_month","units_last_month","rate_inr","rate_usd","cost_this_month_inr","cost_this_month_usd","cost_last_month_inr","cost_last_month_usd"],"title":"CogsLine"},"CogsResponse":{"properties":{"period_this_month_start":{"type":"string","format":"date-time","title":"Period This Month Start"},"period_last_month_start":{"type":"string","format":"date-time","title":"Period Last Month Start"},"rates":{"additionalProperties":true,"type":"object","title":"Rates"},"lines":{"items":{"$ref":"#/components/schemas/CogsLine"},"type":"array","title":"Lines"},"total_this_month_inr":{"type":"integer","title":"Total This Month Inr"},"total_this_month_usd":{"type":"number","title":"Total This Month Usd"},"total_last_month_inr":{"type":"integer","title":"Total Last Month Inr"},"total_last_month_usd":{"type":"number","title":"Total Last Month Usd"},"revenue_this_month_inr":{"type":"integer","title":"Revenue This Month Inr"},"revenue_this_month_usd":{"type":"number","title":"Revenue This Month Usd"},"revenue_last_month_inr":{"type":"integer","title":"Revenue Last Month Inr"},"revenue_last_month_usd":{"type":"number","title":"Revenue Last Month Usd"},"gross_margin_this_month_pct":{"type":"number","title":"Gross Margin This Month Pct"},"gross_margin_last_month_pct":{"type":"number","title":"Gross Margin Last Month Pct"},"usd_inr_rate":{"type":"number","title":"Usd Inr Rate"},"plan_unit_economics":{"items":{"$ref":"#/components/schemas/PlanUnitEconomics"},"type":"array","title":"Plan Unit Economics"}},"type":"object","required":["period_this_month_start","period_last_month_start","rates","lines","total_this_month_inr","total_this_month_usd","total_last_month_inr","total_last_month_usd","revenue_this_month_inr","revenue_this_month_usd","revenue_last_month_inr","revenue_last_month_usd","gross_margin_this_month_pct","gross_margin_last_month_pct","usd_inr_rate","plan_unit_economics"],"title":"CogsResponse"},"CohortCell":{"properties":{"week":{"type":"string","title":"Week"},"cohort_size":{"type":"integer","title":"Cohort Size"},"week_offset":{"type":"integer","title":"Week Offset"},"retained":{"type":"integer","title":"Retained"},"retention_pct":{"type":"number","title":"Retention Pct"}},"type":"object","required":["week","cohort_size","week_offset","retained","retention_pct"],"title":"CohortCell"},"ComponentCheck":{"properties":{"name":{"type":"string","title":"Name"},"status":{"type":"string","enum":["operational","degraded","down"],"title":"Status"},"latency_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Latency Ms"},"detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Detail"}},"type":"object","required":["name","status","latency_ms"],"title":"ComponentCheck"},"ConnectionStatus":{"type":"string","enum":["active","revoked","expired"],"title":"ConnectionStatus","description":"Status of a user connection to a provider."},"ContactRequest":{"properties":{"name":{"type":"string","maxLength":200,"minLength":1,"title":"Name"},"email":{"type":"string","format":"email","title":"Email"},"company":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Company"},"message":{"type":"string","maxLength":5000,"minLength":10,"title":"Message"},"topic":{"type":"string","enum":["sales","support","enterprise","provider_credentials","other"],"title":"Topic","default":"sales"}},"type":"object","required":["name","email","message"],"title":"ContactRequest"},"CountWithGrowth":{"properties":{"count":{"type":"integer","title":"Count"},"weekly_growth":{"type":"number","title":"Weekly Growth"}},"type":"object","required":["count","weekly_growth"],"title":"CountWithGrowth","description":"Count with weekly growth percentage."},"CreateOrderRequest":{"properties":{"plan":{"type":"string","title":"Plan"},"currency":{"type":"string","title":"Currency","default":"USD"}},"type":"object","required":["plan"],"title":"CreateOrderRequest"},"CreateOrderResponse":{"properties":{"order_id":{"type":"string","title":"Order Id"},"key_id":{"type":"string","title":"Key Id"},"amount":{"type":"integer","title":"Amount"},"currency":{"type":"string","title":"Currency"},"plan":{"type":"string","title":"Plan"},"prefill_email":{"type":"string","title":"Prefill Email"},"prefill_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prefill Name"}},"type":"object","required":["order_id","key_id","amount","currency","plan","prefill_email","prefill_name"],"title":"CreateOrderResponse"},"DashboardOverview":{"properties":{"generated_at":{"type":"string","format":"date-time","title":"Generated At"},"subscription":{"anyOf":[{"$ref":"#/components/schemas/OverviewSubscription"},{"type":"null"}]},"counters":{"anyOf":[{"$ref":"#/components/schemas/OverviewCounters"},{"type":"null"}]},"usage":{"anyOf":[{"$ref":"#/components/schemas/OverviewUsage"},{"type":"null"}]},"onboarding":{"anyOf":[{"$ref":"#/components/schemas/OverviewOnboarding"},{"type":"null"}]},"recent_users":{"items":{"$ref":"#/components/schemas/RecentUser"},"type":"array","title":"Recent Users"},"errors":{"additionalProperties":{"$ref":"#/components/schemas/SectionError"},"type":"object","title":"Errors","default":{}}},"type":"object","required":["generated_at","subscription","counters","usage","onboarding","recent_users"],"title":"DashboardOverview"},"DataPointsInfo":{"properties":{"count":{"type":"integer","title":"Count"},"weekly_growth":{"type":"number","title":"Weekly Growth"},"top_series_types":{"items":{"$ref":"#/components/schemas/SeriesTypeMetric"},"type":"array","title":"Top Series Types"},"top_workout_types":{"items":{"$ref":"#/components/schemas/WorkoutTypeMetric"},"type":"array","title":"Top Workout Types"}},"type":"object","required":["count","weekly_growth","top_series_types","top_workout_types"],"title":"DataPointsInfo","description":"Data points information."},"DataSourceListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/DataSourceResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["items","total"],"title":"DataSourceListResponse"},"DataSourceResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"user_id":{"type":"string","format":"uuid","title":"User Id"},"provider":{"$ref":"#/components/schemas/ProviderName"},"user_connection_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"User Connection Id"},"device_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Device Model"},"software_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Software Version"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"device_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Device Type"},"original_source_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Original Source Name"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"}},"type":"object","required":["id","user_id","provider"],"title":"DataSourceResponse"},"DataTypeCount":{"properties":{"type":{"type":"string","title":"Type"},"count":{"type":"integer","minimum":0.0,"title":"Count"}},"type":"object","required":["type","count"],"title":"DataTypeCount","description":"Count of records for a specific data type."},"DauPoint":{"properties":{"date":{"type":"string","title":"Date"},"active":{"type":"integer","title":"Active"}},"type":"object","required":["date","active"],"title":"DauPoint"},"DbStats":{"properties":{"version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Version"},"database_size_pretty":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Database Size Pretty"},"largest_tables":{"items":{"$ref":"#/components/schemas/TableStat"},"type":"array","title":"Largest Tables"}},"type":"object","required":["version","database_size_pretty","largest_tables"],"title":"DbStats"},"DeveloperCreate":{"properties":{"first_name":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"First Name"},"last_name":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Last Name"},"email":{"type":"string","format":"email","title":"Email"},"password":{"type":"string","minLength":8,"title":"Password"}},"type":"object","required":["email","password"],"title":"DeveloperCreate"},"DeveloperRead":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"first_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Name"},"last_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Name"},"email":{"type":"string","format":"email","title":"Email"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"email_verified_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Email Verified At"},"is_superuser":{"type":"boolean","title":"Is Superuser","default":false}},"type":"object","required":["id","email","created_at","updated_at"],"title":"DeveloperRead"},"DeveloperUpdate":{"properties":{"first_name":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"First Name"},"last_name":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Last Name"},"email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Email"},"password":{"anyOf":[{"type":"string","minLength":8},{"type":"null"}],"title":"Password"}},"type":"object","title":"DeveloperUpdate"},"DeviceStateEvent":{"properties":{"eventType":{"type":"string","const":"device_state","title":"Eventtype"},"timestamp":{"type":"string","format":"date-time","title":"Timestamp"},"batteryLevel":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Batterylevel"},"batteryState":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Batterystate"},"isLowPowerMode":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Islowpowermode"},"thermalState":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Thermalstate"},"taskType":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tasktype"},"availableRamBytes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Availablerambytes"},"totalRamBytes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Totalrambytes"}},"type":"object","required":["eventType","timestamp"],"title":"DeviceStateEvent"},"DeviceType-Output":{"type":"string","enum":["watch","band","phone","scale","ring","other","unknown"],"title":"DeviceType","description":"Type of device that collected health data."},"DeviceTypePriorityBase":{"properties":{"device_type":{"$ref":"#/components/schemas/app__schemas__enums__device_type__DeviceType"},"priority":{"type":"integer","maximum":100.0,"minimum":1.0,"title":"Priority"}},"type":"object","required":["device_type","priority"],"title":"DeviceTypePriorityBase"},"DeviceTypePriorityBulkUpdate":{"properties":{"priorities":{"items":{"$ref":"#/components/schemas/DeviceTypePriorityBase"},"type":"array","title":"Priorities"}},"type":"object","required":["priorities"],"title":"DeviceTypePriorityBulkUpdate"},"DeviceTypePriorityListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/DeviceTypePriorityResponse"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"DeviceTypePriorityListResponse"},"DeviceTypePriorityResponse":{"properties":{"device_type":{"$ref":"#/components/schemas/DeviceType-Output"},"priority":{"type":"integer","maximum":100.0,"minimum":1.0,"title":"Priority"},"id":{"type":"string","format":"uuid","title":"Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["device_type","priority","id","created_at","updated_at"],"title":"DeviceTypePriorityResponse"},"DeviceTypePriorityUpdate":{"properties":{"priority":{"type":"integer","maximum":100.0,"minimum":1.0,"title":"Priority"}},"type":"object","required":["priority"],"title":"DeviceTypePriorityUpdate"},"DisableRequest":{"properties":{"password":{"type":"string","title":"Password"},"code":{"type":"string","maxLength":8,"minLength":6,"title":"Code"}},"type":"object","required":["password","code"],"title":"DisableRequest"},"EndpointCreateRequest":{"properties":{"url":{"type":"string","title":"Url","description":"HTTPS URL where webhook payloads will be sent."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Human-readable label for this endpoint."},"filter_types":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Filter Types","description":"Only deliver events of these types. Empty / None = all types."},"user_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"User Id","description":"Subscribe only to events for this user. Empty / None = all users."}},"type":"object","required":["url"],"title":"EndpointCreateRequest"},"EndpointResponse":{"properties":{"id":{"type":"string","title":"Id"},"url":{"type":"string","title":"Url"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"filter_types":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Filter Types"},"user_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"User Id"}},"type":"object","required":["id","url"],"title":"EndpointResponse"},"EndpointSecretResponse":{"properties":{"key":{"type":"string","title":"Key"}},"type":"object","required":["key"],"title":"EndpointSecretResponse"},"EndpointUpdateRequest":{"properties":{"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"filter_types":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Filter Types"},"user_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"User Id","description":"Subscribe only to events for this user. Pass null to remove the filter."}},"type":"object","title":"EndpointUpdateRequest"},"EventRecordResponse":{"properties":{"category":{"type":"string","title":"Category","description":"High-level category such as workout or sleep","default":"workout"},"type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type","description":"Provider-specific subtype, e.g. running"},"source_name":{"type":"string","title":"Source Name","description":"Source/app name"},"device_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Device Model","description":"Device model/name for data source tracking"},"duration_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Seconds"},"start_datetime":{"type":"string","format":"date-time","title":"Start Datetime"},"end_datetime":{"type":"string","format":"date-time","title":"End Datetime"},"zone_offset":{"anyOf":[{"type":"string","maxLength":10,"pattern":"^[+-]\\d{2}:\\d{2}$"},{"type":"null"}],"title":"Zone Offset","description":"Timezone offset in the format '+01:00' or '-05:30'","examples":["+01:00","-05:30"]},"id":{"type":"string","format":"uuid","title":"Id"},"external_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Id"},"user_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"User Id"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"data_source_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Data Source Id"}},"type":"object","required":["source_name","start_datetime","end_datetime","id","external_id","user_id","source","data_source_id"],"title":"EventRecordResponse","description":"Schema returned to API consumers."},"EventTypeResponse":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"child_events":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Child Events"}},"type":"object","required":["name","description"],"title":"EventTypeResponse"},"FinancialMetrics":{"properties":{"arpu_usd":{"type":"number","title":"Arpu Usd"},"arpu_inr":{"type":"integer","title":"Arpu Inr"},"ltv_usd":{"type":"number","title":"Ltv Usd"},"ltv_inr":{"type":"integer","title":"Ltv Inr"},"estimated_lifespan_months":{"type":"number","title":"Estimated Lifespan Months"},"churn_rate_pct":{"type":"number","title":"Churn Rate Pct"},"active_subscriptions":{"type":"integer","title":"Active Subscriptions"},"cancelled_subscriptions":{"type":"integer","title":"Cancelled Subscriptions"},"free_to_paid_conversion_pct":{"type":"number","title":"Free To Paid Conversion Pct"},"paying_developers":{"type":"integer","title":"Paying Developers"},"free_developers":{"type":"integer","title":"Free Developers"}},"type":"object","required":["arpu_usd","arpu_inr","ltv_usd","ltv_inr","estimated_lifespan_months","churn_rate_pct","active_subscriptions","cancelled_subscriptions","free_to_paid_conversion_pct","paying_developers","free_developers"],"title":"FinancialMetrics"},"ForgotPasswordRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"}},"type":"object","required":["email"],"title":"ForgotPasswordRequest"},"FunnelStep":{"properties":{"label":{"type":"string","title":"Label"},"count":{"type":"integer","title":"Count"},"pct_of_top":{"type":"number","title":"Pct Of Top"}},"type":"object","required":["label","count","pct_of_top"],"title":"FunnelStep"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HealthScoreCategory":{"type":"string","enum":["sleep","recovery","readiness","activity","stress","resilience","body_battery","strain"],"title":"HealthScoreCategory"},"HealthScoreResponse":{"properties":{"category":{"$ref":"#/components/schemas/HealthScoreCategory"},"value":{"anyOf":[{"type":"number"},{"type":"integer"},{"type":"null"}],"title":"Value","description":"Overall numeric score. Range varies by provider and category — see HEALTH_SCORE_RANGES for scale."},"qualifier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Qualifier","description":"Textual rating from the provider, e.g. GOOD or EXCELLENT"},"recorded_at":{"type":"string","format":"date-time","title":"Recorded At"},"zone_offset":{"anyOf":[{"type":"string","maxLength":10,"pattern":"^[+-]\\d{2}:\\d{2}$"},{"type":"null"}],"title":"Zone Offset","description":"Timezone offset in the format '+01:00' or '-05:30'","examples":["+01:00","-05:30"]},"components":{"anyOf":[{"additionalProperties":{"$ref":"#/components/schemas/ScoreComponent"},"type":"object"},{"type":"null"}],"title":"Components"},"id":{"type":"string","format":"uuid","title":"Id"},"data_source_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Data Source Id"},"provider":{"anyOf":[{"$ref":"#/components/schemas/ProviderName"},{"type":"null"}]}},"type":"object","required":["category","recorded_at","id","data_source_id","provider"],"title":"HealthScoreResponse"},"HeartRateStats":{"properties":{"avg_bpm":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Avg Bpm"},"max_bpm":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Bpm"},"min_bpm":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Min Bpm"}},"type":"object","title":"HeartRateStats","description":"Heart rate statistics for a period."},"HistoricalDataSyncStartEvent":{"properties":{"eventType":{"type":"string","const":"historical_data_sync_start","title":"Eventtype"},"timestamp":{"type":"string","format":"date-time","title":"Timestamp"},"dataTypeCounts":{"items":{"$ref":"#/components/schemas/DataTypeCount"},"type":"array","title":"Datatypecounts"},"timeRange":{"anyOf":[{"$ref":"#/components/schemas/TimeRange"},{"type":"null"}]}},"type":"object","required":["eventType","timestamp"],"title":"HistoricalDataSyncStartEvent"},"HistoricalDataTypeSyncEndEvent":{"properties":{"eventType":{"type":"string","const":"historical_data_type_sync_end","title":"Eventtype"},"timestamp":{"type":"string","format":"date-time","title":"Timestamp"},"dataType":{"type":"string","title":"Datatype"},"success":{"type":"boolean","title":"Success"},"recordCount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Recordcount"},"durationMs":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Durationms"}},"type":"object","required":["eventType","timestamp","dataType","success"],"title":"HistoricalDataTypeSyncEndEvent"},"IntensityMinutes":{"properties":{"light":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Light"},"moderate":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Moderate"},"vigorous":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Vigorous"}},"type":"object","title":"IntensityMinutes"},"InvitationAccept":{"properties":{"token":{"type":"string","title":"Token"},"first_name":{"type":"string","maxLength":100,"minLength":1,"title":"First Name","strip_whitespace":true},"last_name":{"type":"string","maxLength":100,"minLength":1,"title":"Last Name","strip_whitespace":true},"password":{"type":"string","minLength":8,"title":"Password"}},"type":"object","required":["token","first_name","last_name","password"],"title":"InvitationAccept","description":"Schema for accepting an invitation."},"InvitationCodeRedeemResponse":{"properties":{"access_token":{"type":"string","title":"Access Token"},"token_type":{"type":"string","title":"Token Type","default":"bearer"},"refresh_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Refresh Token"},"expires_in":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expires In"},"developer_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Developer Id"},"user_id":{"type":"string","format":"uuid","title":"User Id"}},"type":"object","required":["access_token","user_id"],"title":"InvitationCodeRedeemResponse","description":"Redeem response with user_id included."},"InvitationCreate":{"properties":{"email":{"type":"string","format":"email","title":"Email"}},"type":"object","required":["email"],"title":"InvitationCreate","description":"Schema for creating a new invitation (API input)."},"InvitationRead":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"email":{"type":"string","title":"Email"},"status":{"$ref":"#/components/schemas/InvitationStatus"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"invited_by_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Invited By Id"}},"type":"object","required":["id","email","status","expires_at","created_at"],"title":"InvitationRead","description":"Schema for reading invitation data."},"InvitationStatus":{"type":"string","enum":["pending","sent","failed","accepted","expired","revoked"],"title":"InvitationStatus"},"InvoiceRead":{"properties":{"id":{"type":"string","title":"Id"},"invoice_number":{"type":"string","title":"Invoice Number"},"plan_name":{"type":"string","title":"Plan Name"},"plan_slug":{"type":"string","title":"Plan Slug"},"amount_in_paise":{"type":"integer","title":"Amount In Paise"},"currency":{"type":"string","title":"Currency"},"period_start":{"type":"string","format":"date-time","title":"Period Start"},"period_end":{"type":"string","format":"date-time","title":"Period End"},"status":{"type":"string","title":"Status"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"razorpay_payment_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Razorpay Payment Id"}},"type":"object","required":["id","invoice_number","plan_name","plan_slug","amount_in_paise","currency","period_start","period_end","status","created_at","razorpay_payment_id"],"title":"InvoiceRead"},"ItemPatch":{"properties":{"dish_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dish Name"},"quantity_grams":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Quantity Grams"},"calories_kcal":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Calories Kcal"},"protein_g":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Protein G"},"carbs_g":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Carbs G"},"fat_g":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Fat G"}},"type":"object","title":"ItemPatch"},"MemberRead":{"properties":{"id":{"type":"string","title":"Id"},"developer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Developer Id"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"role":{"type":"string","title":"Role"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","developer_id","email","role","created_at"],"title":"MemberRead"},"MetricRecord":{"properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id"},"parentId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parentid"},"type":{"anyOf":[{"$ref":"#/components/schemas/SDKMetricType"},{"type":"string"},{"type":"null"}],"title":"Type"},"startDate":{"type":"string","format":"date-time","title":"Startdate"},"endDate":{"type":"string","format":"date-time","title":"Enddate"},"zoneOffset":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Zoneoffset"},"source":{"anyOf":[{"$ref":"#/components/schemas/SourceInfo"},{"type":"null"}]},"value":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}],"title":"Value"},"unit":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Unit"},"metadata":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"}},"type":"object","required":["startDate","endDate","value","unit"],"title":"MetricRecord","description":"Health metric record from HealthKit (heart rate, steps, distance, etc.)."},"MfaStatus":{"properties":{"enabled":{"type":"boolean","title":"Enabled"}},"type":"object","required":["enabled"],"title":"MfaStatus"},"NutritionLogCreateManual":{"properties":{"meal_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Meal Type"},"detected_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Detected At"},"items":{"items":{"$ref":"#/components/schemas/NutritionLogItemManualEntry"},"type":"array","title":"Items"}},"type":"object","title":"NutritionLogCreateManual"},"NutritionLogImageAccepted":{"properties":{"job_id":{"type":"string","format":"uuid","title":"Job Id"},"log_id":{"type":"string","format":"uuid","title":"Log Id"},"status":{"type":"string","enum":["pending","recognized","manual","discarded"],"title":"Status","default":"pending"}},"type":"object","required":["job_id","log_id"],"title":"NutritionLogImageAccepted"},"NutritionLogItemManualEntry":{"properties":{"dish_name":{"type":"string","title":"Dish Name"},"quantity_grams":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Quantity Grams"},"calories_kcal":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Calories Kcal"},"protein_g":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Protein G"},"carbs_g":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Carbs G"},"fat_g":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Fat G"}},"type":"object","required":["dish_name"],"title":"NutritionLogItemManualEntry"},"NutritionLogItemPatch":{"properties":{"dish_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dish Name"},"quantity_grams":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Quantity Grams"},"calories_kcal":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Calories Kcal"},"protein_g":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Protein G"},"carbs_g":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Carbs G"},"fat_g":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Fat G"}},"type":"object","title":"NutritionLogItemPatch"},"NutritionLogItemRead":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"dish_name":{"type":"string","title":"Dish Name"},"quantity_grams":{"anyOf":[{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Quantity Grams"},"quantity_uncertainty":{"anyOf":[{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Quantity Uncertainty"},"food_db_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Food Db Source"},"food_db_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Food Db Id"},"calories_kcal":{"anyOf":[{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Calories Kcal"},"protein_g":{"anyOf":[{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Protein G"},"carbs_g":{"anyOf":[{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Carbs G"},"fat_g":{"anyOf":[{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Fat G"},"fiber_g":{"anyOf":[{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Fiber G"},"sugar_g":{"anyOf":[{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Sugar G"},"sodium_mg":{"anyOf":[{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Sodium Mg"},"is_corrected":{"type":"boolean","title":"Is Corrected"}},"type":"object","required":["id","dish_name","is_corrected"],"title":"NutritionLogItemRead"},"NutritionLogRead":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"user_id":{"type":"string","format":"uuid","title":"User Id"},"detected_at":{"type":"string","format":"date-time","title":"Detected At"},"meal_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Meal Type"},"status":{"type":"string","enum":["pending","recognized","manual","discarded"],"title":"Status"},"confidence_score":{"anyOf":[{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Confidence Score"},"vision_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vision Model"},"human_reviewed":{"type":"boolean","title":"Human Reviewed"},"items":{"items":{"$ref":"#/components/schemas/NutritionLogItemRead"},"type":"array","title":"Items"}},"type":"object","required":["id","user_id","detected_at","status","human_reviewed","items"],"title":"NutritionLogRead"},"NutritionSummaryDay":{"properties":{"date":{"type":"string","format":"date","title":"Date"},"total_calories_kcal":{"anyOf":[{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Total Calories Kcal"},"total_protein_g":{"anyOf":[{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Total Protein G"},"total_carbs_g":{"anyOf":[{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Total Carbs G"},"total_fat_g":{"anyOf":[{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Total Fat G"},"log_count":{"type":"integer","title":"Log Count"}},"type":"object","required":["date","log_count"],"title":"NutritionSummaryDay"},"NutritionSummaryResponse":{"properties":{"user_id":{"type":"string","format":"uuid","title":"User Id"},"days":{"items":{"$ref":"#/components/schemas/NutritionSummaryDay"},"type":"array","title":"Days"}},"type":"object","required":["user_id","days"],"title":"NutritionSummaryResponse"},"OSVersion":{"properties":{"majorVersion":{"type":"integer","title":"Majorversion"},"minorVersion":{"type":"integer","title":"Minorversion"},"patchVersion":{"type":"integer","title":"Patchversion"}},"type":"object","required":["majorVersion","minorVersion","patchVersion"],"title":"OSVersion","description":"Operating system version info from HealthKit source."},"OldPaginatedResponse_UserRead_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/UserRead"},"type":"array","title":"Items"},"total":{"type":"integer","minimum":0.0,"title":"Total","description":"Total number of items matching the query"},"page":{"type":"integer","minimum":1.0,"title":"Page","description":"Current page number (1-based)"},"limit":{"type":"integer","exclusiveMinimum":0.0,"title":"Limit","description":"Number of items per page"},"pages":{"type":"integer","title":"Pages","description":"Total number of pages.","readOnly":true},"has_next":{"type":"boolean","title":"Has Next","description":"Whether there is a next page.","readOnly":true},"has_prev":{"type":"boolean","title":"Has Prev","description":"Whether there is a previous page.","readOnly":true}},"type":"object","required":["items","total","page","limit","pages","has_next","has_prev"],"title":"OldPaginatedResponse[UserRead]"},"OnboardingProgress":{"properties":{"has_api_key":{"type":"boolean","title":"Has Api Key"},"has_provider_credentials":{"type":"boolean","title":"Has Provider Credentials"},"has_user":{"type":"boolean","title":"Has User"},"has_first_event":{"type":"boolean","title":"Has First Event"}},"type":"object","required":["has_api_key","has_provider_credentials","has_user","has_first_event"],"title":"OnboardingProgress"},"OrgRead":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"billing_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Billing Email"},"slug":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Slug"},"retention_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Retention Days"}},"type":"object","required":["id","name","billing_email","slug"],"title":"OrgRead"},"OverviewCounters":{"properties":{"users_total":{"type":"integer","title":"Users Total"},"providers_enabled":{"type":"integer","title":"Providers Enabled"},"events_total":{"type":"integer","title":"Events Total"},"api_keys":{"type":"integer","title":"Api Keys"}},"type":"object","required":["users_total","providers_enabled","events_total","api_keys"],"title":"OverviewCounters"},"OverviewOnboarding":{"properties":{"has_api_key":{"type":"boolean","title":"Has Api Key"},"has_provider_credentials":{"type":"boolean","title":"Has Provider Credentials"},"has_user":{"type":"boolean","title":"Has User"},"has_first_event":{"type":"boolean","title":"Has First Event"}},"type":"object","required":["has_api_key","has_provider_credentials","has_user","has_first_event"],"title":"OverviewOnboarding"},"OverviewSubscription":{"properties":{"plan":{"type":"string","title":"Plan"},"status":{"type":"string","title":"Status"},"current_period_end":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Current Period End"},"razorpay_configured":{"type":"boolean","title":"Razorpay Configured"}},"type":"object","required":["plan","status","current_period_end","razorpay_configured"],"title":"OverviewSubscription"},"OverviewUsage":{"properties":{"api_calls":{"type":"integer","title":"Api Calls"},"api_calls_limit":{"type":"integer","title":"Api Calls Limit"},"synced_users_limit":{"type":"integer","title":"Synced Users Limit"}},"type":"object","required":["api_calls","api_calls_limit","synced_users_limit"],"title":"OverviewUsage"},"PaginatedResponse_ActivitySummary_":{"properties":{"data":{"items":{"$ref":"#/components/schemas/ActivitySummary"},"type":"array","title":"Data"},"pagination":{"$ref":"#/components/schemas/Pagination"},"metadata":{"$ref":"#/components/schemas/TimeseriesMetadata"}},"type":"object","required":["data","pagination","metadata"],"title":"PaginatedResponse[ActivitySummary]"},"PaginatedResponse_HealthScoreResponse_":{"properties":{"data":{"items":{"$ref":"#/components/schemas/HealthScoreResponse"},"type":"array","title":"Data"},"pagination":{"$ref":"#/components/schemas/Pagination"},"metadata":{"$ref":"#/components/schemas/TimeseriesMetadata"}},"type":"object","required":["data","pagination","metadata"],"title":"PaginatedResponse[HealthScoreResponse]"},"PaginatedResponse_RecoverySummary_":{"properties":{"data":{"items":{"$ref":"#/components/schemas/RecoverySummary"},"type":"array","title":"Data"},"pagination":{"$ref":"#/components/schemas/Pagination"},"metadata":{"$ref":"#/components/schemas/TimeseriesMetadata"}},"type":"object","required":["data","pagination","metadata"],"title":"PaginatedResponse[RecoverySummary]"},"PaginatedResponse_SleepSession_":{"properties":{"data":{"items":{"$ref":"#/components/schemas/SleepSession"},"type":"array","title":"Data"},"pagination":{"$ref":"#/components/schemas/Pagination"},"metadata":{"$ref":"#/components/schemas/TimeseriesMetadata"}},"type":"object","required":["data","pagination","metadata"],"title":"PaginatedResponse[SleepSession]"},"PaginatedResponse_SleepSummary_":{"properties":{"data":{"items":{"$ref":"#/components/schemas/SleepSummary"},"type":"array","title":"Data"},"pagination":{"$ref":"#/components/schemas/Pagination"},"metadata":{"$ref":"#/components/schemas/TimeseriesMetadata"}},"type":"object","required":["data","pagination","metadata"],"title":"PaginatedResponse[SleepSummary]"},"PaginatedResponse_TimeSeriesSample_":{"properties":{"data":{"items":{"$ref":"#/components/schemas/TimeSeriesSample"},"type":"array","title":"Data"},"pagination":{"$ref":"#/components/schemas/Pagination"},"metadata":{"$ref":"#/components/schemas/TimeseriesMetadata"}},"type":"object","required":["data","pagination","metadata"],"title":"PaginatedResponse[TimeSeriesSample]"},"PaginatedResponse_WebhookMessageAttemptResponse_":{"properties":{"data":{"items":{"$ref":"#/components/schemas/WebhookMessageAttemptResponse"},"type":"array","title":"Data"},"done":{"type":"boolean","title":"Done","description":"True when this is the last page."},"iterator":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Iterator","description":"Pass as `iterator` in the next request to fetch the following page."},"prevIterator":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Previterator"}},"type":"object","required":["data","done"],"title":"PaginatedResponse[WebhookMessageAttemptResponse]"},"PaginatedResponse_WebhookMessageResponse_":{"properties":{"data":{"items":{"$ref":"#/components/schemas/WebhookMessageResponse"},"type":"array","title":"Data"},"done":{"type":"boolean","title":"Done","description":"True when this is the last page."},"iterator":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Iterator","description":"Pass as `iterator` in the next request to fetch the following page."},"prevIterator":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Previterator"}},"type":"object","required":["data","done"],"title":"PaginatedResponse[WebhookMessageResponse]"},"PaginatedResponse_Workout_":{"properties":{"data":{"items":{"$ref":"#/components/schemas/Workout-Output"},"type":"array","title":"Data"},"pagination":{"$ref":"#/components/schemas/Pagination"},"metadata":{"$ref":"#/components/schemas/TimeseriesMetadata"}},"type":"object","required":["data","pagination","metadata"],"title":"PaginatedResponse[Workout]"},"Pagination":{"properties":{"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Cursor to fetch next page, null if no more data","example":"eyJpZCI6IjEyMzQ1Njc4OTAiLCJ0cyI6MTcwNDA2NzIwMH0"},"previous_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Previous Cursor","description":"Cursor to fetch previous page"},"has_more":{"type":"boolean","title":"Has More","description":"Whether more data is available"},"total_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total Count","description":"Total number of records matching the query","example":150}},"type":"object","required":["has_more"],"title":"Pagination"},"PasswordChange":{"properties":{"current_password":{"type":"string","title":"Current Password"},"new_password":{"type":"string","minLength":8,"title":"New Password"},"confirm_password":{"type":"string","minLength":8,"title":"Confirm Password"}},"type":"object","required":["current_password","new_password","confirm_password"],"title":"PasswordChange"},"PlanMixRow":{"properties":{"plan":{"type":"string","title":"Plan"},"active":{"type":"integer","title":"Active"},"cancelled":{"type":"integer","title":"Cancelled"},"monthly_inr":{"type":"integer","title":"Monthly Inr"},"monthly_usd":{"type":"number","title":"Monthly Usd"},"contributing_mrr_inr":{"type":"integer","title":"Contributing Mrr Inr"},"contributing_mrr_usd":{"type":"number","title":"Contributing Mrr Usd"},"pct_of_mrr":{"type":"number","title":"Pct Of Mrr"}},"type":"object","required":["plan","active","cancelled","monthly_inr","monthly_usd","contributing_mrr_inr","contributing_mrr_usd","pct_of_mrr"],"title":"PlanMixRow"},"PlanRead":{"properties":{"slug":{"type":"string","title":"Slug"},"name":{"type":"string","title":"Name"},"amount_in_paise":{"type":"integer","title":"Amount In Paise"},"amount_in_cents_usd":{"type":"integer","title":"Amount In Cents Usd"},"currency":{"type":"string","title":"Currency"},"description":{"type":"string","title":"Description"},"end_users":{"type":"integer","title":"End Users"},"webhook_deliveries_per_day":{"type":"integer","title":"Webhook Deliveries Per Day"},"api_calls_per_month":{"type":"integer","title":"Api Calls Per Month"}},"type":"object","required":["slug","name","amount_in_paise","amount_in_cents_usd","currency","description","end_users","webhook_deliveries_per_day","api_calls_per_month"],"title":"PlanRead"},"PlanUnitEconomics":{"properties":{"plan":{"type":"string","title":"Plan"},"monthly_price_inr":{"type":"integer","title":"Monthly Price Inr"},"monthly_price_usd":{"type":"number","title":"Monthly Price Usd"},"nutrition_image_cap_per_day":{"type":"integer","title":"Nutrition Image Cap Per Day"},"daily_ai_cost_at_cap_inr":{"type":"number","title":"Daily Ai Cost At Cap Inr"},"daily_ai_cost_at_cap_usd":{"type":"number","title":"Daily Ai Cost At Cap Usd"},"monthly_ai_cost_at_cap_inr":{"type":"number","title":"Monthly Ai Cost At Cap Inr"},"monthly_ai_cost_at_cap_usd":{"type":"number","title":"Monthly Ai Cost At Cap Usd"},"margin_inr_at_cap":{"type":"integer","title":"Margin Inr At Cap"},"margin_usd_at_cap":{"type":"number","title":"Margin Usd At Cap"},"margin_pct_at_cap":{"type":"number","title":"Margin Pct At Cap"}},"type":"object","required":["plan","monthly_price_inr","monthly_price_usd","nutrition_image_cap_per_day","daily_ai_cost_at_cap_inr","daily_ai_cost_at_cap_usd","monthly_ai_cost_at_cap_inr","monthly_ai_cost_at_cap_usd","margin_inr_at_cap","margin_usd_at_cap","margin_pct_at_cap"],"title":"PlanUnitEconomics","description":"Per-plan unit economics — what we charge vs. what each unit costs us.\n\nHelps the admin sanity-check that paying tiers stay profitable as the\ndaily-image cap rises (e.g. Scale's 5,000 photos/day at the AI rate must\nnot eat the whole monthly fee before storage and webhook fan-out)."},"PresignedURLRequest":{"properties":{"filename":{"type":"string","maxLength":200,"title":"Filename","description":"Custom filename","default":""},"expiration_seconds":{"type":"integer","maximum":3600.0,"minimum":60.0,"title":"Expiration Seconds","description":"URL expiration time in seconds (1 min - 1 hour)","default":300},"max_file_size":{"type":"integer","maximum":1073741824.0,"minimum":1024.0,"title":"Max File Size","description":"Maximum file size in bytes (1KB - 500MB)","default":52428800}},"type":"object","title":"PresignedURLRequest"},"PresignedURLResponse":{"properties":{"upload_url":{"type":"string","title":"Upload Url"},"form_fields":{"additionalProperties":{"type":"string"},"type":"object","title":"Form Fields"},"file_key":{"type":"string","title":"File Key"},"expires_in":{"type":"integer","title":"Expires In"},"max_file_size":{"type":"integer","title":"Max File Size"},"bucket":{"type":"string","title":"Bucket"}},"type":"object","required":["upload_url","form_fields","file_key","expires_in","max_file_size","bucket"],"title":"PresignedURLResponse"},"ProviderDataCount":{"properties":{"provider":{"type":"string","title":"Provider"},"data_points":{"type":"integer","title":"Data Points"},"series_counts":{"additionalProperties":{"type":"integer"},"type":"object","title":"Series Counts"},"workout_count":{"type":"integer","title":"Workout Count"},"sleep_count":{"type":"integer","title":"Sleep Count"}},"type":"object","required":["provider","data_points","series_counts","workout_count","sleep_count"],"title":"ProviderDataCount","description":"Data counts for a single provider."},"ProviderName":{"type":"string","enum":["apple","samsung","google","garmin","polar","suunto","whoop","strava","oura","fitbit","ultrahuman","withings","dexcom","eight_sleep","unknown","internal"],"title":"ProviderName","description":"Supported data providers."},"ProviderPriorityBase":{"properties":{"provider":{"$ref":"#/components/schemas/ProviderName"},"priority":{"type":"integer","maximum":100.0,"minimum":1.0,"title":"Priority"}},"type":"object","required":["provider","priority"],"title":"ProviderPriorityBase"},"ProviderPriorityBulkUpdate":{"properties":{"priorities":{"items":{"$ref":"#/components/schemas/ProviderPriorityBase"},"type":"array","title":"Priorities"}},"type":"object","required":["priorities"],"title":"ProviderPriorityBulkUpdate"},"ProviderPriorityListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ProviderPriorityResponse"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"ProviderPriorityListResponse"},"ProviderPriorityResponse":{"properties":{"provider":{"$ref":"#/components/schemas/ProviderName"},"priority":{"type":"integer","maximum":100.0,"minimum":1.0,"title":"Priority"},"id":{"type":"string","format":"uuid","title":"Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["provider","priority","id","created_at","updated_at"],"title":"ProviderPriorityResponse"},"ProviderPriorityUpdate":{"properties":{"priority":{"type":"integer","maximum":100.0,"minimum":1.0,"title":"Priority"}},"type":"object","required":["priority"],"title":"ProviderPriorityUpdate"},"ProviderSettingRead":{"properties":{"provider":{"type":"string","title":"Provider","description":"Provider identifier (e.g., 'apple', 'garmin')"},"name":{"type":"string","title":"Name","description":"Display name (e.g., 'Apple Health', 'Garmin')"},"has_cloud_api":{"type":"boolean","title":"Has Cloud Api","description":"Whether provider uses cloud OAuth API"},"is_enabled":{"type":"boolean","title":"Is Enabled","description":"Whether provider is enabled by admin"},"is_configured":{"type":"boolean","title":"Is Configured","description":"True when the provider can actually be connected end-to-end. For OAuth providers, true iff client_id+client_secret are loaded. For SDK-push / native providers, always True.","default":true},"is_oauth_flow":{"type":"boolean","title":"Is Oauth Flow","description":"True when the provider is connected through the WearLink OAuth redirect flow. False for native-SDK / on-device providers like Apple Health (HealthKit), Samsung Health, and Google Health Connect — those don't use our /oauth/{provider}/authorize URL and clients should drive the platform-native handshake instead.","default":true},"oauth_ready":{"type":"boolean","title":"Oauth Ready","description":"Convenience flag: ``is_enabled and is_configured and is_oauth_flow``. Use ``?ready_only=true`` on GET /oauth/providers to filter to just these. Lets clients render a 'Connect' button without manually combining the three flags.","default":false},"icon_url":{"type":"string","title":"Icon Url","description":"Relative URL to provider icon (e.g., '/static/provider-icons/garmin.svg'). Resolve against the API base URL."}},"type":"object","required":["provider","name","has_cloud_api","is_enabled","icon_url"],"title":"ProviderSettingRead","description":"Provider setting with metadata."},"ProviderSettingUpdate":{"properties":{"is_enabled":{"type":"boolean","title":"Is Enabled"}},"type":"object","required":["is_enabled"],"title":"ProviderSettingUpdate","description":"Schema for updating provider setting."},"ProviderSetupBucket":{"properties":{"provider":{"type":"string","title":"Provider"},"name":{"type":"string","title":"Name"},"is_oauth_flow":{"type":"boolean","title":"Is Oauth Flow"}},"type":"object","required":["provider","name","is_oauth_flow"],"title":"ProviderSetupBucket","description":"One bucket entry — kept light because /setup-status is polled."},"ProviderUsageRow":{"properties":{"provider":{"type":"string","title":"Provider"},"connections":{"type":"integer","title":"Connections"}},"type":"object","required":["provider","connections"],"title":"ProviderUsageRow"},"PublicHealthResponse":{"properties":{"status":{"type":"string","enum":["operational","degraded","down"],"title":"Status"},"checked_at":{"type":"string","format":"date-time","title":"Checked At"},"components":{"items":{"$ref":"#/components/schemas/ComponentCheck"},"type":"array","title":"Components"}},"type":"object","required":["status","checked_at","components"],"title":"PublicHealthResponse"},"PublicResendRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"}},"type":"object","required":["email"],"title":"PublicResendRequest"},"PublishPayload":{"properties":{"severity":{"type":"string","pattern":"^(info|warning|critical)$","title":"Severity","default":"info"},"title":{"type":"string","maxLength":200,"minLength":1,"title":"Title"},"body":{"type":"string","maxLength":2000,"minLength":1,"title":"Body"},"cta_label":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}],"title":"Cta Label"},"cta_url":{"anyOf":[{"type":"string","maxLength":400},{"type":"null"}],"title":"Cta Url"}},"type":"object","required":["title","body"],"title":"PublishPayload"},"RecentUser":{"properties":{"id":{"type":"string","title":"Id"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"external_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External User Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","email","external_user_id","created_at"],"title":"RecentUser"},"RecordingMethod":{"type":"string","enum":["active","automatic","manual","unknown"],"title":"RecordingMethod","description":"Recording method for HealthKit records."},"RecoverySummary":{"properties":{"date":{"type":"string","format":"date","title":"Date"},"source":{"$ref":"#/components/schemas/SourceMetadata"},"sleep_duration_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Sleep Duration Seconds"},"sleep_efficiency_percent":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Sleep Efficiency Percent"},"resting_heart_rate_bpm":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Resting Heart Rate Bpm"},"avg_hrv_sdnn_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Hrv Sdnn Ms","description":"Average HRV (SDNN)"},"avg_spo2_percent":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Spo2 Percent"},"recovery_score":{"anyOf":[{"type":"integer","maximum":100.0,"minimum":0.0},{"type":"null"}],"title":"Recovery Score","description":"0-100 score"}},"type":"object","required":["date","source"],"title":"RecoverySummary"},"RedisStats":{"properties":{"reachable":{"type":"boolean","title":"Reachable"},"used_memory_human":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Used Memory Human"},"connected_clients":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Connected Clients"},"total_commands_processed":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total Commands Processed"}},"type":"object","required":["reachable","used_memory_human","connected_clients","total_commands_processed"],"title":"RedisStats"},"RefundPayload":{"properties":{"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"}},"type":"object","title":"RefundPayload"},"ResetPasswordRequest":{"properties":{"token":{"type":"string","title":"Token"},"password":{"type":"string","title":"Password"}},"type":"object","required":["token","password"],"title":"ResetPasswordRequest"},"ResolvePayload":{"properties":{"resolved":{"type":"boolean","title":"Resolved","default":true},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"}},"type":"object","title":"ResolvePayload"},"RetentionUpdateRequest":{"properties":{"retention_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Retention Days"}},"type":"object","required":["retention_days"],"title":"RetentionUpdateRequest"},"RevenueSummary":{"properties":{"mrr_inr":{"type":"integer","title":"Mrr Inr"},"arr_inr":{"type":"integer","title":"Arr Inr"},"mrr_paise":{"type":"integer","title":"Mrr Paise"},"mrr_usd":{"type":"number","title":"Mrr Usd"},"arr_usd":{"type":"number","title":"Arr Usd"},"active_paying_subscriptions":{"type":"integer","title":"Active Paying Subscriptions"},"active_enterprise_subscriptions":{"type":"integer","title":"Active Enterprise Subscriptions"},"plan_breakdown":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Plan Breakdown"},"invoiced_this_month_inr":{"type":"integer","title":"Invoiced This Month Inr"},"invoiced_this_month_usd":{"type":"number","title":"Invoiced This Month Usd"},"invoiced_last_month_inr":{"type":"integer","title":"Invoiced Last Month Inr"},"invoiced_last_month_usd":{"type":"number","title":"Invoiced Last Month Usd"},"refunded_this_month_inr":{"type":"integer","title":"Refunded This Month Inr"},"refunded_this_month_usd":{"type":"number","title":"Refunded This Month Usd"},"pct_change_mom":{"type":"number","title":"Pct Change Mom"},"usd_inr_rate":{"type":"number","title":"Usd Inr Rate"}},"type":"object","required":["mrr_inr","arr_inr","mrr_paise","mrr_usd","arr_usd","active_paying_subscriptions","active_enterprise_subscriptions","plan_breakdown","invoiced_this_month_inr","invoiced_this_month_usd","invoiced_last_month_inr","invoiced_last_month_usd","refunded_this_month_inr","refunded_this_month_usd","pct_change_mom","usd_inr_rate"],"title":"RevenueSummary"},"ReviewQueueRow":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"user_id":{"type":"string","format":"uuid","title":"User Id"},"developer_id":{"type":"string","format":"uuid","title":"Developer Id"},"detected_at":{"type":"string","format":"date-time","title":"Detected At"},"status":{"type":"string","title":"Status"},"confidence_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence Score"},"item_count":{"type":"integer","title":"Item Count"},"has_image":{"type":"boolean","title":"Has Image"}},"type":"object","required":["id","user_id","developer_id","detected_at","status","confidence_score","item_count","has_image"],"title":"ReviewQueueRow"},"ReviewedLog":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"user_id":{"type":"string","format":"uuid","title":"User Id"},"detected_at":{"type":"string","format":"date-time","title":"Detected At"},"status":{"type":"string","title":"Status"},"confidence_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence Score"},"vision_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vision Model"},"raw_response_jsonb":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Raw Response Jsonb"},"image_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Image Url"},"items":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Items"}},"type":"object","required":["id","user_id","detected_at","status","confidence_score","vision_model","raw_response_jsonb","image_url","items"],"title":"ReviewedLog"},"RoleUpdateRequest":{"properties":{"role":{"type":"string","title":"Role"}},"type":"object","required":["role"],"title":"RoleUpdateRequest"},"RunNowResponse":{"properties":{"name":{"type":"string","title":"Name"},"task":{"type":"string","title":"Task"},"celery_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Celery Id"},"enqueued_at":{"type":"string","format":"date-time","title":"Enqueued At"}},"type":"object","required":["name","task","celery_id","enqueued_at"],"title":"RunNowResponse"},"SDKLogRequest":{"properties":{"sdkVersion":{"type":"string","title":"Sdkversion"},"provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider"},"events":{"items":{"oneOf":[{"$ref":"#/components/schemas/HistoricalDataSyncStartEvent"},{"$ref":"#/components/schemas/HistoricalDataTypeSyncEndEvent"},{"$ref":"#/components/schemas/DeviceStateEvent"}],"discriminator":{"propertyName":"eventType","mapping":{"device_state":"#/components/schemas/DeviceStateEvent","historical_data_sync_start":"#/components/schemas/HistoricalDataSyncStartEvent","historical_data_type_sync_end":"#/components/schemas/HistoricalDataTypeSyncEndEvent"}}},"type":"array","maxItems":100,"minItems":1,"title":"Events"}},"type":"object","required":["sdkVersion","events"],"title":"SDKLogRequest","description":"Top-level request for SDK log events endpoint."},"SDKMetricType":{"type":"string","enum":["HKQuantityTypeIdentifierHeartRate","HEART_RATE","HKQuantityTypeIdentifierRestingHeartRate","RESTING_HEART_RATE","HKQuantityTypeIdentifierHeartRateVariabilitySDNN","HEART_RATE_VARIABILITY","HKQuantityTypeIdentifierHeartRateRecoveryOneMinute","HKQuantityTypeIdentifierWalkingHeartRateAverage","HKQuantityTypeIdentifierOxygenSaturation","OXYGEN_SATURATION","HKQuantityTypeIdentifierBloodGlucose","BLOOD_GLUCOSE","HKQuantityTypeIdentifierBloodPressureSystolic","BLOOD_PRESSURE_SYSTOLIC","HKQuantityTypeIdentifierBloodPressureDiastolic","BLOOD_PRESSURE_DIASTOLIC","HKQuantityTypeIdentifierRespiratoryRate","RESPIRATORY_RATE","HKQuantityTypeIdentifierHeight","HEIGHT","WEIGHT","HKQuantityTypeIdentifierBodyMass","LEAN_BODY_MASS","SKELETAL_MUSCLE_MASS","BODY_FAT_MASS","HKQuantityTypeIdentifierBodyFatPercentage","BODY_FAT","HKQuantityTypeIdentifierBodyMassIndex","BMI","HKQuantityTypeIdentifierLeanBodyMass","HKQuantityTypeIdentifierBodyTemperature","BODY_TEMPERATURE","HKQuantityTypeIdentifierVO2Max","VO2_MAX","HKQuantityTypeIdentifierSixMinuteWalkTestDistance","HKQuantityTypeIdentifierStepCount","STEP_COUNT","HKQuantityTypeIdentifierActiveEnergyBurned","HKQuantityTypeIdentifierBasalEnergyBurned","ACTIVE_CALORIES_BURNED","BASAL_METABOLIC_RATE","HKQuantityTypeIdentifierAppleStandTime","HKQuantityTypeIdentifierAppleExerciseTime","HKQuantityTypeIdentifierFlightsClimbed","FLOORS_CLIMBED","DISTANCE","HKQuantityTypeIdentifierDistanceWalkingRunning","HKQuantityTypeIdentifierDistanceCycling","HKQuantityTypeIdentifierDistanceSwimming","HKQuantityTypeIdentifierDistanceDownhillSnowSports","HKQuantityTypeIdentifierDistancePaddleSports","HKQuantityTypeIdentifierDistanceRowing","HKQuantityTypeIdentifierDistanceSkatingSports","HKQuantityTypeIdentifierDistanceWheelchair","HKQuantityTypeIdentifierDistanceCrossCountrySkiing","HKQuantityTypeIdentifierWalkingStepLength","HKQuantityTypeIdentifierWalkingSpeed","HKQuantityTypeIdentifierWalkingDoubleSupportPercentage","HKQuantityTypeIdentifierWalkingAsymmetryPercentage","HKQuantityTypeIdentifierAppleWalkingSteadiness","HKQuantityTypeIdentifierStairDescentSpeed","HKQuantityTypeIdentifierStairAscentSpeed","HKQuantityTypeIdentifierRunningPower","HKQuantityTypeIdentifierRunningSpeed","HKQuantityTypeIdentifierRunningVerticalOscillation","HKQuantityTypeIdentifierRunningGroundContactTime","HKQuantityTypeIdentifierRunningStrideLength","HKQuantityTypeIdentifierSwimmingStrokeCount","HKQuantityTypeIdentifierEnvironmentalAudioExposure","HKQuantityTypeIdentifierHeadphoneAudioExposure","HKQuantityTypeIdentifierEnvironmentalSoundReduction","HKQuantityTypeIdentifierTimeInDaylight","HKQuantityTypeIdentifierPhysicalEffort","HKQuantityTypeIdentifierWorkoutEffortScore","HKQuantityTypeIdentifierEstimatedWorkoutEffortScore","HKQuantityTypeIdentifierAppleMoveTime","HKQuantityTypeIdentifierAppleSleepingWristTemperature","HKQuantityTypeIdentifierBloodAlcoholContent","HKQuantityTypeIdentifierPeripheralPerfusionIndex","HKQuantityTypeIdentifierForcedVitalCapacity","HKQuantityTypeIdentifierForcedExpiratoryVolume1","HKQuantityTypeIdentifierPeakExpiratoryFlowRate","HKQuantityTypeIdentifierBasalBodyTemperature","HKQuantityTypeIdentifierAppleSleepingBreathingDisturbances","HKQuantityTypeIdentifierWaistCircumference","HKQuantityTypeIdentifierInsulinDelivery","HKQuantityTypeIdentifierNumberOfTimesFallen","HKQuantityTypeIdentifierInhalerUsage","HKQuantityTypeIdentifierNumberOfAlcoholicBeverages","HYDRATION","HKQuantityTypeIdentifierElectrodermalActivity","HKQuantityTypeIdentifierUVExposure","HKQuantityTypeIdentifierPushCount","HKQuantityTypeIdentifierAtrialFibrillationBurden","HKQuantityTypeIdentifierUnderwaterDepth","HKQuantityTypeIdentifierWaterTemperature","HKQuantityTypeIdentifierCyclingCadence","HKQuantityTypeIdentifierCyclingFunctionalThresholdPower","HKQuantityTypeIdentifierCyclingPower","HKQuantityTypeIdentifierCyclingSpeed","POWER","SPEED","CYCLING_PEDALING_CADENCE","TOTAL_CALORIES_BURNED","HKQuantityTypeIdentifierCrossCountrySkiingSpeed","HKQuantityTypeIdentifierPaddleSportsSpeed","HKQuantityTypeIdentifierRowingSpeed","HKQuantityTypeIdentifierNikeFuel"],"title":"SDKMetricType","description":"Metric type identifiers for Apple HealthKit and Samsung/Health Connect SDK.\n\nApple types use HKQuantityTypeIdentifier... strings.\nSamsung/HC types use uppercase SCREAMING_SNAKE_CASE strings (e.g. \"HEART_RATE\")."},"SDKTokenRequest":{"properties":{"app_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"App Id"},"app_secret":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"App Secret"}},"type":"object","title":"SDKTokenRequest","description":"Request schema for exchanging app credentials for user token.\n\nBoth fields are optional - if not provided, admin authentication is required."},"SDKWorkoutType":{"type":"string","enum":["walking","running","cycling","wheelchair_walk","wheelchair_run","hand_cycling","elliptical","stair_climbing","stairs","jump_rope","core_training","functional_strength_training","strength_training","cross_training","mixed_cardio","hiit","step_training","fitness_gaming","preparation_and_recovery","flexibility","cooldown","barre","cardio_dance","social_dance","yoga","mind_and_body","pilates","american_football","australian_football","baseball","basketball","cricket","disc_sports","handball","hockey","lacrosse","rugby","soccer","softball","volleyball","badminton","pickleball","racquetball","squash","table_tennis","tennis","climbing","equestrian","fishing","golf","hiking","hunting","play","cross_country_skiing","curling","downhill_skiing","snow_sports","snowboarding","skating","paddle_sports","rowing","sailing","surfing","swimming","underwater_diving","water_fitness","water_polo","water_sports","boxing","kickboxing","martial_arts","tai_chi","wrestling","archery","bowling","fencing","gymnastics","track_and_field","swim_bike_run","transition","dance","dance_inspired_training","mixed_metabolic_cardio_training","cycling_stationary","boot_camp","calisthenics","dancing","exercise_class","football_american","football_australian","frisbee_disc","guided_breathing","ice_hockey","ice_skating","paddling","paragliding","rock_climbing","roller_hockey","rowing_machine","running_treadmill","scuba_diving","skiing","snowshoeing","stair_climbing_machine","stretching","swimming_open_water","swimming_pool","weightlifting","wheelchair","other"],"title":"SDKWorkoutType","description":"Apple HealthKit SDK workout activity types.\n\nThese are the workout types sent from the iOS SDK in snake_case format."},"ScoreComponent":{"properties":{"value":{"anyOf":[{"type":"number"},{"type":"integer"},{"type":"null"}],"title":"Value","description":"Numeric score value. Range varies by provider and category — see HEALTH_SCORE_RANGES for scale."},"qualifier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Qualifier","description":"Textual rating from the provider, e.g. GOOD or EXCELLENT"}},"type":"object","title":"ScoreComponent","description":"A single constituent of a health score (e.g. deep sleep percentage)."},"SectionError":{"properties":{"code":{"type":"string","title":"Code"},"message":{"type":"string","title":"Message"}},"type":"object","required":["code","message"],"title":"SectionError"},"SeedDataRequest":{"properties":{"num_users":{"type":"integer","maximum":10.0,"minimum":1.0,"title":"Num Users","default":1},"profile":{"$ref":"#/components/schemas/SeedProfileConfig","default":{"generate_workouts":true,"generate_sleep":true,"generate_time_series":true,"num_connections":2,"workout_config":{"count":80,"date_range_months":6,"duration_max_minutes":180,"duration_min_minutes":15,"hr_max_range":[140,180],"hr_min_range":[90,120],"steps_range":[500,20000]},"sleep_config":{"count":20,"date_range_months":6,"duration_max_minutes":600,"duration_min_minutes":300,"nap_chance_pct":10,"stage_distribution":{"awake_pct_range":[2,8],"deep_pct_range":[15,25],"rem_pct_range":[20,25]},"weekend_catchup":false},"time_series_config":{"date_range_months":6,"enabled_types":[],"include_blood_pressure":false}}},"random_seed":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Random Seed","description":"Seed for reproducible generation. None = random."}},"type":"object","title":"SeedDataRequest","description":"API request to generate seed data."},"SeedDataResponse":{"properties":{"task_id":{"type":"string","title":"Task Id"},"status":{"type":"string","title":"Status"},"seed_used":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Seed Used"}},"type":"object","required":["task_id","status"],"title":"SeedDataResponse","description":"API response after dispatching seed task."},"SeedPresetInfo":{"properties":{"id":{"type":"string","title":"Id"},"label":{"type":"string","title":"Label"},"description":{"type":"string","title":"Description"},"profile":{"$ref":"#/components/schemas/SeedProfileConfig"}},"type":"object","required":["id","label","description","profile"],"title":"SeedPresetInfo","description":"Preset metadata returned by the presets endpoint."},"SeedProfileConfig":{"properties":{"preset":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Preset"},"generate_workouts":{"type":"boolean","title":"Generate Workouts","default":true},"generate_sleep":{"type":"boolean","title":"Generate Sleep","default":true},"generate_time_series":{"type":"boolean","title":"Generate Time Series","default":true},"providers":{"anyOf":[{"items":{"$ref":"#/components/schemas/ProviderName"},"type":"array"},{"type":"null"}],"title":"Providers","description":"Specific providers. None = random selection."},"num_connections":{"type":"integer","maximum":5.0,"minimum":1.0,"title":"Num Connections","default":2},"workout_config":{"$ref":"#/components/schemas/WorkoutConfig","default":{"count":80,"duration_min_minutes":15,"duration_max_minutes":180,"hr_min_range":[90,120],"hr_max_range":[140,180],"steps_range":[500,20000],"date_range_months":6}},"sleep_config":{"$ref":"#/components/schemas/SleepConfig","default":{"count":20,"duration_min_minutes":300,"duration_max_minutes":600,"nap_chance_pct":10,"weekend_catchup":false,"date_range_months":6,"stage_distribution":{"awake_pct_range":[2,8],"deep_pct_range":[15,25],"rem_pct_range":[20,25]}}},"time_series_config":{"$ref":"#/components/schemas/TimeSeriesConfig","default":{"enabled_types":[],"include_blood_pressure":false,"date_range_months":6}}},"type":"object","title":"SeedProfileConfig","description":"Complete seed data generation configuration."},"SeriesType":{"type":"string","enum":["heart_rate","resting_heart_rate","heart_rate_variability_sdnn","heart_rate_recovery_one_minute","walking_heart_rate_average","recovery_score","heart_rate_variability_rmssd","oxygen_saturation","blood_glucose","blood_pressure_systolic","blood_pressure_diastolic","respiratory_rate","sleeping_breathing_disturbances","breathing_disturbance_index","blood_alcohol_content","peripheral_perfusion_index","forced_vital_capacity","forced_expiratory_volume_1","peak_expiratory_flow_rate","height","weight","body_fat_percentage","body_mass_index","lean_body_mass","body_temperature","skin_temperature","skin_temperature_deviation","skin_temperature_trend_deviation","waist_circumference","body_fat_mass","skeletal_muscle_mass","vo2_max","six_minute_walk_test_distance","cardiovascular_age","steps","energy","basal_energy","stand_time","exercise_time","physical_effort","flights_climbed","average_met","distance_walking_running","distance_cycling","distance_swimming","distance_downhill_snow_sports","distance_other","walking_step_length","walking_speed","walking_double_support_percentage","walking_asymmetry_percentage","walking_steadiness","stair_descent_speed","stair_ascent_speed","running_power","running_speed","running_vertical_oscillation","running_ground_contact_time","running_stride_length","swimming_stroke_count","underwater_depth","cadence","power","speed","workout_effort_score","estimated_workout_effort_score","environmental_audio_exposure","headphone_audio_exposure","environmental_sound_reduction","time_in_daylight","water_temperature","uv_exposure","inhaler_usage","weather_temperature","weather_humidity","garmin_stress_level","garmin_skin_temperature","garmin_fitness_age","garmin_body_battery","electrodermal_activity","push_count","atrial_fibrillation_burden","insulin_delivery","number_of_times_fallen","number_of_alcoholic_beverages","nike_fuel","hydration"],"title":"SeriesType","description":"All supported time-series metric types."},"SeriesTypeMetric":{"properties":{"series_type":{"type":"string","title":"Series Type"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["series_type","count"],"title":"SeriesTypeMetric","description":"Series type metric information."},"SetupStatusResponse":{"properties":{"api_key_scope":{"type":"string","enum":["developer_jwt","api_key:all","api_key:read_only","api_key:per_user","api_key:unknown"],"title":"Api Key Scope","description":"Auth path used by the current request. Two-tier scopes: `developer_jwt` is admin-equivalent (can mint user tokens, manage credentials); `api_key:*` is data-only (cannot mint user tokens). If you're trying to call POST /users/{id}/token and seeing 'Either app credentials or admin authentication is required', this field is why."},"app_credentials_present":{"type":"boolean","title":"App Credentials Present","description":"True iff the developer has at least one Application registered (app_id + app_secret). Required to mint per-user SDK tokens without a dashboard JWT."},"application_count":{"type":"integer","title":"Application Count","description":"Total Application rows registered for this developer."},"providers_configured":{"items":{"$ref":"#/components/schemas/ProviderSetupBucket"},"type":"array","title":"Providers Configured","description":"Providers that are end-to-end ready for OAuth connect (is_enabled && is_configured && is_oauth_flow)."},"providers_pending":{"items":{"$ref":"#/components/schemas/ProviderSetupBucket"},"type":"array","title":"Providers Pending","description":"OAuth-flow providers that don't yet have client_id/secret loaded — show as 'Coming soon' in your UI."},"providers_native":{"items":{"$ref":"#/components/schemas/ProviderSetupBucket"},"type":"array","title":"Providers Native","description":"Providers connected via on-device native SDK paths (Apple HealthKit, Samsung Health, Google Health Connect). These don't appear in the OAuth redirect flow."},"webhooks_registered":{"items":{"$ref":"#/components/schemas/WebhookEndpointSummary"},"type":"array","title":"Webhooks Registered","description":"Active outgoing-webhook endpoints (Svix). Empty list means events are still being emitted but not delivered anywhere."},"webhooks_enabled":{"type":"boolean","title":"Webhooks Enabled","description":"False when the platform's webhook subsystem isn't configured — in that case `webhooks_registered` is always empty."}},"type":"object","required":["api_key_scope","app_credentials_present","application_count","webhooks_enabled"],"title":"SetupStatusResponse","description":"Top-level response — see GET /setup-status."},"SleepConfig":{"properties":{"count":{"type":"integer","maximum":365.0,"minimum":0.0,"title":"Count","default":20},"duration_min_minutes":{"type":"integer","maximum":720.0,"minimum":60.0,"title":"Duration Min Minutes","default":300},"duration_max_minutes":{"type":"integer","maximum":720.0,"minimum":60.0,"title":"Duration Max Minutes","default":600},"nap_chance_pct":{"type":"integer","maximum":100.0,"minimum":0.0,"title":"Nap Chance Pct","default":10},"weekend_catchup":{"type":"boolean","title":"Weekend Catchup","description":"If True, weekday sleep is shorter and weekend sleep is longer.","default":false},"date_range_months":{"type":"integer","maximum":24.0,"minimum":1.0,"title":"Date Range Months","default":6},"date_from":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Date From","description":"Explicit start date. Overrides date_range_months."},"date_to":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Date To","description":"Explicit end date. Overrides date_range_months."},"stage_profile":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stage Profile","description":"Named sleep stage profile. None = use stage_distribution."},"stage_distribution":{"$ref":"#/components/schemas/SleepStageDistribution","default":{"deep_pct_range":[15,25],"rem_pct_range":[20,25],"awake_pct_range":[2,8]}}},"type":"object","title":"SleepConfig","description":"Parameters controlling sleep generation."},"SleepPhase":{"type":"string","enum":["in_bed","sleeping","awake","light","deep","rem","unknown"],"title":"SleepPhase"},"SleepRecord":{"properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id"},"parentId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parentid"},"stage":{"anyOf":[{"$ref":"#/components/schemas/SleepPhase"},{"type":"string"}],"title":"Stage"},"startDate":{"type":"string","format":"date-time","title":"Startdate"},"endDate":{"type":"string","format":"date-time","title":"Enddate"},"zoneOffset":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Zoneoffset"},"source":{"anyOf":[{"$ref":"#/components/schemas/SourceInfo"},{"type":"null"}]},"values":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Values"},"metadata":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"}},"type":"object","required":["stage","startDate","endDate"],"title":"SleepRecord","description":"Sleep analysis record from HealthKit."},"SleepSession":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"start_time":{"type":"string","format":"date-time","title":"Start Time"},"end_time":{"type":"string","format":"date-time","title":"End Time"},"zone_offset":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Zone Offset"},"source":{"$ref":"#/components/schemas/SourceMetadata"},"duration_seconds":{"type":"integer","title":"Duration Seconds"},"sleep_duration_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Sleep Duration Seconds"},"efficiency_percent":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Efficiency Percent"},"stages":{"anyOf":[{"$ref":"#/components/schemas/SleepStagesSummary"},{"type":"null"}]},"sleep_stage_intervals":{"anyOf":[{"items":{"$ref":"#/components/schemas/SleepStage"},"type":"array"},{"type":"null"}],"title":"Sleep Stage Intervals"},"is_nap":{"type":"boolean","title":"Is Nap","default":false}},"type":"object","required":["id","start_time","end_time","source","duration_seconds"],"title":"SleepSession"},"SleepStage":{"properties":{"stage":{"$ref":"#/components/schemas/SleepStageType"},"start_time":{"type":"string","format":"date-time","title":"Start Time"},"end_time":{"type":"string","format":"date-time","title":"End Time"}},"type":"object","required":["stage","start_time","end_time"],"title":"SleepStage","description":"A single continuous sleep stage interval stored inside the JSONB column."},"SleepStageDistribution":{"properties":{"deep_pct_range":{"prefixItems":[{"type":"integer"},{"type":"integer"}],"type":"array","maxItems":2,"minItems":2,"title":"Deep Pct Range","default":[15,25]},"rem_pct_range":{"prefixItems":[{"type":"integer"},{"type":"integer"}],"type":"array","maxItems":2,"minItems":2,"title":"Rem Pct Range","default":[20,25]},"awake_pct_range":{"prefixItems":[{"type":"integer"},{"type":"integer"}],"type":"array","maxItems":2,"minItems":2,"title":"Awake Pct Range","default":[2,8]}},"type":"object","title":"SleepStageDistribution","description":"Percentage ranges for each sleep stage. Light = remainder (100% - others)."},"SleepStageType":{"type":"string","enum":["in_bed","awake","sleeping","light","deep","rem","unknown"],"title":"SleepStageType"},"SleepStagesSummary":{"properties":{"awake_minutes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Awake Minutes"},"light_minutes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Light Minutes"},"deep_minutes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Deep Minutes"},"rem_minutes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Rem Minutes"}},"type":"object","title":"SleepStagesSummary"},"SleepSummary":{"properties":{"date":{"type":"string","format":"date","title":"Date"},"source":{"$ref":"#/components/schemas/SourceMetadata"},"start_time":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Start Time"},"end_time":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"End Time"},"duration_minutes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Minutes","description":"Total sleep duration excluding naps","example":450},"time_in_bed_minutes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Time In Bed Minutes","description":"Total time in bed excluding naps","example":480},"efficiency_percent":{"anyOf":[{"type":"number","maximum":100.0,"minimum":0.0},{"type":"null"}],"title":"Efficiency Percent","example":89.5},"stages":{"anyOf":[{"$ref":"#/components/schemas/SleepStagesSummary"},{"type":"null"}]},"interruptions_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Interruptions Count"},"nap_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Nap Count","description":"Number of naps taken","example":1},"nap_duration_minutes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Nap Duration Minutes","description":"Total nap duration","example":30},"avg_heart_rate_bpm":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Avg Heart Rate Bpm"},"avg_hrv_sdnn_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Hrv Sdnn Ms","description":"Average HRV (SDNN) during sleep"},"avg_respiratory_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Respiratory Rate"},"avg_spo2_percent":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Spo2 Percent"}},"type":"object","required":["date","source"],"title":"SleepSummary"},"SourceInfo":{"properties":{"appId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Appid"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"bundleIdentifier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bundleidentifier"},"version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Version"},"productType":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Producttype"},"operatingSystemVersion":{"anyOf":[{"$ref":"#/components/schemas/OSVersion"},{"type":"null"}]},"deviceId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Deviceid"},"deviceName":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Devicename"},"deviceManufacturer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Devicemanufacturer"},"deviceType":{"anyOf":[{"$ref":"#/components/schemas/app__schemas__providers__mobile_sdk__sync_request__DeviceType"},{"type":"string"},{"type":"null"}],"title":"Devicetype"},"deviceModel":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Devicemodel"},"deviceHardwareVersion":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Devicehardwareversion"},"deviceSoftwareVersion":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Devicesoftwareversion"},"recordingMethod":{"anyOf":[{"$ref":"#/components/schemas/RecordingMethod"},{"type":"string"},{"type":"null"}],"title":"Recordingmethod"}},"type":"object","title":"SourceInfo","description":"Source/device information for HealthKit records."},"SourceMetadata":{"properties":{"provider":{"type":"string","title":"Provider","example":"apple_health"},"device":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Device","example":"Apple Watch Series 9"}},"type":"object","required":["provider"],"title":"SourceMetadata"},"StartEnrollmentResponse":{"properties":{"secret":{"type":"string","title":"Secret"},"provisioning_uri":{"type":"string","title":"Provisioning Uri"}},"type":"object","required":["secret","provisioning_uri"],"title":"StartEnrollmentResponse"},"StorageEstimate":{"properties":{"live_data_bytes":{"type":"integer","title":"Live Data Bytes","description":"Data size of data_point_series table (bytes)"},"live_index_bytes":{"type":"integer","title":"Live Index Bytes","description":"Index size of data_point_series table (bytes)"},"archive_data_bytes":{"type":"integer","title":"Archive Data Bytes","description":"Data size of archive table (bytes)"},"archive_index_bytes":{"type":"integer","title":"Archive Index Bytes","description":"Index size of archive table (bytes)"},"other_tables_bytes":{"type":"integer","title":"Other Tables Bytes","description":"Total size of all other tables (bytes)"},"total_bytes":{"type":"integer","title":"Total Bytes","description":"Total storage across ALL tables"},"live_row_count":{"type":"integer","title":"Live Row Count","description":"Number of rows in live table"},"archive_row_count":{"type":"integer","title":"Archive Row Count","description":"Number of rows in archive table"},"avg_bytes_per_live_row":{"type":"number","title":"Avg Bytes Per Live Row","description":"Average bytes per live row (data+index)"},"avg_bytes_per_archive_row":{"type":"number","title":"Avg Bytes Per Archive Row","description":"Average bytes per archive row (data+index)"},"live_data_span_days":{"type":"integer","title":"Live Data Span Days","description":"Actual span of live data in days (MAX - MIN recorded_at)"},"live_total_pretty":{"type":"string","title":"Live Total Pretty","description":"Human-readable live total size (data+indexes)"},"live_data_pretty":{"type":"string","title":"Live Data Pretty","description":"Human-readable live data size"},"live_index_pretty":{"type":"string","title":"Live Index Pretty","description":"Human-readable live index size"},"archive_total_pretty":{"type":"string","title":"Archive Total Pretty","description":"Human-readable archive total size (data+indexes)"},"archive_data_pretty":{"type":"string","title":"Archive Data Pretty","description":"Human-readable archive data size"},"archive_index_pretty":{"type":"string","title":"Archive Index Pretty","description":"Human-readable archive index size"},"other_tables_pretty":{"type":"string","title":"Other Tables Pretty","description":"Human-readable other tables size"},"total_pretty":{"type":"string","title":"Total Pretty","description":"Human-readable total DB size"},"growth_class":{"type":"string","title":"Growth Class","description":"Growth complexity class: 'bounded' | 'linear_efficient' | 'linear'"}},"type":"object","required":["live_data_bytes","live_index_bytes","archive_data_bytes","archive_index_bytes","other_tables_bytes","total_bytes","live_row_count","archive_row_count","avg_bytes_per_live_row","avg_bytes_per_archive_row","live_data_span_days","live_total_pretty","live_data_pretty","live_index_pretty","archive_total_pretty","archive_data_pretty","archive_index_pretty","other_tables_pretty","total_pretty","growth_class"],"title":"StorageEstimate","description":"Storage sizes across all database tables."},"StorageStats":{"properties":{"minio_reachable":{"type":"boolean","title":"Minio Reachable"},"nutrition_objects_estimate":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Nutrition Objects Estimate"}},"type":"object","required":["minio_reachable","nutrition_objects_estimate"],"title":"StorageStats"},"SubscriptionRead":{"properties":{"plan":{"type":"string","title":"Plan"},"status":{"type":"string","title":"Status"},"current_period_end":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Current Period End"},"razorpay_configured":{"type":"boolean","title":"Razorpay Configured"}},"type":"object","required":["plan","status","current_period_end","razorpay_configured"],"title":"SubscriptionRead"},"SupportListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/SupportTicket"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"open_count":{"type":"integer","title":"Open Count"},"resolved_count":{"type":"integer","title":"Resolved Count"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["items","total","open_count","resolved_count","limit","offset"],"title":"SupportListResponse"},"SupportTicket":{"properties":{"id":{"type":"string","title":"Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"company":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company"},"topic":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Topic"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"ip":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ip"},"resolved":{"type":"boolean","title":"Resolved"},"resolved_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Resolved At"},"resolved_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolved By"}},"type":"object","required":["id","created_at","name","email","company","topic","message","ip","resolved","resolved_at","resolved_by"],"title":"SupportTicket"},"SyncDataType":{"type":"string","enum":["workouts","247","all"],"title":"SyncDataType","description":"Types of data to sync from provider."},"SyncRequest":{"properties":{"provider":{"type":"string","title":"Provider"},"sdkVersion":{"type":"string","title":"Sdkversion"},"syncTimestamp":{"type":"string","format":"date-time","title":"Synctimestamp"},"data":{"$ref":"#/components/schemas/SyncRequestData","description":"Container for health data arrays (records, sleep, workouts)"}},"type":"object","required":["provider","sdkVersion","syncTimestamp"],"title":"SyncRequest","description":"Schema for Apple HealthKit data import via SDK.\n\nThis schema represents the structure of health data exported from Apple HealthKit\nand sent to the SDK sync endpoint. The data is processed asynchronously via Celery.\n\nStructure:\n- `data.records`: Time-series measurements (heart rate, steps, distance, etc.)\n- `data.sleep`: Sleep phase records (in bed, awake, light, deep, REM)\n- `data.workouts`: Exercise/workout sessions with statistics\n\nAll fields within `data` are optional - you can send any combination of records, sleep, and workouts.","example":{"data":{"records":[{"endDate":"2026-02-24T08:30:00Z","id":"abc-xyz-123-sys","parentId":"abc-xyz-123","source":{"appId":"com.sec.android.app.shealth","deviceId":"R9ZW30ABC12","deviceManufacturer":"Samsung","deviceModel":"SM-R960","deviceName":"Galaxy Watch7","deviceType":"watch"},"startDate":"2026-02-24T08:30:00Z","type":"BLOOD_PRESSURE_SYSTOLIC","unit":"mmHg","value":122.0,"zoneOffset":"+01:00"}],"sleep":[{"endDate":"2026-02-24T00:00:00Z","id":"slp-001-s0-0","parentId":"slp-001","source":{"appId":"com.sec.android.app.shealth","deviceId":"R9ZW30ABC12","deviceManufacturer":"Samsung","deviceModel":"SM-R960","deviceName":"Galaxy Watch7","deviceType":"watch"},"stage":"light","startDate":"2026-02-23T23:10:00Z","values":[{"type":"sleepScore","unit":"score","value":82}],"zoneOffset":"+01:00"}],"workouts":[{"endDate":"2026-02-24T06:45:00Z","id":"wrk-001-s0","notes":"Morning run in the park","parentId":"wrk-001","route":[{"altitudeM":142.0,"horizontalAccuracyM":3.5,"latitude":52.229676,"longitude":21.012229,"timestamp":"2026-02-24T06:01:00Z"}],"samples":[{"timestamp":"2026-02-24T06:01:00Z","type":"heartRate","unit":"bpm","value":110.0},{"timestamp":"2026-02-24T06:01:00Z","type":"cadence","unit":"spm","value":155.0},{"timestamp":"2026-02-24T06:01:00Z","type":"speed","unit":"m/s","value":1.8}],"source":{"appId":"com.sec.android.app.shealth","deviceId":"R9ZW30ABC12","deviceManufacturer":"Samsung","deviceModel":"SM-R960","deviceName":"Galaxy Watch7","deviceType":"watch"},"startDate":"2026-02-24T06:00:00Z","type":"RUNNING","values":[{"type":"duration","unit":"ms","value":2700000},{"type":"calories","unit":"kcal","value":345.5},{"type":"distance","unit":"m","value":5234.0},{"type":"meanHeartRate","unit":"bpm","value":142.3},{"type":"maxHeartRate","unit":"bpm","value":178.0},{"type":"minHeartRate","unit":"bpm","value":95.0},{"type":"meanSpeed","unit":"m/s","value":1.5},{"type":"maxSpeed","unit":"m/s","value":3.2},{"type":"meanCadence","unit":"spm","value":165.0},{"type":"maxCadence","unit":"spm","value":182.0},{"type":"altitudeGain","unit":"m","value":45.0},{"type":"altitudeLoss","unit":"m","value":42.0},{"type":"maxAltitude","unit":"m","value":185.0},{"type":"minAltitude","unit":"m","value":140.0},{"type":"vo2Max","unit":"mL/kg/min","value":42.5}],"zoneOffset":"+01:00"}]},"provider":"samsung","sdkVersion":"0.1.0","syncTimestamp":"2026-02-24T10:00:00Z"}},"SyncRequestData":{"properties":{"records":{"items":{"$ref":"#/components/schemas/MetricRecord"},"type":"array","title":"Records","description":"Time-series health measurements (heart rate, steps, distance, etc.)"},"sleep":{"items":{"$ref":"#/components/schemas/SleepRecord"},"type":"array","title":"Sleep","description":"Sleep phase records (in bed, awake, light, deep, REM)."},"workouts":{"items":{"$ref":"#/components/schemas/Workout-Input"},"type":"array","title":"Workouts","description":"Exercise/workout sessions with optional statistics (distance, heart rate, calories, etc.)"}},"type":"object","title":"SyncRequestData","description":"Inner data structure for Apple HealthKit sync request.\n\nContains the actual health data arrays."},"SystemInfoResponse":{"properties":{"total_users":{"$ref":"#/components/schemas/CountWithGrowth"},"active_conn":{"$ref":"#/components/schemas/CountWithGrowth"},"data_points":{"$ref":"#/components/schemas/DataPointsInfo"}},"type":"object","required":["total_users","active_conn","data_points"],"title":"SystemInfoResponse","description":"Dashboard system information response."},"TableStat":{"properties":{"table":{"type":"string","title":"Table"},"rows_estimate":{"type":"integer","title":"Rows Estimate"},"size_pretty":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Size Pretty"}},"type":"object","required":["table","rows_estimate","size_pretty"],"title":"TableStat"},"TestEventRequest":{"properties":{"event_type":{"type":"string","title":"Event Type","description":"Event type to include in the test payload.","default":"workout.created"}},"type":"object","title":"TestEventRequest"},"TimeRange":{"properties":{"startDate":{"type":"string","format":"date-time","title":"Startdate"},"endDate":{"type":"string","format":"date-time","title":"Enddate"}},"type":"object","required":["startDate","endDate"],"title":"TimeRange"},"TimeSeriesConfig":{"properties":{"enabled_types":{"items":{"$ref":"#/components/schemas/SeriesType"},"type":"array","title":"Enabled Types","description":"Specific series types to emit. Empty list = no continuous series emitted. Workout-bound types are never affected by this list - they follow the workout generator."},"include_blood_pressure":{"type":"boolean","title":"Include Blood Pressure","description":"Emit paired blood_pressure_systolic + blood_pressure_diastolic.","default":false},"date_range_months":{"type":"integer","maximum":24.0,"minimum":1.0,"title":"Date Range Months","default":6},"date_from":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Date From","description":"Explicit start date. Overrides date_range_months."},"date_to":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Date To","description":"Explicit end date. Overrides date_range_months."}},"type":"object","title":"TimeSeriesConfig","description":"Parameters controlling continuous time-series generation.\n\nContinuous time-series are emitted across the full date range independently\nfrom workouts (e.g. heart rate every 5 min, weight weekly). Workout-bound\nseries (running_power, cadence, ...) are still emitted inside workout\nwindows and are not controlled by this config."},"TimeSeriesSample":{"properties":{"timestamp":{"type":"string","format":"date-time","title":"Timestamp"},"zone_offset":{"anyOf":[{"type":"string","maxLength":10,"pattern":"^[+-]\\d{2}:\\d{2}$"},{"type":"null"}],"title":"Zone Offset","description":"Timezone offset in the format '+01:00' or '-05:30'","examples":["+01:00","-05:30"]},"type":{"$ref":"#/components/schemas/SeriesType"},"value":{"anyOf":[{"type":"number"},{"type":"integer"}],"title":"Value"},"unit":{"type":"string","title":"Unit"},"source":{"anyOf":[{"$ref":"#/components/schemas/SourceMetadata"},{"type":"null"}]}},"type":"object","required":["timestamp","type","value","unit"],"title":"TimeSeriesSample"},"TimeseriesMetadata":{"properties":{"resolution":{"anyOf":[{"type":"string","enum":["raw","1min","5min","15min","1hour"]},{"type":"null"}],"title":"Resolution"},"sample_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Sample Count"},"start_time":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Start Time"},"end_time":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"End Time"}},"type":"object","title":"TimeseriesMetadata"},"ToggleSuperuserPayload":{"properties":{"is_superuser":{"type":"boolean","title":"Is Superuser"}},"type":"object","required":["is_superuser"],"title":"ToggleSuperuserPayload"},"TokenResponse":{"properties":{"access_token":{"type":"string","title":"Access Token"},"token_type":{"type":"string","title":"Token Type","default":"bearer"},"refresh_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Refresh Token"},"expires_in":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expires In"},"developer_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Developer Id"}},"type":"object","required":["access_token"],"title":"TokenResponse","description":"Token response with optional refresh token."},"TopDeveloperRow":{"properties":{"developer_id":{"type":"string","title":"Developer Id"},"email":{"type":"string","title":"Email"},"end_users":{"type":"integer","title":"End Users"},"api_keys":{"type":"integer","title":"Api Keys"},"event_records":{"type":"integer","title":"Event Records"}},"type":"object","required":["developer_id","email","end_users","api_keys","event_records"],"title":"TopDeveloperRow"},"UploadDataResponse":{"properties":{"status_code":{"type":"integer","title":"Status Code","description":"HTTP status code (typically 202 for async operations)"},"response":{"type":"string","title":"Response","description":"Human-readable response message"},"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id","description":"User ID associated with the import operation"}},"type":"object","required":["status_code","response"],"title":"UploadDataResponse","description":"Response schema for data upload/sync operations.\n\nReturned when health data is queued for asynchronous processing via Celery.\nThe actual import happens in the background - this response indicates the task was queued successfully."},"UsageBreakdown":{"properties":{"period_start":{"type":"string","format":"date-time","title":"Period Start"},"api_calls_billable":{"type":"integer","title":"Api Calls Billable"},"api_keys_active":{"type":"integer","title":"Api Keys Active"},"metering_rule":{"type":"string","title":"Metering Rule"},"notes":{"items":{"type":"string"},"type":"array","title":"Notes"}},"type":"object","required":["period_start","api_calls_billable","api_keys_active","metering_rule","notes"],"title":"UsageBreakdown","description":"Transparency view: shows what currently counts toward the plan cap.\n\nReturned alongside ``/summary`` so the dashboard can explain quota\nmoves to the developer (\"128 calls = 0 SDK + 128 dashboard pageloads\nthat were never billed under the post-2026-04-27 metering\"). Avoids\ncustomer support tickets that ask \"why is my counter going up when I\nhaven't shipped any code yet.\""},"UsageSummary":{"properties":{"plan":{"type":"string","title":"Plan"},"period_start":{"type":"string","format":"date-time","title":"Period Start"},"period_end":{"type":"string","format":"date-time","title":"Period End"},"tenant_created_at":{"type":"string","format":"date-time","title":"Tenant Created At"},"api_calls":{"type":"integer","title":"Api Calls"},"api_calls_limit":{"type":"integer","title":"Api Calls Limit"},"synced_users":{"type":"integer","title":"Synced Users"},"synced_users_limit":{"type":"integer","title":"Synced Users Limit"},"stored_events":{"type":"integer","title":"Stored Events"},"webhook_deliveries_limit":{"type":"integer","title":"Webhook Deliveries Limit"}},"type":"object","required":["plan","period_start","period_end","tenant_created_at","api_calls","api_calls_limit","synced_users","synced_users_limit","stored_events","webhook_deliveries_limit"],"title":"UsageSummary"},"UserConnectionWithCapabilities":{"properties":{"user_id":{"type":"string","format":"uuid","title":"User Id"},"provider":{"type":"string","title":"Provider"},"provider_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider User Id"},"provider_username":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider Username"},"scope":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scope"},"id":{"type":"string","format":"uuid","title":"Id"},"status":{"$ref":"#/components/schemas/ConnectionStatus"},"last_synced_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Synced At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"max_historical_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Historical Days"},"supports_pull":{"type":"boolean","title":"Supports Pull","default":false}},"type":"object","required":["user_id","provider","id","status","last_synced_at","created_at","updated_at"],"title":"UserConnectionWithCapabilities","description":"UserConnectionRead enriched with provider capability metadata.\n\nExtra fields are populated by the endpoint, not from the ORM model."},"UserCreate":{"properties":{"first_name":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"First Name"},"last_name":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Last Name"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email","description":"User email. Validated for RFC-5321 syntax only — synthetic addresses (.local, .test, internal-only subdomains) are accepted so partners can seed users with backend-derived emails."},"external_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External User Id","description":"Deprecated: no data-fetching endpoint (timeseries, workouts, sleep, summaries, health-scores, etc.) accepts external_user_id - they all require the WearLink UUID. This field was added early in the project but never wired into those endpoints, so it only works as a filter on GET /users. Store the UUID returned by POST /users in your own system instead.","deprecated":true}},"type":"object","title":"UserCreate"},"UserDataSummaryResponse":{"properties":{"user_id":{"type":"string","title":"User Id"},"total_data_points":{"type":"integer","title":"Total Data Points"},"total_workouts":{"type":"integer","title":"Total Workouts"},"total_sleep_events":{"type":"integer","title":"Total Sleep Events"},"series_type_counts":{"additionalProperties":{"type":"integer"},"type":"object","title":"Series Type Counts"},"workout_type_counts":{"additionalProperties":{"type":"integer"},"type":"object","title":"Workout Type Counts"},"by_provider":{"items":{"$ref":"#/components/schemas/ProviderDataCount"},"type":"array","title":"By Provider"}},"type":"object","required":["user_id","total_data_points","total_workouts","total_sleep_events","series_type_counts","workout_type_counts","by_provider"],"title":"UserDataSummaryResponse","description":"Per-user data summary with counts by type and provider."},"UserInvitationCodeRead":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"code":{"type":"string","title":"Code"},"user_id":{"type":"string","format":"uuid","title":"User Id"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","code","user_id","expires_at","created_at"],"title":"UserInvitationCodeRead","description":"Response schema after generating an invitation code."},"UserInvitationCodeRedeem":{"properties":{"code":{"type":"string","maxLength":8,"minLength":8,"pattern":"^[A-Z2-9]{8}$","title":"Code"}},"type":"object","required":["code"],"title":"UserInvitationCodeRedeem","description":"API input for redeeming an invitation code."},"UserRead":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"first_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Name"},"last_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Name"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"external_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External User Id","description":"Deprecated: no data-fetching endpoint (timeseries, workouts, sleep, summaries, health-scores, etc.) accepts external_user_id - they all require the WearLink UUID. This field was added early in the project but never wired into those endpoints, so it only works as a filter on GET /users. Store the UUID returned by POST /users in your own system instead.","deprecated":true},"last_synced_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Synced At"},"last_synced_provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Synced Provider"}},"type":"object","required":["id","created_at"],"title":"UserRead"},"UserUpdate":{"properties":{"first_name":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"First Name"},"last_name":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Last Name"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"external_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External User Id","description":"Deprecated: no data-fetching endpoint (timeseries, workouts, sleep, summaries, health-scores, etc.) accepts external_user_id - they all require the WearLink UUID. This field was added early in the project but never wired into those endpoints, so it only works as a filter on GET /users. Store the UUID returned by POST /users in your own system instead.","deprecated":true}},"type":"object","title":"UserUpdate"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"VerifyPaymentRequest":{"properties":{"razorpay_order_id":{"type":"string","title":"Razorpay Order Id"},"razorpay_payment_id":{"type":"string","title":"Razorpay Payment Id"},"razorpay_signature":{"type":"string","title":"Razorpay Signature"},"plan":{"type":"string","title":"Plan"}},"type":"object","required":["razorpay_order_id","razorpay_payment_id","razorpay_signature","plan"],"title":"VerifyPaymentRequest"},"VerifyPaymentResponse":{"properties":{"status":{"type":"string","title":"Status"},"plan":{"type":"string","title":"Plan"}},"type":"object","required":["status","plan"],"title":"VerifyPaymentResponse"},"VerifyRequest":{"properties":{"code":{"type":"string","maxLength":8,"minLength":6,"title":"Code"}},"type":"object","required":["code"],"title":"VerifyRequest"},"WebhookEndpointSummary":{"properties":{"id":{"type":"string","title":"Id","description":"Svix endpoint id"},"url":{"type":"string","title":"Url"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"filter_types":{"items":{"type":"string"},"type":"array","title":"Filter Types"},"scoped_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scoped User Id","description":"If non-null, this endpoint only receives events for this user."}},"type":"object","required":["id","url"],"title":"WebhookEndpointSummary"},"WebhookMessageAttemptResponse":{"properties":{"id":{"type":"string","title":"Id"},"endpointId":{"type":"string","title":"Endpointid"},"msgId":{"type":"string","title":"Msgid"},"url":{"type":"string","title":"Url"},"response":{"type":"string","title":"Response"},"responseStatusCode":{"type":"integer","title":"Responsestatuscode"},"responseDurationMs":{"type":"integer","title":"Responsedurationms"},"status":{"type":"integer","title":"Status"},"statusText":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Statustext"},"triggerType":{"type":"integer","title":"Triggertype"},"timestamp":{"type":"string","title":"Timestamp"},"msg":{"anyOf":[{"$ref":"#/components/schemas/WebhookMessageResponse"},{"type":"null"}]}},"type":"object","required":["id","endpointId","msgId","url","response","responseStatusCode","responseDurationMs","status","triggerType","timestamp"],"title":"WebhookMessageAttemptResponse","description":"A single delivery attempt for a webhook message to one endpoint."},"WebhookMessageResponse":{"properties":{"id":{"type":"string","title":"Id"},"eventType":{"type":"string","title":"Eventtype"},"eventId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Eventid"},"timestamp":{"type":"string","title":"Timestamp"},"channels":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Channels"},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tags"},"payload":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Payload"}},"type":"object","required":["id","eventType","timestamp"],"title":"WebhookMessageResponse","description":"A single webhook message (outgoing event emitted to all subscribed endpoints)."},"Workout-Input":{"properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id"},"parentId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parentid"},"type":{"anyOf":[{"$ref":"#/components/schemas/SDKWorkoutType"},{"type":"string"},{"type":"null"}],"title":"Type"},"startDate":{"type":"string","format":"date-time","title":"Startdate"},"endDate":{"type":"string","format":"date-time","title":"Enddate"},"zoneOffset":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Zoneoffset"},"source":{"anyOf":[{"$ref":"#/components/schemas/SourceInfo"},{"type":"null"}]},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"values":{"anyOf":[{"items":{"$ref":"#/components/schemas/WorkoutStatistic"},"type":"array"},{"type":"null"}],"title":"Values"},"segments":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Segments"},"laps":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Laps"},"route":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Route"},"samples":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Samples"},"metadata":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"}},"type":"object","required":["startDate","endDate"],"title":"Workout","description":"Schema for workout/exercise session from HealthKit."},"Workout-Output":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"type":{"type":"string","title":"Type"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","example":"Morning Run"},"start_time":{"type":"string","format":"date-time","title":"Start Time"},"end_time":{"type":"string","format":"date-time","title":"End Time"},"zone_offset":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Zone Offset"},"duration_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Seconds"},"source":{"$ref":"#/components/schemas/SourceMetadata"},"calories_kcal":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Calories Kcal"},"distance_meters":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Distance Meters"},"avg_heart_rate_bpm":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Avg Heart Rate Bpm"},"max_heart_rate_bpm":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Heart Rate Bpm"},"avg_pace_sec_per_km":{"anyOf":[{"type":"integer"},{"type":"number"},{"type":"null"}],"title":"Avg Pace Sec Per Km"},"elevation_gain_meters":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Elevation Gain Meters"}},"type":"object","required":["id","type","start_time","end_time","source"],"title":"Workout"},"WorkoutConfig":{"properties":{"count":{"type":"integer","maximum":500.0,"minimum":0.0,"title":"Count","default":80},"workout_types":{"anyOf":[{"items":{"$ref":"#/components/schemas/WorkoutType"},"type":"array"},{"type":"null"}],"title":"Workout Types","description":"Specific workout types to generate. None = random from all."},"duration_min_minutes":{"type":"integer","maximum":600.0,"minimum":5.0,"title":"Duration Min Minutes","default":15},"duration_max_minutes":{"type":"integer","maximum":600.0,"minimum":5.0,"title":"Duration Max Minutes","default":180},"hr_min_range":{"prefixItems":[{"type":"integer"},{"type":"integer"}],"type":"array","maxItems":2,"minItems":2,"title":"Hr Min Range","default":[90,120]},"hr_max_range":{"prefixItems":[{"type":"integer"},{"type":"integer"}],"type":"array","maxItems":2,"minItems":2,"title":"Hr Max Range","default":[140,180]},"steps_range":{"prefixItems":[{"type":"integer"},{"type":"integer"}],"type":"array","maxItems":2,"minItems":2,"title":"Steps Range","default":[500,20000]},"date_range_months":{"type":"integer","maximum":24.0,"minimum":1.0,"title":"Date Range Months","default":6},"date_from":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Date From","description":"Explicit start date. Overrides date_range_months."},"date_to":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Date To","description":"Explicit end date. Overrides date_range_months."}},"type":"object","title":"WorkoutConfig","description":"Parameters controlling workout generation."},"WorkoutStatistic":{"properties":{"type":{"anyOf":[{"$ref":"#/components/schemas/WorkoutStatisticType"},{"type":"string"}],"title":"Type"},"unit":{"type":"string","title":"Unit"},"value":{"anyOf":[{"type":"number"},{"type":"integer"}],"title":"Value"}},"type":"object","required":["type","unit","value"],"title":"WorkoutStatistic","description":"Schema for workout statistic (distance, heart rate, calories, etc.)."},"WorkoutStatisticType":{"type":"string","enum":["duration","totalDuration","activeEnergyBurned","basalEnergyBurned","calories","totalCalories","distance","stepCount","swimmingStrokeCount","minHeartRate","averageHeartRate","maxHeartRate","meanHeartRate","meanSpeed","meanCadence","maxCadence","averageRunningPower","averageRunningSpeed","averageRunningStrideLength","averageVerticalOscillation","averageGroundContactTime","vo2Max","elevationAscended","elevationDescended","altitudeGain","altitudeLoss","maxAltitude","minAltitude","averageSpeed","maxSpeed","averageMETs","lapLength","swimmingLocationType","indoorWorkout","weatherTemperature","weatherHumidity"],"title":"WorkoutStatisticType","description":"Apple HealthKit workout statistic types.\n\nThese represent the different metrics that can be recorded during a workout session."},"WorkoutType":{"type":"string","enum":["running","trail_running","treadmill","walking","hiking","mountaineering","cycling","mountain_biking","indoor_cycling","cyclocross","swimming","pool_swimming","open_water_swimming","strength_training","cardio_training","fitness_equipment","elliptical","rowing_machine","stair_climbing","yoga","pilates","stretching","meditation","cross_country_skiing","alpine_skiing","backcountry_skiing","downhill_skiing","snowboarding","snowshoeing","ice_skating","rowing","kayaking","canoeing","paddling","stand_up_paddleboarding","surfing","kitesurfing","windsurfing","sailing","water_polo","soccer","basketball","football","american_football","baseball","tennis","badminton","volleyball","handball","rugby","hockey","floorball","lacrosse","cricket","squash","table_tennis","padel","pickleball","boxing","martial_arts","wrestling","rock_climbing","indoor_climbing","bouldering","trail_hiking","orienteering","golf","skating","inline_skating","skateboarding","horseback_riding","gymnastics","triathlon","multisport","motorcycling","motor_sports","dance","aerobics","group_exercise","e_biking","virtual_activity","diving","snorkeling","walking_fitness","casual_walking","transition","generic","other","sport"],"title":"WorkoutType","description":"Unified workout/activity types for Polar, Suunto, and Garmin.\n\nBased on FIT SDK sport types and common activities across platforms.\nExcludes branded/niche activities (e.g., LES MILLS classes, specific dance types)."},"WorkoutTypeMetric":{"properties":{"workout_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workout Type"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["workout_type","count"],"title":"WorkoutTypeMetric","description":"Workout type metric information."},"app__api__routes__v1__auth__RefreshTokenRequest":{"properties":{"refresh_token":{"type":"string","title":"Refresh Token"}},"type":"object","required":["refresh_token"],"title":"RefreshTokenRequest"},"app__api__routes__v1__energy_balance__EnergyBalanceDay":{"properties":{"date":{"type":"string","title":"Date"},"kcal_in":{"type":"number","title":"Kcal In"},"kcal_out":{"type":"number","title":"Kcal Out"},"net":{"type":"number","title":"Net"}},"type":"object","required":["date","kcal_in","kcal_out","net"],"title":"EnergyBalanceDay"},"app__api__routes__v1__energy_balance__EnergyBalanceResponse":{"properties":{"user_id":{"type":"string","title":"User Id"},"days":{"items":{"$ref":"#/components/schemas/app__api__routes__v1__energy_balance__EnergyBalanceDay"},"type":"array","title":"Days"}},"type":"object","required":["user_id","days"],"title":"EnergyBalanceResponse"},"app__schemas__auth__token__RefreshTokenRequest":{"properties":{"refresh_token":{"type":"string","title":"Refresh Token"}},"type":"object","required":["refresh_token"],"title":"RefreshTokenRequest","description":"Request to exchange refresh token for new access token."},"app__schemas__enums__device_type__DeviceType":{"type":"string","enum":["watch","band","phone","scale","ring","other","unknown"],"title":"DeviceType","description":"Type of device that collected health data."},"app__schemas__providers__mobile_sdk__sync_request__DeviceType":{"type":"string","enum":["phone","watch","scale","ring","fitness_band","chest_strap","head_mounted","smart_display","unknown"],"title":"DeviceType","description":"Device type for HealthKit records."},"app__schemas__users__energy_balance__EnergyBalanceDay":{"properties":{"date":{"type":"string","format":"date","title":"Date"},"calories_consumed_kcal":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Calories Consumed Kcal"},"calories_burned_kcal":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Calories Burned Kcal"},"active_calories_kcal":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Active Calories Kcal"},"basal_calories_kcal":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Basal Calories Kcal"},"net_energy_balance_kcal":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Net Energy Balance Kcal","description":"calories_consumed - calories_burned. Null if either side is null."},"data_completeness":{"type":"string","enum":["none","nutrition_only","wearable_only","wearable_and_nutrition"],"title":"Data Completeness"}},"type":"object","required":["date","data_completeness"],"title":"EnergyBalanceDay"},"app__schemas__users__energy_balance__EnergyBalanceResponse":{"properties":{"user_id":{"type":"string","format":"uuid","title":"User Id"},"days":{"items":{"$ref":"#/components/schemas/app__schemas__users__energy_balance__EnergyBalanceDay"},"type":"array","title":"Days"}},"type":"object","required":["user_id","days"],"title":"EnergyBalanceResponse"}},"securitySchemes":{"OAuth2PasswordBearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"/api/v1/auth/login"}}}}}}